cash_pool.go
771 字节
package domain
// 现金池
type CashPool struct {
CashPoolId int64 `json:"cashPoolId"` // 现金池id
CompanyId int64 `json:"companyId"` // 公司id
Cash float64 `json:"cashPool"` // 投入现金池的现金
ExchangedCash float64 `json:"exchangedCash"` // 已兑换的现金
UnExchangeCash float64 `json:"unExchangeCash"` // 未兑换的现金
ExchangedSuMoney float64 `json:"exchangedSuMoney"` // 已兑换的素币
UnExchangeSuMoney float64 `json:"unExchangeSuMoney"` // 未兑换的素币
Rate float64 `json:"rate"` // 平均兑换汇率
}
type CashPoolRepository interface {
Save(cashPool *CashPool) (*CashPool, error)
}
func (cashPool *CashPool) Identity() interface{} {
if cashPool.CompanyId == 0 {
return nil
}
return cashPool.CompanyId
}