This commit is contained in:
Mrx
2026-02-26 17:45:58 +08:00
parent e1fbf72437
commit f4deb0063b
15 changed files with 296 additions and 17 deletions

View File

@@ -0,0 +1,17 @@
package captcha
import (
"net/http"
"tydata-server/app/main/api/internal/logic/captcha"
"tydata-server/app/main/api/internal/svc"
"tydata-server/common/result"
)
func GetEncryptedSceneIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := captcha.NewGetEncryptedSceneIdLogic(r.Context(), svcCtx)
resp, err := l.GetEncryptedSceneId()
result.HttpResult(r, w, resp, err)
}
}

View File

@@ -22,6 +22,7 @@ import (
app "tydata-server/app/main/api/internal/handler/app"
auth "tydata-server/app/main/api/internal/handler/auth"
authorization "tydata-server/app/main/api/internal/handler/authorization"
captcha "tydata-server/app/main/api/internal/handler/captcha"
notification "tydata-server/app/main/api/internal/handler/notification"
pay "tydata-server/app/main/api/internal/handler/pay"
product "tydata-server/app/main/api/internal/handler/product"
@@ -952,6 +953,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
rest.WithPrefix("/api/v1"),
)
server.AddRoutes(
[]rest.Route{
{
// get encrypted scene id for aliyun captcha
Method: http.MethodPost,
Path: "/captcha/encryptedSceneId",
Handler: captcha.GetEncryptedSceneIdHandler(serverCtx),
},
},
rest.WithPrefix("/api/v1"),
)
server.AddRoutes(
[]rest.Route{
{