package com.tofly.xrtygis.custom.controller;

import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtygis.custom.service.CustomFixedService;
import com.tofly.xrtygis.entity.Costrlfixed;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author 20126
 */
@RestController
@RequestMapping("/fixed")
@Api(tags = "实际管理-制水单变")
@AllArgsConstructor
public class CustomFixedController {

    private final CustomFixedService customFixedService;

    @PostMapping("/insertFixed")
    @ApiOperation(value = "填报制水单变")
    public ResultRespone insertFixed(@RequestBody Costrlfixed fixed){
        return ResultRespone.success(customFixedService.insertFixed(fixed));
    }

    @DeleteMapping("/deleteFixed")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "id",value = "id",required = true,dataType = "string")
    )
    @ApiOperation(value = "删除制水单变")
    public ResultRespone deleteFixed(String id){
        return ResultRespone.success(customFixedService.deleteFixed(id));
    }

    @PutMapping("updateFixed")
    @ApiOperation("修改制水单变")
    public ResultRespone updateFixed(@RequestBody Costrlfixed fixed){
        return ResultRespone.success(customFixedService.updateFixed(fixed));
    }

    @GetMapping("/selectFixed")
    @ApiOperation("查看制水单变")
    public ResultRespone selectFixed(String month){
        return ResultRespone.success(customFixedService.selectFixed(month));
    }


}
