info get profile

This commit is contained in:
eson
2023-09-26 17:45:07 +08:00
parent c880cba0a3
commit 54613f5be0
5 changed files with 15 additions and 15 deletions

View File

@@ -25,7 +25,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
{
Method: http.MethodPost,
Path: "/api/info/user/profile/update",
Handler: UpdateProfileHandler(serverCtx),
Handler: UpdateProfileBaseHandler(serverCtx),
},
{
Method: http.MethodPost,

View File

@@ -11,22 +11,22 @@ import (
"fusenapi/server/info/internal/types"
)
func UpdateProfileHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
func UpdateProfileBaseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ProfileRequest
var req types.ProfileBaseRequest
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}
// 创建一个业务逻辑层实例
l := logic.NewUpdateProfileLogic(r.Context(), svcCtx)
l := logic.NewUpdateProfileBaseLogic(r.Context(), svcCtx)
rl := reflect.ValueOf(l)
basic.BeforeLogic(w, r, rl)
resp := l.UpdateProfile(&req, userinfo)
resp := l.UpdateProfileBase(&req, userinfo)
if !basic.AfterLogic(w, r, rl, resp) {
basic.NormalAfterLogic(w, r, resp)