42 lines
1.5 KiB
Java
42 lines
1.5 KiB
Java
|
|
package com.gunshi.project.hsz.controller;
|
||
|
|
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||
|
|
import com.gunshi.core.result.R;
|
||
|
|
import com.gunshi.project.hsz.entity.so.TermiteSurveyPageSo;
|
||
|
|
import com.gunshi.project.hsz.entity.so.WarningRulePageSo;
|
||
|
|
import com.gunshi.project.hsz.model.TermiteSurvey;
|
||
|
|
import com.gunshi.project.hsz.model.WarningRule;
|
||
|
|
import com.gunshi.project.hsz.service.WarningRuleService;
|
||
|
|
import io.swagger.v3.oas.annotations.Operation;
|
||
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.validation.annotation.Validated;
|
||
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
|
||
|
|
@Tag(name = "预警规则")
|
||
|
|
@RestController
|
||
|
|
@RequestMapping(value="/warn/rule")
|
||
|
|
public class WarningRuleController {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private WarningRuleService warningRuleService;
|
||
|
|
|
||
|
|
|
||
|
|
@Operation(summary = "分页")
|
||
|
|
@PostMapping("/page")
|
||
|
|
public R<Page<WarningRule>> page(@RequestBody @Validated WarningRulePageSo page) {
|
||
|
|
return R.ok(warningRuleService.pageQuery(page));
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
@Operation(summary = "新增")
|
||
|
|
@PostMapping("/insert")
|
||
|
|
public R<WarningRule> insert(@RequestBody @Validated WarningRule dto) {
|
||
|
|
return R.ok(warningRuleService.saveData(dto));
|
||
|
|
}
|
||
|
|
}
|