完善通道管理机制 & 增强 otel 记录字段

This commit is contained in:
2026-05-08 17:30:51 +08:00
parent 042c8d1a51
commit 65f8ee360b
12 changed files with 265 additions and 194 deletions

View File

@@ -3,8 +3,8 @@ package web
import (
"platform/pkg/env"
auth2 "platform/web/auth"
"platform/web/core"
"platform/web/handlers"
s "platform/web/services"
"time"
q "platform/web/queries"
@@ -34,11 +34,8 @@ func ApplyRouters(app *fiber.App) {
}
return ctx.JSON(rs)
})
debug.Get("/channel/clear-expired", func(ctx *fiber.Ctx) error {
if err := s.Channel.ClearExpiredChannels(); err != nil {
return err
}
return ctx.SendStatus(fiber.StatusOK)
debug.Get("/test/err", func(ctx *fiber.Ctx) error {
return core.NewBizErr("测试错误")
})
}
}
@@ -208,6 +205,7 @@ func adminRouter(api fiber.Router) {
var channel = api.Group("/channel")
channel.Post("/page", handlers.PageChannelByAdmin)
channel.Post("/page/of-user", handlers.PageChannelOfUserByAdmin)
channel.Post("/sync/clear-expired", handlers.SyncChannelClearExpiredByAdmin)
// proxy 代理
var proxy = api.Group("/proxy")