增加余额字段

This commit is contained in:
yuming88
2025-05-07 11:38:32 +08:00
parent 9809981fef
commit 27919fd025
3 changed files with 4 additions and 0 deletions

View File

@@ -46,5 +46,6 @@ type TransferCastileToGameListResp {
type UserCastileBalanceResp {
TotalCastile int `json:total_castile` //总数
TransferAmount int `json:transfer_amount` //已转回游戏内的数量
TotalBalance int `json:total_balance` //castile当前余额
}

View File

@@ -44,6 +44,7 @@ func (l *GetCastileBalanceLogic) GetCastileBalance() (resp *types.UserCastileBal
res := &types.UserCastileBalanceResp{
TotalCastile: 0,
TransferAmount: 0,
TotalBalance: 0,
}
cToken, err := l.svcCtx.CastileTokenModel.FindOneByEmail(l.ctx, u.Email)
@@ -57,5 +58,6 @@ func (l *GetCastileBalanceLogic) GetCastileBalance() (resp *types.UserCastileBal
return &types.UserCastileBalanceResp{
TotalCastile: int(cToken.Total),
TransferAmount: int(cToken.Transfer),
TotalBalance: int(cToken.Total) - int(cToken.Transfer),
}, nil
}

View File

@@ -279,6 +279,7 @@ type UnlockChapterReq struct {
type UserCastileBalanceResp struct {
TotalCastile int `json:total_castile` //总数
TransferAmount int `json:transfer_amount` //已转回游戏内的数量
TotalBalance int `json:total_balance` //castile当前余额
}
type UserNft struct {