Browse Source

sts接口加校验

宋伯文 5 months ago
parent
commit
02cca7299b
2 changed files with 5 additions and 16 deletions
  1. 0 6
      desc/wechat/avatar.api
  2. 5 10
      internal/handler/routes.go

+ 0 - 6
desc/wechat/avatar.api

@@ -67,13 +67,7 @@ service Wechat {
 	// get avatar configuration | 获取数字人配置信息
 	@handler getApiAvatarConfig
 	post /api/avatar/config (AvatarConfigReq) returns (AvatarConfigResp)
-}
 
-@server(
-    group: avatar
-)
-
-service Wechat {
 	// get avatar configuration | 获取数字人配置信息
     @handler getAcsResponse
     post /api/avatar/sts () returns (AvatarStsResp)

+ 5 - 10
internal/handler/routes.go

@@ -1288,18 +1288,13 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 					Path:    "/api/avatar/config",
 					Handler: avatar.GetApiAvatarConfigHandler(serverCtx),
 				},
+				{
+					Method:  http.MethodPost,
+					Path:    "/api/avatar/sts",
+					Handler: avatar.GetAcsResponseHandler(serverCtx),
+				},
 			}...,
 		),
 		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
 	)
-
-	server.AddRoutes(
-		[]rest.Route{
-			{
-				Method:  http.MethodPost,
-				Path:    "/api/avatar/sts",
-				Handler: avatar.GetAcsResponseHandler(serverCtx),
-			},
-		},
-	)
 }