add: user accomplished

This commit is contained in:
wwweww
2026-02-27 05:42:13 +08:00
parent 659168fe32
commit a0c720eb2f
90 changed files with 9592 additions and 1180 deletions
@@ -5,6 +5,9 @@ package user
import (
"context"
"errors"
"juwan-backend/app/users/api/internal/contextx"
"juwan-backend/app/users/rpc/usercenter"
"juwan-backend/app/users/api/internal/svc"
"juwan-backend/app/users/api/internal/types"
@@ -28,7 +31,18 @@ func NewUpdateUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Up
}
func (l *UpdateUserInfoLogic) UpdateUserInfo(req *types.UpdateUserInfoReq) (resp *types.UpdateUserInfoResp, err error) {
// todo: add your logic here and delete this line
userId, err := contextx.UserIDFrom(l.ctx)
if err != nil {
return nil, errors.New("user not found")
}
_, err = l.svcCtx.UserRpc.UpdateUsers(l.ctx, &usercenter.UpdateUsersReq{
Id: userId,
Nickname: req.Nickname,
Avatar: req.Avatar,
Bio: req.Bio,
})
if err != nil {
return nil, errors.New("update user info failed")
}
return
}