package member import ( "app-cloudep-portal-api-gateway/internal/domain" "app-cloudep-portal-api-gateway/internal/payload" "app-cloudep-portal-api-gateway/internal/svc" "app-cloudep-portal-api-gateway/internal/types" "context" "time" accountRpc "code.30cm.net/digimon/proto-all/pkg/member" "github.com/zeromicro/go-zero/core/logx" ) type InfoLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InfoLogic { return &InfoLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *InfoLogic) Info(_ *types.GetMemberHeader) (resp *types.UserInfoResp, err error) { info, err := l.svcCtx.AccountRpc.GetUserInfo(l.ctx, &accountRpc.GetUserInfoReq{ Uid: payload.UID(l.ctx), }) if err != nil { return nil, err } return &types.UserInfoResp{ Status: types.Status{ Code: domain.SuccessCode, Message: domain.SuccessMsg, }, Data: types.UserInfo{ UID: info.Data.Uid, VerifyType: info.Data.VerifyType.String(), AlarmType: info.Data.AlarmType.String(), Status: info.Data.Status.String(), Language: info.Data.Language, Currency: info.Data.Currency, Avatar: info.Data.Avatar, CreateTime: time.Unix(info.Data.CreateTime, 0).UTC().Format(time.RFC3339), UpdateTime: time.Unix(info.Data.UpdateTime, 0).UTC().Format(time.RFC3339), NickName: info.Data.NickName, }, }, nil }