fix-20231231-Robin-BUG0001 #28

Merged
chenhao merged 3 commits from fix-20231231-Robin-BUG0001 into test 2023-12-31 13:44:37 +08:00
7 changed files with 42 additions and 0 deletions
Showing only changes of commit c11180094e - Show all commits

View File

@ -31,6 +31,9 @@ type ApiListOthersVO struct {
} }
func (vo *ApiListVO) CopyAccount(account *dbstruct.Account) *ApiListVO { func (vo *ApiListVO) CopyAccount(account *dbstruct.Account) *ApiListVO {
if account == nil {
return vo
}
vo.Mid = account.Mid vo.Mid = account.Mid
vo.Name = account.Name vo.Name = account.Name
vo.UserId = account.UserId vo.UserId = account.UserId
@ -48,6 +51,9 @@ func (vo *ApiListVO) CopyAccount(account *dbstruct.Account) *ApiListVO {
} }
func (vo *ApiListVO) CopyWallet(wallet *dbstruct.Wallet) *ApiListVO { func (vo *ApiListVO) CopyWallet(wallet *dbstruct.Wallet) *ApiListVO {
if wallet == nil {
return vo
}
vo.GoldNum = wallet.Coins vo.GoldNum = wallet.Coins
vo.DiamondNum = wallet.Diamonds vo.DiamondNum = wallet.Diamonds
vo.WithdrawDiamondNum = wallet.WithdrawDiamonds vo.WithdrawDiamondNum = wallet.WithdrawDiamonds
@ -55,6 +61,9 @@ func (vo *ApiListVO) CopyWallet(wallet *dbstruct.Wallet) *ApiListVO {
} }
func (vo *ApiListOthersVO) CopyAccount(account *dbstruct.Account) *ApiListOthersVO { func (vo *ApiListOthersVO) CopyAccount(account *dbstruct.Account) *ApiListOthersVO {
if account == nil {
return vo
}
vo.Mid = account.Mid vo.Mid = account.Mid
vo.Name = account.Name vo.Name = account.Name
vo.UserId = account.UserId vo.UserId = account.UserId

View File

@ -30,6 +30,9 @@ type OpListOthersVO struct {
} }
func (vo *OpListVO) CopyAccount(account *dbstruct.Account) *OpListVO { func (vo *OpListVO) CopyAccount(account *dbstruct.Account) *OpListVO {
if account == nil {
return vo
}
vo.Mid = account.Mid vo.Mid = account.Mid
vo.Name = account.Name vo.Name = account.Name
vo.UserId = account.UserId vo.UserId = account.UserId
@ -47,6 +50,9 @@ func (vo *OpListVO) CopyAccount(account *dbstruct.Account) *OpListVO {
} }
func (vo *OpListOthersVO) CopyAccount(account *dbstruct.Account) *OpListOthersVO { func (vo *OpListOthersVO) CopyAccount(account *dbstruct.Account) *OpListOthersVO {
if account == nil {
return vo
}
vo.Mid = account.Mid vo.Mid = account.Mid
vo.Name = account.Name vo.Name = account.Name
vo.UserId = account.UserId vo.UserId = account.UserId

View File

@ -13,6 +13,9 @@ type RealNameAuthenticationApiVO struct {
} }
func (p *RealNameAuthenticationApiVO) CopyRealNameAuthentication(realname_authentication *dbstruct.RealNameAuthentication) { func (p *RealNameAuthenticationApiVO) CopyRealNameAuthentication(realname_authentication *dbstruct.RealNameAuthentication) {
if realname_authentication == nil {
return
}
p.Status = util.DerefInt64(realname_authentication.Status) p.Status = util.DerefInt64(realname_authentication.Status)
p.StautsDesc = consts.RealNameAuthenticationStatusDescMap[p.Status] p.StautsDesc = consts.RealNameAuthenticationStatusDescMap[p.Status]
p.Remarks = util.DerefString(realname_authentication.Remarks) p.Remarks = util.DerefString(realname_authentication.Remarks)

View File

@ -50,6 +50,9 @@ type OpListExtVO struct {
} }
func (vo *OpListExtVO) CopyAccount(account *dbstruct.Account) { func (vo *OpListExtVO) CopyAccount(account *dbstruct.Account) {
if account == nil {
return
}
vo.Name = account.Name vo.Name = account.Name
vo.UserId = account.UserId vo.UserId = account.UserId
vo.Avatar = account.Avatar vo.Avatar = account.Avatar
@ -57,6 +60,9 @@ func (vo *OpListExtVO) CopyAccount(account *dbstruct.Account) {
} }
func (vo *OpListExtVO) CopyStreamer(streamer *dbstruct.Streamer) { func (vo *OpListExtVO) CopyStreamer(streamer *dbstruct.Streamer) {
if streamer == nil {
return
}
vo.Id = streamer.Id vo.Id = streamer.Id
vo.Mid = streamer.Mid vo.Mid = streamer.Mid
vo.Gender = streamer.Gender vo.Gender = streamer.Gender
@ -78,6 +84,9 @@ func (vo *OpListExtVO) CopyStreamer(streamer *dbstruct.Streamer) {
} }
func (vo *OpListExtVO) CopyPlatforms(platforms *[]*streamerlinkproto.StreamerLinkVO) { func (vo *OpListExtVO) CopyPlatforms(platforms *[]*streamerlinkproto.StreamerLinkVO) {
if platforms == nil {
return
}
vo.Platforms = platforms vo.Platforms = platforms
} }
@ -86,6 +95,9 @@ type OpListWxIdVO struct {
} }
func (vo *OpListWxIdVO) CopyStreamer(streamer *dbstruct.Streamer) { func (vo *OpListWxIdVO) CopyStreamer(streamer *dbstruct.Streamer) {
if streamer == nil {
return
}
vo.Mid = streamer.Mid vo.Mid = streamer.Mid
} }

View File

@ -13,6 +13,9 @@ func (vo *StreamerAuthApprovalApiVO) CopyStreamerAuthApproval(streamerauthapprov
} }
func (vo *StreamerAuthApprovalApiVO) CopyAccount(account *dbstruct.Account) *StreamerAuthApprovalApiVO { func (vo *StreamerAuthApprovalApiVO) CopyAccount(account *dbstruct.Account) *StreamerAuthApprovalApiVO {
if account == nil {
return vo
}
vo.UserId = account.UserId vo.UserId = account.UserId
return vo return vo
} }

View File

@ -13,6 +13,9 @@ func (vo *StreamerAuthApprovalOpVO) CopyStreamerAuthApproval(streamerauthapprova
} }
func (vo *StreamerAuthApprovalOpVO) CopyAccount(account *dbstruct.Account) *StreamerAuthApprovalOpVO { func (vo *StreamerAuthApprovalOpVO) CopyAccount(account *dbstruct.Account) *StreamerAuthApprovalOpVO {
if account == nil {
return vo
}
vo.UserId = account.UserId vo.UserId = account.UserId
return vo return vo
} }

View File

@ -18,6 +18,9 @@ func NewStreamerLinkVO() *StreamerLinkVO {
} }
func (vo *StreamerLinkVO) CopyStreamerLink(streamerlink *dbstruct.StreamerLink) *StreamerLinkVO { func (vo *StreamerLinkVO) CopyStreamerLink(streamerlink *dbstruct.StreamerLink) *StreamerLinkVO {
if streamerlink == nil {
return vo
}
vo.Id = streamerlink.Id vo.Id = streamerlink.Id
vo.Mid = streamerlink.Mid vo.Mid = streamerlink.Mid
vo.LinkNo = streamerlink.LinkNo vo.LinkNo = streamerlink.LinkNo
@ -32,6 +35,9 @@ func (vo *StreamerLinkVO) CopyStreamerLink(streamerlink *dbstruct.StreamerLink)
} }
func (vo *StreamerLinkVO) CopyPlatformCfg(platformCfg *apollostruct.PlatformCfg) *StreamerLinkVO { func (vo *StreamerLinkVO) CopyPlatformCfg(platformCfg *apollostruct.PlatformCfg) *StreamerLinkVO {
if platformCfg == nil {
return vo
}
vo.Name = platformCfg.Name vo.Name = platformCfg.Name
vo.Icon = platformCfg.Icon vo.Icon = platformCfg.Icon
return vo return vo