fix
This commit is contained in:
@@ -6,9 +6,6 @@ info (
|
|||||||
version: "v1"
|
version: "v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ============================================
|
|
||||||
// 公开接口(无需登录)
|
|
||||||
// ============================================
|
|
||||||
@server (
|
@server (
|
||||||
prefix: api/v1/agent
|
prefix: api/v1/agent
|
||||||
group: agent
|
group: agent
|
||||||
@@ -17,7 +14,14 @@ service main {
|
|||||||
// 获取推广链接数据
|
// 获取推广链接数据
|
||||||
@handler GetLinkData
|
@handler GetLinkData
|
||||||
get /link (GetLinkDataReq) returns (GetLinkDataResp)
|
get /link (GetLinkDataReq) returns (GetLinkDataResp)
|
||||||
|
}
|
||||||
|
|
||||||
|
@server (
|
||||||
|
prefix: api/v1/agent
|
||||||
|
group: agent
|
||||||
|
middleware: AuthInterceptor
|
||||||
|
)
|
||||||
|
service main {
|
||||||
// 通过邀请码申请成为代理(必须提供邀请码)
|
// 通过邀请码申请成为代理(必须提供邀请码)
|
||||||
@handler ApplyForAgent
|
@handler ApplyForAgent
|
||||||
post /apply (AgentApplyReq) returns (AgentApplyResp)
|
post /apply (AgentApplyReq) returns (AgentApplyResp)
|
||||||
@@ -119,11 +123,11 @@ type (
|
|||||||
}
|
}
|
||||||
// 获取代理等级特权信息
|
// 获取代理等级特权信息
|
||||||
GetLevelPrivilegeResp {
|
GetLevelPrivilegeResp {
|
||||||
Levels []LevelPrivilegeItem `json:"levels"`
|
Levels []LevelPrivilegeItem `json:"levels"`
|
||||||
UpgradeToGoldFee float64 `json:"upgrade_to_gold_fee"`
|
UpgradeToGoldFee float64 `json:"upgrade_to_gold_fee"`
|
||||||
UpgradeToDiamondFee float64 `json:"upgrade_to_diamond_fee"`
|
UpgradeToDiamondFee float64 `json:"upgrade_to_diamond_fee"`
|
||||||
UpgradeToGoldRebate float64 `json:"upgrade_to_gold_rebate"`
|
UpgradeToGoldRebate float64 `json:"upgrade_to_gold_rebate"`
|
||||||
UpgradeToDiamondRebate float64 `json:"upgrade_to_diamond_rebate"`
|
UpgradeToDiamondRebate float64 `json:"upgrade_to_diamond_rebate"`
|
||||||
}
|
}
|
||||||
LevelPrivilegeItem {
|
LevelPrivilegeItem {
|
||||||
Level int64 `json:"level"` // 等级:1=普通,2=黄金,3=钻石
|
Level int64 `json:"level"` // 等级:1=普通,2=黄金,3=钻石
|
||||||
@@ -594,3 +598,4 @@ service main {
|
|||||||
type (
|
type (
|
||||||
ShortLinkRedirectResp {}
|
ShortLinkRedirectResp {}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ info (
|
|||||||
group: app
|
group: app
|
||||||
)
|
)
|
||||||
service main {
|
service main {
|
||||||
@doc(
|
@doc (
|
||||||
summary: "心跳检测接口"
|
summary: "心跳检测接口"
|
||||||
)
|
)
|
||||||
@handler healthCheck
|
@handler healthCheck
|
||||||
@@ -19,12 +19,15 @@ service main {
|
|||||||
|
|
||||||
@handler getAppVersion
|
@handler getAppVersion
|
||||||
get /app/version returns (getAppVersionResp)
|
get /app/version returns (getAppVersionResp)
|
||||||
|
|
||||||
|
@handler getAppConfig
|
||||||
|
get /app/config returns (getAppConfigResp)
|
||||||
}
|
}
|
||||||
|
|
||||||
type (
|
type (
|
||||||
// 心跳检测响应
|
// 心跳检测响应
|
||||||
HealthCheckResp {
|
HealthCheckResp {
|
||||||
Status string `json:"status"` // 服务状态
|
Status string `json:"status"` // 服务状态
|
||||||
Message string `json:"message"` // 状态信息
|
Message string `json:"message"` // 状态信息
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -34,4 +37,11 @@ type (
|
|||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
WgtUrl string `json:"wgtUrl"`
|
WgtUrl string `json:"wgtUrl"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
getAppConfigResp {
|
||||||
|
QueryRetentionDays int64 `json:"query_retention_days"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -589,25 +589,34 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||||||
|
|
||||||
server.AddRoutes(
|
server.AddRoutes(
|
||||||
[]rest.Route{
|
[]rest.Route{
|
||||||
{
|
|
||||||
Method: http.MethodPost,
|
|
||||||
Path: "/apply",
|
|
||||||
Handler: agent.ApplyForAgentHandler(serverCtx),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Method: http.MethodGet,
|
Method: http.MethodGet,
|
||||||
Path: "/link",
|
Path: "/link",
|
||||||
Handler: agent.GetLinkDataHandler(serverCtx),
|
Handler: agent.GetLinkDataHandler(serverCtx),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Method: http.MethodPost,
|
|
||||||
Path: "/register/invite",
|
|
||||||
Handler: agent.RegisterByInviteCodeHandler(serverCtx),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
rest.WithPrefix("/api/v1/agent"),
|
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(
|
server.AddRoutes(
|
||||||
rest.WithMiddlewares(
|
rest.WithMiddlewares(
|
||||||
[]rest.Middleware{serverCtx.UserAuthInterceptor},
|
[]rest.Middleware{serverCtx.UserAuthInterceptor},
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
// Code generated by goctl. DO NOT EDIT.
|
// Code generated by goctl. DO NOT EDIT.
|
||||||
package types
|
package types
|
||||||
|
|
||||||
type GetAppConfigResp struct {
|
|
||||||
QueryRetentionDays int64 `json:"query_retention_days"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type HealthCheckResp struct {
|
type HealthCheckResp struct {
|
||||||
Status string `json:"status"` // 服务状态
|
Status string `json:"status"` // 服务状态
|
||||||
Message string `json:"message"` // 状态信息
|
Message string `json:"message"` // 状态信息
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetAppConfigResp struct {
|
||||||
|
QueryRetentionDays int64 `json:"query_retention_days"`
|
||||||
|
}
|
||||||
|
|
||||||
type GetAppVersionResp struct {
|
type GetAppVersionResp struct {
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
WgtUrl string `json:"wgtUrl"`
|
WgtUrl string `json:"wgtUrl"`
|
||||||
|
|||||||
Reference in New Issue
Block a user