feat: add notify icon read

This commit is contained in:
engigu
2026-03-09 18:10:23 +08:00
parent e7da316c90
commit 77cf12c9b6
46 changed files with 1347 additions and 252 deletions
+11
View File
@@ -33,6 +33,7 @@ type Controllers struct {
Agent *controllers.AgentController
Mise *controllers.MiseController
Notification *controllers.NotificationController
AppLog *controllers.AppLogController
}
func mustSubFS(fsys fs.FS, dir string) fs.FS {
@@ -249,6 +250,7 @@ func initAuthorizedAPIRoutes(api *gin.RouterGroup, c *Controllers) {
registerAgentRoutes(authorized, c)
registerMiseRoutes(authorized, c)
registerNotificationRoutes(authorized, c)
registerAppLogRoutes(authorized, c)
}
// 通知发送 API(使用通知 Token 认证,供脚本调用)
@@ -421,6 +423,15 @@ func registerNotificationRoutes(g *gin.RouterGroup, c *Controllers) {
}
}
func registerAppLogRoutes(g *gin.RouterGroup, c *Controllers) {
appLogs := g.Group("/app-logs")
{
appLogs.GET("", c.AppLog.GetLogs)
appLogs.POST("/read", c.AppLog.MarkAsRead)
appLogs.POST("/clear", c.AppLog.ClearLogs)
}
}
func initAgentAPIRoutes(root *gin.RouterGroup, c *Controllers) {
// Agent API(供远程 Agent 调用,不使用 /v1 版本号)
agentAPI := root.Group("/api/agent")