Browse Source

#告警代码修改

zhongwei
yang_shj 1 year ago
parent
commit
e31f68c9da
  1. 47
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/AlarmController.java
  2. 28
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java

47
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/AlarmController.java

@ -1,47 +0,0 @@
package com.hnac.hzims.alarm.show.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.vo.AlarmCountVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* @author ysj
*/
@RestController
@AllArgsConstructor
@RequestMapping("/alarm/show")
@Api(value = "告警配置", tags = "告警配置")
public class AlarmController extends BladeController {
private final AlarmService alarmService;
@PostMapping("/alarms")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "告警列表分页", notes = "传入: AlarmConfigEntity对象,分页参数")
public R<IPage<AlarmEntity>> alarms(@ApiIgnore @RequestParam AlarmEntity alarm, Query query) {
return R.data(alarmService.alarms(alarm,Condition.getPage(query)));
}
@PostMapping("/count")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "告警分类数量", notes = "不需要传入参数")
public R<List<AlarmCountVo>> counts() {
return R.data(alarmService.counts());
}
}

28
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.alarm.entity.AlarmEntity;
import com.hnac.hzims.alarm.show.service.AlarmService;
import com.hnac.hzims.alarm.vo.AlarmCountVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
/**
@ -25,12 +27,27 @@ import java.util.Map;
*/
@RestController
@AllArgsConstructor
@RequestMapping("/show/alarm")
@RequestMapping("/alarm/show")
@Api(value = "告警配置", tags = "告警配置")
public class ShowAlarmController extends BladeController {
private final AlarmService alarmService;
@PostMapping("/alarms")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "告警列表分页", notes = "传入: AlarmConfigEntity对象,分页参数")
public R<IPage<AlarmEntity>> alarms(@ApiIgnore @RequestParam AlarmEntity alarm, Query query) {
return R.data(alarmService.alarms(alarm,Condition.getPage(query)));
}
@PostMapping("/count")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "告警分类数量", notes = "不需要传入参数")
public R<List<AlarmCountVo>> counts() {
return R.data(alarmService.counts());
}
@PostMapping("/save")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "新增", notes = "传入AlarmEntity对象")
@ -52,14 +69,7 @@ public class ShowAlarmController extends BladeController {
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(alarmService.deleteLogic(Func.toLongList(ids)));
}
@GetMapping("/count")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "告警数量", notes = "传入em_model_param")
public R count(@ApiIgnore @RequestParam AlarmEntity entity) {
QueryWrapper<AlarmEntity> queryWrapper = Condition.getQueryWrapper(entity);
int count = alarmService.count(queryWrapper);
return R.data(count);
}
@GetMapping("/list")
@ApiOperationSupport(order = 4)

Loading…
Cancel
Save