package cn.gistack.sm.hk.controller;
|
|
|
import cn.gistack.sm.hk.entity.HkStaffGaugeMon;
|
import cn.gistack.sm.hk.service.HkStaffGaugeMonService;
|
import cn.gistack.sm.hk.vo.HkStaffGaugeMonVO;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.AllArgsConstructor;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springblade.core.mp.support.Condition;
|
import org.springblade.core.mp.support.Query;
|
import org.springblade.core.tool.api.R;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* @author zhongrj
|
* @Description: 水尺监测
|
* @date 2024-06-05
|
*/
|
@Slf4j
|
@Api(tags = "水尺监测")
|
@RestController
|
@RequestMapping("/hk/hkStaffGaugeMon")
|
@AllArgsConstructor
|
public class HkStaffGaugeMonController {
|
|
private final HkStaffGaugeMonService hkStaffGaugeMonService;
|
|
/**
|
* 分页列表查询
|
*
|
* @param hkStaffGaugeMon
|
* @return
|
*/
|
@ApiOperation(value="水尺监测-分页列表查询", notes="水尺监测-分页列表查询")
|
@GetMapping(value = "/list")
|
public R queryPageList(HkStaffGaugeMon hkStaffGaugeMon, Query query) {
|
IPage<HkStaffGaugeMon> pageList = hkStaffGaugeMonService.page(Condition.getPage(query), Condition.getQueryWrapper(hkStaffGaugeMon));
|
return R.data(pageList);
|
}
|
|
/**
|
* 自定义分页列表查询
|
* @param query
|
* @param hkStaffGaugeMon
|
* @return
|
*/
|
@ApiOperation(value="水尺监测-自定义分页列表查询", notes="水尺监测-自定义分页列表查询")
|
@GetMapping(value = "/page")
|
public R selectAlarmPage(HkStaffGaugeMonVO hkStaffGaugeMon, Query query) {
|
return R.data(hkStaffGaugeMonService.selectHkStaffGaugeMonPage(Condition.getPage(query),hkStaffGaugeMon));
|
}
|
|
/**
|
* 添加
|
*
|
* @param hkStaffGaugeMon
|
* @return
|
*/
|
@ApiOperation(value="水尺监测-添加", notes="水尺监测-添加")
|
@PostMapping(value = "/add")
|
public R add(@RequestBody HkStaffGaugeMon hkStaffGaugeMon) {
|
return R.data(hkStaffGaugeMonService.save(hkStaffGaugeMon));
|
}
|
|
/**
|
* 编辑
|
*
|
* @param hkStaffGaugeMon
|
* @return
|
*/
|
@ApiOperation(value="水尺监测-编辑", notes="水尺监测-编辑")
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
public R edit(@RequestBody HkStaffGaugeMon hkStaffGaugeMon) {
|
return R.data(hkStaffGaugeMonService.updateById(hkStaffGaugeMon));
|
}
|
|
/**
|
* 通过id查询
|
*
|
* @param id
|
* @return
|
*/
|
@ApiOperation(value="水尺监测-通过id查询", notes="水尺监测-通过id查询")
|
@GetMapping(value = "/queryById")
|
public R queryById(@RequestParam(name="id",required=true) String id) {
|
HkStaffGaugeMon hkStaffGaugeMon = hkStaffGaugeMonService.getById(id);
|
return R.data(hkStaffGaugeMon);
|
}
|
|
/**
|
* 定时读取
|
* @return
|
*/
|
@GetMapping(value = "/insert")
|
public void insert() {
|
// 保存数据
|
hkStaffGaugeMonService.saveHkStaffGaugeMonInfo();
|
}
|
|
/**
|
* 定时读取
|
* @return
|
*/
|
@PostMapping(value = "/test")
|
public void insert(@RequestBody String data) {
|
// 保存数据
|
hkStaffGaugeMonService.saveHkStaffGaugeMonInfo(data);
|
}
|
|
|
}
|