-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbalanceTypeExt.go
66 lines (61 loc) · 2.27 KB
/
balanceTypeExt.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package models
type BalanceTypeExt struct {
BalanceID uint `json:"balance" gorm:"not null;"`
Type BalanceTypeExtList `json:"type" gorm:"not null"`
}
func (BalanceTypeExt) TableName() string {
return "bill_balance_type_ext"
}
type BalanceTypeExtList uint
const (
BTExtUnknown BalanceTypeExtList = 0
BTExtFirLaunch BalanceTypeExtList = 6
BTExtLocal BalanceTypeExtList = 100
BTExtBackFee BalanceTypeExtList = 104
BTExtOnChannel BalanceTypeExtList = 200
BTExtAward BalanceTypeExtList = 300
BTExtOfferAward BalanceTypeExtList = 301
BTExtLocked BalanceTypeExtList = 400
BTExtLockedTransfer BalanceTypeExtList = 500
BTExtPayToPoolAccount BalanceTypeExtList = 600
BTExtReceivePoolAccount BalanceTypeExtList = 601
BTEServerFee BalanceTypeExtList = 700
BTEFirLunchFee BalanceTypeExtList = 701
BTEFirBackFee BalanceTypeExtList = 702
)
func (b BalanceTypeExtList) ToString() string {
balanceTypeExtString := map[BalanceTypeExtList]string{
BTExtUnknown: "Unknown",
BTExtFirLaunch: "FirLaunch",
BTExtLocal: "Local",
BTExtBackFee: "BackFee",
BTExtOnChannel: "OnChannel",
BTExtAward: "Award",
BTExtLocked: "Locked",
BTExtLockedTransfer: "LockedTransfer",
BTExtPayToPoolAccount: "PayToPoolAccount",
BTExtReceivePoolAccount: "ReceivePoolAccount",
BTEServerFee: "ServerFee",
BTEFirLunchFee: "FirLunchFee",
BTEFirBackFee: "FirBackFee",
}
return balanceTypeExtString[b]
}
func ToBalanceTypeExtList(s string) BalanceTypeExtList {
balanceTypeExtList := map[string]BalanceTypeExtList{
"Unknown": BTExtUnknown,
"FirLaunch": BTExtFirLaunch,
"Local": BTExtLocal,
"BackFee": BTExtBackFee,
"OnChannel": BTExtOnChannel,
"Award": BTExtAward,
"Locked": BTExtLocked,
"LockedTransfer": BTExtLockedTransfer,
"PayToPoolAccount": BTExtPayToPoolAccount,
"ReceivePoolAccount": BTExtReceivePoolAccount,
"ServerFee": BTEServerFee,
"FirLunchFee": BTEFirLunchFee,
"FirBackFee": BTEFirBackFee,
}
return balanceTypeExtList[s]
}