feat: 注册 C 端微信 JSSDK 配置接口路由及文档生成
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m35s

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-16 18:38:43 +08:00
parent 1125701329
commit fa554c3930
4 changed files with 12 additions and 0 deletions

View File

@@ -132,5 +132,6 @@ func initHandlers(svc *services, deps *Dependencies) *Handlers {
WechatConfig: admin.NewWechatConfigHandler(svc.WechatConfig),
AgentRecharge: admin.NewAgentRechargeHandler(svc.AgentRecharge, validate),
Refund: admin.NewRefundHandler(svc.Refund),
ClientWechat: app.NewClientWechatHandler(svc.WechatConfig, deps.Redis, deps.Logger),
}
}

View File

@@ -61,6 +61,7 @@ type Handlers struct {
WechatConfig *admin.WechatConfigHandler
AgentRecharge *admin.AgentRechargeHandler
Refund *admin.RefundHandler
ClientWechat *app.ClientWechatHandler
}
// Middlewares 封装所有中间件

View File

@@ -22,6 +22,15 @@ func RegisterPersonalCustomerRoutes(router fiber.Router, doc *openapi.Generator,
authBasePath := "/auth"
// === 公开路由(无需认证)===
Register(router, doc, basePath, "GET", "/wechat/jssdk-config", handlers.ClientWechat.GetJSSDKConfig, RouteSpec{
Summary: "获取微信 JSSDK 签名配置",
Description: "前端调用 wx.config() 初始化微信 JS-SDK 时所需的签名参数,需传入当前页面完整 URL",
Tags: []string{"个人客户 - 微信"},
Auth: false,
Input: &dto.JSSDKConfigRequest{},
Output: &dto.JSSDKConfigResponse{},
})
Register(router, doc, basePath, "POST", authBasePath+"/verify-asset", handlers.ClientAuth.VerifyAsset, RouteSpec{
Summary: "资产验证",
Tags: []string{"个人客户 - 认证"},

View File

@@ -62,5 +62,6 @@ func BuildDocHandlers() *bootstrap.Handlers {
WechatConfig: admin.NewWechatConfigHandler(nil),
AgentRecharge: admin.NewAgentRechargeHandler(nil, nil),
Refund: admin.NewRefundHandler(nil),
ClientWechat: app.NewClientWechatHandler(nil, nil, nil),
}
}