add: some user api and all api desc

This commit is contained in:
wwweww
2026-02-27 19:17:01 +08:00
parent a0c720eb2f
commit 5930fb0dde
156 changed files with 9457 additions and 1086 deletions
@@ -6,9 +6,10 @@ package user
import (
"context"
"errors"
"juwan-backend/app/users/api/internal/contextx"
"juwan-backend/app/users/rpc/usercenter"
"juwan-backend/common/converter"
"juwan-backend/common/utils/contextx"
"strings"
"juwan-backend/app/users/api/internal/svc"
"juwan-backend/app/users/api/internal/types"
@@ -31,16 +32,16 @@ func NewUpdateMeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateMe
}
}
func (l *UpdateMeLogic) UpdateMe(req *types.UpdateUserInfoReq) (resp *types.UserInfo, err error) {
func (l *UpdateMeLogic) UpdateMe(req *types.UpdateUserProfileReq) (resp *types.UpdateUserProfileReq, err error) {
userId, err := contextx.UserIDFrom(l.ctx)
if err != nil {
return nil, err
}
res, err := l.svcCtx.UserRpc.UpdateUsers(l.ctx, &usercenter.UpdateUsersReq{
Id: userId,
Nickname: req.Nickname,
Avatar: req.Avatar,
Bio: req.Bio,
Nickname: proto_string(req.Nickname),
Avatar: proto_string(req.Avatar),
Bio: proto_string(req.Bio),
VerifiedRoles: nil,
})
if err != nil {
@@ -53,3 +54,10 @@ func (l *UpdateMeLogic) UpdateMe(req *types.UpdateUserInfoReq) (resp *types.User
}
return
}
func proto_string(s string) *string {
if len(s) == 0 || strings.Contains(s, " ") {
return nil
}
return &s
}