25 lines
570 B
Go
25 lines
570 B
Go
package ledger
|
|
|
|
// DebitGiftCommand 是 room-service 送礼扣费的账务命令。
|
|
type DebitGiftCommand struct {
|
|
CommandID string
|
|
RoomID string
|
|
SenderUserID int64
|
|
TargetUserID int64
|
|
GiftID string
|
|
GiftCount int32
|
|
GiftUnitValue int64
|
|
}
|
|
|
|
// Receipt 是账务命令落账后的稳定回执。
|
|
type Receipt struct {
|
|
BillingReceiptID string
|
|
TotalGiftValue int64
|
|
BalanceAfter int64
|
|
}
|
|
|
|
// TotalGiftValue 计算本次礼物扣费总额。
|
|
func (c DebitGiftCommand) TotalGiftValue() int64 {
|
|
return int64(c.GiftCount) * c.GiftUnitValue
|
|
}
|