whycxzp
2021-07-26 8c189b243bfbbacb2ab1ce79f4e1ff22708f125a
src/main/java/com/whyc/controller/AlarmRuleController.java
@@ -8,6 +8,7 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@@ -34,11 +35,6 @@
        return service.getRuleByDeviceFlag(deviceFlag);
    }
    /**
     * 新增规则,TODO 必须考虑阈值和级别的关系
     * @param alarmRule
     * @return
     */
    @PostMapping
    @ApiOperation(value = "新增规则")
    public Response add(@RequestBody AlarmRule alarmRule){
@@ -56,4 +52,23 @@
    public Response delete(@RequestParam int id){
        return service.delete(id);
    }
    @GetMapping("levelList")
    @ApiOperation(value = "查询已存在的告警级别")
    public Response getLevelListWithSameAlarm(@RequestParam Integer deviceFlag,
                                              @RequestParam String field,
                                              @RequestParam Integer thresholdFlag){
        return service.getLevelListWithSameAlarm(deviceFlag,field,thresholdFlag);
    }
    /**
     * 检查限制阈值的范围
     * @return
     */
    @PostMapping("thresholdValue")
    @ApiOperation(value="查询阈值范围")
    public Response getThresholdValueByLevel(@RequestBody AlarmRule alarmRule){
        return service.getThresholdValueByLevel(alarmRule);
    }
}