package com.tofly.xrtygis.custom.controller;

import com.tofly.common.core.entity.ResultRespone;
import com.tofly.xrtygis.custom.entity.dto.WaterparamsDto;
import com.tofly.xrtygis.custom.service.CustomWaterparamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author 20126
 */
@AllArgsConstructor
@RestController
@RequestMapping("customParams")
@Api(tags = "自定义水质参数配置表")
public class CustomWaterparamController {

    private final CustomWaterparamService customWaterparamService;

    @PostMapping("/insert")
    @ApiOperation("批量添加水质参数信息")
    public ResultRespone insertWaterparams(@RequestBody WaterparamsDto dto){
        return ResultRespone.success(customWaterparamService.insertWaterparams(dto));
    }

    @PutMapping("/update")
    @ApiOperation("批量修改水质参数信息")
    public ResultRespone updateWaterparams(@RequestBody WaterparamsDto dto){
        return ResultRespone.success(customWaterparamService.updateWaterparams(dto));
    }
}
