add smsabuse

This commit is contained in:
Mrx
2026-02-26 10:48:38 +08:00
parent 7e0e027013
commit 6b7eaa6851
13 changed files with 259 additions and 19 deletions

View File

@@ -0,0 +1,21 @@
package captcha
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"qnc-server/app/main/api/internal/logic/captcha"
"qnc-server/app/main/api/internal/svc"
)
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()
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}

View File

@@ -21,6 +21,7 @@ import (
app "qnc-server/app/main/api/internal/handler/app"
auth "qnc-server/app/main/api/internal/handler/auth"
authorization "qnc-server/app/main/api/internal/handler/authorization"
captcha "qnc-server/app/main/api/internal/handler/captcha"
notification "qnc-server/app/main/api/internal/handler/notification"
pay "qnc-server/app/main/api/internal/handler/pay"
product "qnc-server/app/main/api/internal/handler/product"
@@ -852,6 +853,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{
{