diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/controller/AlarmTestController.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/controller/AlarmTestController.java new file mode 100644 index 0000000..4a79188 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/controller/AlarmTestController.java @@ -0,0 +1,36 @@ +package com.hnac.hzims.alarm.monitor.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.monitor.service.AlarmSaveService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +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; + +import java.util.List; + +/** + * @author ysj + */ +@RestController +@AllArgsConstructor +@RequestMapping("/alarm/test") +@Api(value = "告警配置", tags = "告警配置") +public class AlarmTestController extends BladeController { + + private final AlarmSaveService alarmSaveService; + + @PostMapping("/save") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "新增告警", notes = "传入AlarmConfigEntity对象") + public R save(@RequestBody List entitys) { + return R.status(alarmSaveService.save(entitys)); + } + +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/listener/AlarmListener.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/listener/AlarmListener.java index 24c9fb8..2e553a7 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/listener/AlarmListener.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/listener/AlarmListener.java @@ -20,7 +20,7 @@ public class AlarmListener implements MessageListener { private AlarmMessageSendService alarmMessageSendService; @Autowired - private RedisTemplate redisTemplate; + private RedisTemplate redisTemplate; @Override public void onMessage(Message message, byte[] pattern) { diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java index 2725a9b..bb22640 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java @@ -35,7 +35,7 @@ public class AlarmSaveServiceImpl implements AlarmSaveService { private final IStationClient stationClient; - private final RedisTemplate redisTemplate; + private final RedisTemplate redisTemplate; @GetMapping(value = "pub/{msg}") public String pubMsg(@PathVariable String msg){