package com.tofly.waterMaking.controller;

import com.tofly.waterMaking.service.UserZhswService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RestController
@RequestMapping("/userZhsw")
@Api(tags = "sqlServer数据添加接口")
@AllArgsConstructor
public class UserZhswController {

    private final UserZhswService userZhswService;

    @PostMapping("/insert")
    @ApiOperation("添加")
    public boolean insertData(Date time, Double pac, Double pam, Double cn, Double qsl){
        return userZhswService.testInsert(time, pac, pam, cn, qsl);
    }

    @DeleteMapping("/delete")
    @ApiOperation("删除")
    public boolean deleteData(Date time){
        return userZhswService.deleteIndex(time);
    }

    @PutMapping("/update")
    @ApiOperation("修改")
    public boolean updateData(Date time, Double pac, Double pam, Double cn, Double qsl){
        return userZhswService.updateIndex(time, pac, pam, cn, qsl);
    }

}
