This commit is contained in:
2025-12-12 14:43:24 +08:00
parent 13829de3e6
commit fd127bd285
4 changed files with 49 additions and 25 deletions

View File

@@ -589,25 +589,34 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodPost,
Path: "/apply",
Handler: agent.ApplyForAgentHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/link",
Handler: agent.GetLinkDataHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/register/invite",
Handler: agent.RegisterByInviteCodeHandler(serverCtx),
},
},
rest.WithPrefix("/api/v1/agent"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.AuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
Path: "/apply",
Handler: agent.ApplyForAgentHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/register/invite",
Handler: agent.RegisterByInviteCodeHandler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/v1/agent"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.UserAuthInterceptor},

View File

@@ -1,15 +1,15 @@
// Code generated by goctl. DO NOT EDIT.
package types
type GetAppConfigResp struct {
QueryRetentionDays int64 `json:"query_retention_days"`
}
type HealthCheckResp struct {
Status string `json:"status"` // 服务状态
Message string `json:"message"` // 状态信息
}
type GetAppConfigResp struct {
QueryRetentionDays int64 `json:"query_retention_days"`
}
type GetAppVersionResp struct {
Version string `json:"version"`
WgtUrl string `json:"wgtUrl"`