Merge branch perfect-panel/master/server into develop
This commit is contained in:
+18
-17
@@ -33,23 +33,24 @@ const (
|
||||
TypeTrafficStat Type = 42 // Daily traffic statistics log
|
||||
)
|
||||
const (
|
||||
ResetSubscribeTypeAuto uint16 = 231 // Auto reset
|
||||
ResetSubscribeTypeAdvance uint16 = 232 // Advance reset
|
||||
ResetSubscribeTypePaid uint16 = 233 // Paid reset
|
||||
ResetSubscribeTypeQuota uint16 = 234 // Quota reset
|
||||
BalanceTypeRecharge uint16 = 321 // Recharge
|
||||
BalanceTypeWithdraw uint16 = 322 // Withdraw
|
||||
BalanceTypePayment uint16 = 323 // Payment
|
||||
BalanceTypeRefund uint16 = 324 // Refund
|
||||
BalanceTypeAdjust uint16 = 326 // Admin Adjust
|
||||
BalanceTypeReward uint16 = 325 // Reward
|
||||
CommissionTypePurchase uint16 = 331 // Purchase
|
||||
CommissionTypeRenewal uint16 = 332 // Renewal
|
||||
CommissionTypeRefund uint16 = 333 // Refund
|
||||
commissionTypeWithdraw uint16 = 334 // withdraw
|
||||
CommissionTypeAdjust uint16 = 335 // Admin Adjust
|
||||
GiftTypeIncrease uint16 = 341 // Increase
|
||||
GiftTypeReduce uint16 = 342 // Reduce
|
||||
ResetSubscribeTypeAuto uint16 = 231 // Auto reset
|
||||
ResetSubscribeTypeAdvance uint16 = 232 // Advance reset
|
||||
ResetSubscribeTypePaid uint16 = 233 // Paid reset
|
||||
ResetSubscribeTypeQuota uint16 = 234 // Quota reset
|
||||
BalanceTypeRecharge uint16 = 321 // Recharge
|
||||
BalanceTypeWithdraw uint16 = 322 // Withdraw
|
||||
BalanceTypePayment uint16 = 323 // Payment
|
||||
BalanceTypeRefund uint16 = 324 // Refund
|
||||
BalanceTypeAdjust uint16 = 326 // Admin Adjust
|
||||
BalanceTypeReward uint16 = 325 // Reward
|
||||
CommissionTypePurchase uint16 = 331 // Purchase
|
||||
CommissionTypeRenewal uint16 = 332 // Renewal
|
||||
CommissionTypeRefund uint16 = 333 // Refund
|
||||
CommissionTypeWithdraw uint16 = 334 // withdraw
|
||||
CommissionTypeAdjust uint16 = 335 // Admin Adjust
|
||||
CommissionTypeConvertBalance uint16 = 336 // Convert to Balance
|
||||
GiftTypeIncrease uint16 = 341 // Increase
|
||||
GiftTypeReduce uint16 = 342 // Reduce
|
||||
)
|
||||
|
||||
// Uint8 converts Type to uint8.
|
||||
|
||||
@@ -36,6 +36,7 @@ type SubscribeDetails struct {
|
||||
Token string `gorm:"index:idx_token;unique;type:varchar(255);default:'';comment:Token"`
|
||||
UUID string `gorm:"type:varchar(255);unique;index:idx_uuid;default:'';comment:UUID"`
|
||||
Status uint8 `gorm:"type:tinyint(1);default:0;comment:Subscription Status: 0: Pending 1: Active 2: Finished 3: Expired; 4: Cancelled"`
|
||||
Note string `gorm:"type:varchar(500);default:'';comment:User note for subscription"`
|
||||
CreatedAt time.Time `gorm:"<-:create;comment:Creation Time"`
|
||||
UpdatedAt time.Time `gorm:"comment:Update Time"`
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ type User struct {
|
||||
EnableTradeNotify *bool `gorm:"default:false;not null;comment:Enable Trade Notifications"`
|
||||
AuthMethods []AuthMethods `gorm:"foreignKey:UserId;references:Id"`
|
||||
UserDevices []Device `gorm:"foreignKey:UserId;references:Id"`
|
||||
Rules string `gorm:"type:TEXT;comment:User Rules"`
|
||||
CreatedAt time.Time `gorm:"<-:create;comment:Creation Time"`
|
||||
UpdatedAt time.Time `gorm:"comment:Update Time"`
|
||||
}
|
||||
@@ -48,6 +49,7 @@ type Subscribe struct {
|
||||
Token string `gorm:"index:idx_token;unique;type:varchar(255);default:'';comment:Token"`
|
||||
UUID string `gorm:"type:varchar(255);unique;index:idx_uuid;default:'';comment:UUID"`
|
||||
Status uint8 `gorm:"type:tinyint(1);default:0;comment:Subscription Status: 0: Pending 1: Active 2: Finished 3: Expired 4: Deducted"`
|
||||
Note string `gorm:"type:varchar(500);default:'';comment:User note for subscription"`
|
||||
CreatedAt time.Time `gorm:"<-:create;comment:Creation Time"`
|
||||
UpdatedAt time.Time `gorm:"comment:Update Time"`
|
||||
}
|
||||
@@ -100,3 +102,18 @@ type DeviceOnlineRecord struct {
|
||||
func (DeviceOnlineRecord) TableName() string {
|
||||
return "user_device_online_record"
|
||||
}
|
||||
|
||||
type Withdrawal struct {
|
||||
Id int64 `gorm:"primaryKey"`
|
||||
UserId int64 `gorm:"index:idx_user_id;not null;comment:User ID"`
|
||||
Amount int64 `gorm:"not null;comment:Withdrawal Amount"`
|
||||
Content string `gorm:"type:text;comment:Withdrawal Content"`
|
||||
Status uint8 `gorm:"type:tinyint(1);default:0;comment:Withdrawal Status: 0: Pending 1: Approved 2: Rejected"`
|
||||
Reason string `gorm:"type:varchar(500);default:'';comment:Rejection Reason"`
|
||||
CreatedAt time.Time `gorm:"<-:create;comment:Creation Time"`
|
||||
UpdatedAt time.Time `gorm:"comment:Update Time"`
|
||||
}
|
||||
|
||||
func (*Withdrawal) TableName() string {
|
||||
return "user_withdrawal"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user