add: user accomplished
This commit is contained in:
@@ -2,7 +2,6 @@ package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"juwan-backend/app/users/rpc/internal/svc"
|
||||
"juwan-backend/app/users/rpc/pb"
|
||||
|
||||
@@ -24,7 +23,18 @@ func NewUpdateUsersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Updat
|
||||
}
|
||||
|
||||
func (l *UpdateUsersLogic) UpdateUsers(in *pb.UpdateUsersReq) (*pb.UpdateUsersResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
updater := l.svcCtx.UsersModelRW.UpdateOneID(in.Id).
|
||||
SetNillableNickname(in.Nickname).
|
||||
SetNillableAvatar(in.Avatar).
|
||||
SetNillableBio(in.Bio).
|
||||
SetNillableCurrentRole(in.CurrentRole).
|
||||
SetNillablePasswordHash(in.PasswordHash)
|
||||
if len(in.VerifiedRoles) > 0 {
|
||||
updater.SetVerifiedRoles(in.VerifiedRoles)
|
||||
}
|
||||
err := updater.Exec(l.ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &pb.UpdateUsersResp{}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user