feat: implement V2 alert center and scoped alert governance

This commit is contained in:
Yvan
2026-11-05 20:08:29 +08:00
parent f8e26c5baf
commit 999c9a6315
57 changed files with 2711 additions and 216 deletions
@@ -0,0 +1,15 @@
package router
import (
"github.com/gin-gonic/gin"
"kra/internal/server/handler"
)
func RegisterAlertGovernance(private *gin.RouterGroup, h *handler.AlertGovernance) {
private.GET("/sw/alertRule/gap", h.Gap)
private.PUT("/sw/alertRule/gap", h.SaveGap)
private.GET("/sw/alertExemption/list", h.List)
private.GET("/sw/alertExemption/candidates", h.Candidates)
private.POST("/sw/alertExemption/add", h.Add)
private.PUT("/sw/alertExemption/remove/:id", h.Remove)
}
+2
View File
@@ -9,6 +9,7 @@ import (
func RegisterAlertRecord(private *gin.RouterGroup, h *handler.AlertRecord) {
g := private.Group("/sw/alertRecord")
g.GET("/list", h.List)
g.GET("/platforms", h.Platforms)
g.GET("/detail/:id", h.Detail)
g.POST("/startProcess", h.Process(business.AlertStart))
g.POST("/submitAudit", h.Process(business.AlertSubmit))
@@ -16,4 +17,5 @@ func RegisterAlertRecord(private *gin.RouterGroup, h *handler.AlertRecord) {
g.POST("/reject", h.Process(business.AlertReject))
g.POST("/reProcess", h.Process(business.AlertReprocess))
g.POST("/addNote", h.AddNote)
g.POST("/ignore", h.Ignore)
}
+1
View File
@@ -54,6 +54,7 @@ func (r *Routes) RegisterRoutes(public, private *gin.RouterGroup, engine *gin.En
},
func() { RegisterAlertRecord(private, r.handlers.AlertRecord) },
func() { RegisterAlertRule(private, r.handlers.AlertRule) },
func() { RegisterAlertGovernance(private, r.handlers.AlertGovernance) },
func() { private.GET("/sw/business/:userId/promotes", r.handlers.BusinessPromote.List) },
func() { RegisterBusiness(private, r.handlers.Business) },
func() { RegisterBusinessPassword(public, r.handlers.BusinessPassword) },