// Code scaffolded by goctl. Safe to edit. // goctl 1.9.2 package profile import ( "net/http" "github.com/youruser/base/internal/logic/profile" "github.com/youruser/base/internal/svc" "github.com/youruser/base/internal/types" "github.com/zeromicro/go-zero/rest/httpx" ) // 更新个人资料 func UpdateProfileHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var req types.UpdateProfileRequest if err := httpx.Parse(r, &req); err != nil { httpx.ErrorCtx(r.Context(), w, err) return } l := profile.NewUpdateProfileLogic(r.Context(), svcCtx) resp, err := l.UpdateProfile(&req) if err != nil { httpx.ErrorCtx(r.Context(), w, err) } else { httpx.OkJsonCtx(r.Context(), w, resp) } } }