feat: 补齐模块接口契约与管理 API 文档
This commit is contained in:
+17
-1
@@ -29,7 +29,7 @@ func cmdServe(_ []string) error {
|
||||
}
|
||||
|
||||
func runServe(ctx context.Context, cfg config.Config) error {
|
||||
wire()
|
||||
deps := wire()
|
||||
|
||||
if err := os.MkdirAll(cfg.DataDir, 0o755); err != nil {
|
||||
return fmt.Errorf("mkdir data_dir: %w", err)
|
||||
@@ -41,6 +41,22 @@ func runServe(ctx context.Context, cfg config.Config) error {
|
||||
}
|
||||
defer func() { _ = db.Close() }()
|
||||
|
||||
// 启动恢复入口已挂上(假实现为空操作);M 线替换 message.Service 后生效。
|
||||
if recoverErr := deps.Messages.RecoverOnStart(ctx); recoverErr != nil {
|
||||
return fmt.Errorf("message recover: %w", recoverErr)
|
||||
}
|
||||
// 其余 deps 供后续 admin / broker / httpx 接线;此处显式引用避免未使用告警。
|
||||
_ = deps.Identity
|
||||
_ = deps.Groups
|
||||
_ = deps.Presence
|
||||
_ = deps.Downlink
|
||||
_ = deps.Conns
|
||||
_ = deps.Uplink
|
||||
_ = deps.HashPool
|
||||
_ = deps.SessionTokens
|
||||
_ = deps.APITokens
|
||||
_ = deps.LoginLocks
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("GET /healthz", func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
Reference in New Issue
Block a user