feat: add notify icon read
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user