app-cloudep-member-server/internal/logic/account/update_user_info_logic.go

37 lines
810 B
Go

package accountlogic
import (
"context"
ers "code.30cm.net/digimon/library-go/errors"
"app-cloudep-member-server/gen_result/pb/member"
"app-cloudep-member-server/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.OKResp, error) {
err := l.svcCtx.UserModel.UpdateSome(l.ctx, in)
if err != nil {
return nil, ers.DBError(err.Error())
}
return &member.OKResp{}, nil
}