🎉 init
This commit is contained in:
28
app/auth/internal/handler/user/reset_password_handler.go
Normal file
28
app/auth/internal/handler/user/reset_password_handler.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"schisandra-album-cloud-microservices/app/auth/internal/logic/user"
|
||||
"schisandra-album-cloud-microservices/app/auth/internal/svc"
|
||||
"schisandra-album-cloud-microservices/app/auth/internal/types"
|
||||
)
|
||||
|
||||
func ResetPasswordHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.ResetPasswordRequest
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := user.NewResetPasswordLogic(r.Context(), svcCtx)
|
||||
resp, err := l.ResetPassword(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user