feat(ops): 新增告警管理功能
添加告警请求VO、服务接口、服务实现及Controller,支持告警的基本管理操作。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.viewsh.module.ops.controller.admin.alarm;
|
||||
|
||||
import com.viewsh.framework.common.pojo.CommonResult;
|
||||
import com.viewsh.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.viewsh.module.ops.dal.dataobject.vo.alarm.OpsAlarmReqVO;
|
||||
import com.viewsh.module.ops.service.alarm.OpsAlarmService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
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 static com.viewsh.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 告警接收接口(对外开放)
|
||||
*/
|
||||
@Tag(name = "Open API - 告警接收")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/ops/alarm")
|
||||
@Validated
|
||||
public class OpsAlarmController {
|
||||
|
||||
@Resource
|
||||
private OpsAlarmService opsAlarmService;
|
||||
|
||||
@PostMapping("/receive")
|
||||
@Operation(summary = "接收告警并发送站内信通知")
|
||||
@PermitAll
|
||||
@TenantIgnore
|
||||
public CommonResult<Boolean> receiveAlarm(@Valid @RequestBody OpsAlarmReqVO reqVO) {
|
||||
opsAlarmService.receiveAlarm(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user