Browse Source

#告警修改

zhongwei
yang_shj 1 year ago
parent
commit
b3ec70c789
  1. 36
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/controller/AlarmTestController.java
  2. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/listener/AlarmListener.java
  3. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java

36
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<AlarmEntity> entitys) {
return R.status(alarmSaveService.save(entitys));
}
}

2
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; private AlarmMessageSendService alarmMessageSendService;
@Autowired @Autowired
private RedisTemplate<Object, Object> redisTemplate; private RedisTemplate redisTemplate;
@Override @Override
public void onMessage(Message message, byte[] pattern) { public void onMessage(Message message, byte[] pattern) {

2
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 IStationClient stationClient;
private final RedisTemplate<Object, Object> redisTemplate; private final RedisTemplate redisTemplate;
@GetMapping(value = "pub/{msg}") @GetMapping(value = "pub/{msg}")
public String pubMsg(@PathVariable String msg){ public String pubMsg(@PathVariable String msg){

Loading…
Cancel
Save