add: some user api and all api desc
This commit is contained in:
@@ -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"
|
||||
"time"
|
||||
|
||||
"juwan-backend/app/users/api/internal/svc"
|
||||
"juwan-backend/app/users/api/internal/types"
|
||||
@@ -31,7 +32,7 @@ func NewGetMeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMeLogic
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetMeLogic) GetMe() (resp *types.UserInfo, err error) {
|
||||
func (l *GetMeLogic) GetMe() (resp *types.User, err error) {
|
||||
userId, err := contextx.UserIDFrom(l.ctx)
|
||||
if err != nil {
|
||||
return nil, errors.New("illegal id")
|
||||
@@ -43,6 +44,8 @@ func (l *GetMeLogic) GetMe() (resp *types.UserInfo, err error) {
|
||||
return nil, errors.New("get user by id error")
|
||||
}
|
||||
err = converter.StructToStruct(user, &resp)
|
||||
createAt := time.Unix(user.Users.CreatedAt, 0)
|
||||
resp.CreatedAt = createAt.Format(time.DateTime)
|
||||
if err != nil {
|
||||
return nil, errors.New("to struct error")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user