Add AI detection management and synchronization features

This commit is contained in:
xugo
2026-01-08 21:25:44 +08:00
parent 338eb89699
commit 079aca7601
10 changed files with 367 additions and 43 deletions
+3
View File
@@ -1,6 +1,7 @@
package api
import (
"context"
"expvar"
"fmt"
"log/slog"
@@ -110,6 +111,8 @@ func setupRouter(r *gin.Engine, uc *Usecase) {
// 注册 AI 分析服务回调接口
registerAIWebhookAPI(r, uc.AIWebhookAPI)
// 启动 AI 任务同步协程,每 5 分钟检测一次数据库与内存状态差异
uc.AIWebhookAPI.StartAISyncLoop(context.Background(), uc.SMSAPI.smsCore)
// TODO: 待补充中间件
RegisterEvent(r, uc.EventAPI)
}