fusenapi/home-user-auth/internal/handler/userbasicinfohandler.go
2023-06-01 18:35:09 +08:00

30 lines
674 B
Go

package handler
import (
"net/http"
"fusenapi/home-user-auth/internal/logic"
"fusenapi/home-user-auth/internal/svc"
"fusenapi/home-user-auth/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
func UserBasicInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := logic.NewUserBasicInfoLogic(r.Context(), svcCtx)
resp, err := l.UserBasicInfo(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}