fix
This commit is contained in:
@@ -6,9 +6,6 @@ info (
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
// ============================================
|
||||
// 公开接口(无需登录)
|
||||
// ============================================
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
@@ -17,7 +14,14 @@ service main {
|
||||
// 获取推广链接数据
|
||||
@handler GetLinkData
|
||||
get /link (GetLinkDataReq) returns (GetLinkDataResp)
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1/agent
|
||||
group: agent
|
||||
middleware: AuthInterceptor
|
||||
)
|
||||
service main {
|
||||
// 通过邀请码申请成为代理(必须提供邀请码)
|
||||
@handler ApplyForAgent
|
||||
post /apply (AgentApplyReq) returns (AgentApplyResp)
|
||||
@@ -594,3 +598,4 @@ service main {
|
||||
type (
|
||||
ShortLinkRedirectResp {}
|
||||
)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ info (
|
||||
group: app
|
||||
)
|
||||
service main {
|
||||
@doc(
|
||||
@doc (
|
||||
summary: "心跳检测接口"
|
||||
)
|
||||
@handler healthCheck
|
||||
@@ -19,6 +19,9 @@ service main {
|
||||
|
||||
@handler getAppVersion
|
||||
get /app/version returns (getAppVersionResp)
|
||||
|
||||
@handler getAppConfig
|
||||
get /app/config returns (getAppConfigResp)
|
||||
}
|
||||
|
||||
type (
|
||||
@@ -35,3 +38,10 @@ type (
|
||||
WgtUrl string `json:"wgtUrl"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
getAppConfigResp {
|
||||
QueryRetentionDays int64 `json:"query_retention_days"`
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -589,22 +589,31 @@ 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),
|
||||
},
|
||||
},
|
||||
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"),
|
||||
)
|
||||
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user