ark-member/internal/logic/update_user_info_logic.go

42 lines
891 B
Go
Raw Permalink Normal View History

2024-07-21 15:57:56 +00:00
package logic
import (
"context"
"member/gen_result/pb/member"
2024-07-25 17:05:23 +00:00
"member/internal/domain"
ers "member/internal/lib/error"
2024-07-21 15:57:56 +00:00
"member/internal/svc"
"github.com/zeromicro/go-zero/core/logx"
)
type UpdateUserInfoLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewUpdateUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateUserInfoLogic {
return &UpdateUserInfoLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
// UpdateUserInfo 更新 User Info
func (l *UpdateUserInfoLogic) UpdateUserInfo(in *member.UpdateUserInfoReq) (*member.Response, error) {
2024-07-25 17:05:23 +00:00
err := l.svcCtx.UserModel.UpdateSome(l.ctx, in)
if err != nil {
return nil, ers.DBError(err.Error())
}
2024-07-21 15:57:56 +00:00
2024-07-25 17:05:23 +00:00
return &member.Response{
Status: &member.BaseResp{
Code: domain.CodeOk.ToString(),
Message: "success",
Error: "",
},
}, nil
2024-07-21 15:57:56 +00:00
}