feat: 换到 Gin 主流栈并补齐运维能力

HTTP 用 Gin,配置用 Viper,日志用 zap,数据用 sqlx;保留原有接口与会商行为。
顺带补上就绪探活、请求号、滚动日志、systemd 与 Dockerfile。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
gozerosandCursor committed 2026-11-04 09:51:41 +08:00
1 parent 0c45b86d67
commit bd427b57a1
26 files changed
+1213 -302

No files matched your search

+3
View File
@@ -10,6 +10,7 @@ import (
"time"
"git.gozeros.com/wsk/eightbf-analysis-go/internal/config"
"git.gozeros.com/wsk/eightbf-analysis-go/internal/logging"
)
// Auth 向 DeerFlow 换 Bearer,过期前复用。
@@ -68,5 +69,7 @@ func (a *Auth) BearerToken() (string, error) {
}
a.token = parsed.AccessToken
a.expiresAt = now.Add(time.Duration(parsed.ExpiresIn) * time.Second)
// 只打过期秒数,不打 token
logging.L.Infow("DeerFlow 登录成功", "expiresInSec", parsed.ExpiresIn)
return a.token, nil
}
+2 -2
View File
@@ -6,12 +6,12 @@ import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"strings"
"time"
"git.gozeros.com/wsk/eightbf-analysis-go/internal/config"
"git.gozeros.com/wsk/eightbf-analysis-go/internal/logging"
)
// Client 调 DeerFlow:模型校验 / init / run/stream。
@@ -127,7 +127,7 @@ func (c *Client) InitMultiAgent(agentNames []string, mainAgent, model string) (m
if len(threadIDs) == 0 {
return nil, fmt.Errorf("多智能体初始化未返回 thread_ids")
}
log.Printf("DeerFlow init 完成 seats=%d", len(threadIDs))
logging.L.Infow("DeerFlow init 完成", "seats", len(threadIDs))
return threadIDs, nil
}