feat(ops): 新增告警管理功能
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled

添加告警请求VO、服务接口、服务实现及Controller,支持告警的基本管理操作。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
lzh
2026-02-13 09:30:57 +08:00
parent b851484e4e
commit c9195f78e9
5 changed files with 2269 additions and 0 deletions

View File

@@ -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);
}
}