From 50e3e7669873d240919bd076af3577dcd9492e36 Mon Sep 17 00:00:00 2001 From: Robin <7434053+warrior_of_light_robin@user.noreply.gitee.com> Date: Tue, 17 Dec 2024 13:36:31 +0800 Subject: [PATCH] by Robin at 20241217 --- api/proto/account/proto/account_op.go | 1 + api/proto/account/proto/account_vo_op.go | 4 ++++ app/mix/service/service.go | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/proto/account/proto/account_op.go b/api/proto/account/proto/account_op.go index 599b42f7..ab4e85d0 100644 --- a/api/proto/account/proto/account_op.go +++ b/api/proto/account/proto/account_op.go @@ -105,6 +105,7 @@ type OpGetMobilePhoneByUserIdReq struct { type OpGetMobilePhoneByUserIdData struct { MobilePhone string `json:"mobile_phone"` + *OpListOthersVO } type OpGetMobilePhoneByUserIdResp struct { diff --git a/api/proto/account/proto/account_vo_op.go b/api/proto/account/proto/account_vo_op.go index fb5bc3ca..287bd51d 100644 --- a/api/proto/account/proto/account_vo_op.go +++ b/api/proto/account/proto/account_vo_op.go @@ -30,6 +30,10 @@ type OpListOthersVO struct { Role *int64 `json:"role" bson:"role"` // 角色 } +func NewOpListOthersVO() *OpListOthersVO { + return &OpListOthersVO{} +} + func (vo *OpListVO) CopyAccount(account *dbstruct.Account) *OpListVO { if account == nil { return vo diff --git a/app/mix/service/service.go b/app/mix/service/service.go index c5de75f0..7f1deb3c 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -991,7 +991,7 @@ func (s *Service) OpGetAccountListByUserId(ctx *gin.Context, req *accountproto.O return } -func (s *Service) OpGetMobilePhoneByUserId(ctx *gin.Context, req *accountproto.OpGetMobilePhoneByUserIdReq) (mobilePhone string, ec errcode.ErrCode) { +func (s *Service) OpGetMobilePhoneByUserId(ctx *gin.Context, req *accountproto.OpGetMobilePhoneByUserIdReq) (mobilePhone string, vo *accountproto.OpListOthersVO, ec errcode.ErrCode) { ec = errcode.ErrCodeAccountSrvOk // 业务鉴权 @@ -1011,7 +1011,7 @@ func (s *Service) OpGetMobilePhoneByUserId(ctx *gin.Context, req *accountproto.O base64DecryptedBytes, _ := base64.StdEncoding.DecodeString(util.DerefString(account.MobilePhone)) phoneBytes, _ := mycrypto.CryptoServiceInstance().AES.Decrypt(base64DecryptedBytes) mobilePhone = string(phoneBytes) - + vo = accountproto.NewOpListOthersVO().CopyAccount(account) } return