50 lines
1.2 KiB
Go
50 lines
1.2 KiB
Go
|
package wallet
|
||
|
|
||
|
// ===================交易類型===================
|
||
|
|
||
|
type TransactionType int64
|
||
|
|
||
|
// 定義交易類型
|
||
|
const (
|
||
|
// Deposit 增加可用餘額的充值交易
|
||
|
Deposit TransactionType = iota + 1
|
||
|
|
||
|
// Withdraw 減少可用餘額的提現交易
|
||
|
Withdraw
|
||
|
|
||
|
// Freeze 將可用餘額轉入凍結餘額的凍結交易
|
||
|
Freeze
|
||
|
|
||
|
// Unfreeze 減少凍結餘額的解凍交易
|
||
|
Unfreeze
|
||
|
|
||
|
// RollbackFreeze 回滾凍結:減少凍結餘額並恢復至可用餘額,不指定金額
|
||
|
RollbackFreeze
|
||
|
|
||
|
// Unconfirmed 限制交易:減少凍結餘額並增加他人限制餘額
|
||
|
Unconfirmed
|
||
|
|
||
|
// CancelFreeze 取消凍結:減少凍結餘額並恢復至可用餘額,允許指定金額
|
||
|
CancelFreeze
|
||
|
|
||
|
// DepositToUnconfirmed 增加限制餘額的充值交易
|
||
|
DepositToUnconfirmed
|
||
|
|
||
|
// AppendFreeze 追加凍結:減少可用餘額並增加凍結餘額
|
||
|
AppendFreeze
|
||
|
|
||
|
// RollbackFreezeToAvailable 回滾凍結:指定金額回滾凍結餘額並增加至可用餘額
|
||
|
RollbackFreezeToAvailable
|
||
|
|
||
|
// PlatformDistribution 平台分發交易
|
||
|
PlatformDistribution
|
||
|
|
||
|
// SystemTransfer 系統劃轉交易
|
||
|
SystemTransfer
|
||
|
)
|
||
|
|
||
|
// ToInt 將交易類型轉換為 int64
|
||
|
func (t TransactionType) ToInt() int64 {
|
||
|
return int64(t)
|
||
|
}
|