code migration

This commit is contained in:
landaiqing
2024-11-15 02:02:19 +08:00
parent b2d753e832
commit 34c4690f80
85 changed files with 4349 additions and 421 deletions

View File

@@ -0,0 +1,21 @@
package captcha
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"schisandra-album-cloud-microservices/app/core/api/internal/logic/captcha"
"schisandra-album-cloud-microservices/app/core/api/internal/svc"
)
func GenerateRotateCaptchaHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := captcha.NewGenerateRotateCaptchaLogic(r.Context(), svcCtx)
resp, err := l.GenerateRotateCaptcha()
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,21 @@
package captcha
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"schisandra-album-cloud-microservices/app/core/api/internal/logic/captcha"
"schisandra-album-cloud-microservices/app/core/api/internal/svc"
)
func GenerateSlideBasicCaptchaHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := captcha.NewGenerateSlideBasicCaptchaLogic(r.Context(), svcCtx)
resp, err := l.GenerateSlideBasicCaptcha()
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}