From a3070118334ad7845c1f05a5b4921cf1fb3f5acf Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 1 Aug 2023 14:20:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/controller/EarlyWarningController.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java new file mode 100644 index 0000000..d446d01 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/EarlyWarningController.java @@ -0,0 +1,42 @@ +package com.ningdatech.pmapi.sys.controller; + +import com.ningdatech.log.annotation.WebLog; +import com.wflow.bean.dto.WflowEarlyWarningDTO; +import com.wflow.bean.vo.WflowEarlyWarningVO; +import com.wflow.service.IEarlyWarningService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @Classname EarlyWarningController + * @Description + * @Date 2023/8/01 14:28 + * @Author PoffyZhang + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/sys/early-warning") +@Api(value = "EarlyWarning", tags = "系统管理-预警规则") +@RequiredArgsConstructor +public class EarlyWarningController { + + private final IEarlyWarningService earlyWarningService; + + @ApiOperation(value = "预警规则获取", notes = "预警规则获取") + @GetMapping("/detail/{regionCode}") + public WflowEarlyWarningVO detail(@PathVariable String regionCode) { + return earlyWarningService.detailByRegion(regionCode); + } + + @ApiOperation(value = "预警规则保存", notes = "预警规则保存") + @PostMapping("/save") + @WebLog("预警规则保存") + public String save(@Validated @RequestBody WflowEarlyWarningDTO dto) { + return earlyWarningService.saveByDto(dto); + } +}