@@ -2,32 +2,35 @@ package user
22
33import (
44 "time"
5+
6+ "gorm.io/gorm"
57)
68
79type User struct {
8- Id int64 `gorm:"primaryKey"`
9- Password string `gorm:"type:varchar(100);not null;comment:User Password"`
10- Algo string `gorm:"type:varchar(20);default:'default';comment:Encryption Algorithm"`
11- Salt string `gorm:"type:varchar(20);default:null;comment:Password Salt"`
12- Avatar string `gorm:"type:MEDIUMTEXT;comment:User Avatar"`
13- Balance int64 `gorm:"default:0;comment:User Balance"` // User Balance Amount
14- ReferCode string `gorm:"type:varchar(20);default:'';comment:Referral Code"`
15- RefererId int64 `gorm:"index:idx_referer;comment:Referrer ID"`
16- Commission int64 `gorm:"default:0;comment:Commission"` // Commission Amount
17- ReferralPercentage uint8 `gorm:"default:0;comment:Referral"` // Referral Percentage
18- OnlyFirstPurchase * bool `gorm:"default:true;not null;comment:Only First Purchase"` // Only First Purchase Referral
19- GiftAmount int64 `gorm:"default:0;comment:User Gift Amount"`
20- Enable * bool `gorm:"default:true;not null;comment:Is Account Enabled"`
21- IsAdmin * bool `gorm:"default:false;not null;comment:Is Admin"`
22- EnableBalanceNotify * bool `gorm:"default:false;not null;comment:Enable Balance Change Notifications"`
23- EnableLoginNotify * bool `gorm:"default:false;not null;comment:Enable Login Notifications"`
24- EnableSubscribeNotify * bool `gorm:"default:false;not null;comment:Enable Subscription Notifications"`
25- EnableTradeNotify * bool `gorm:"default:false;not null;comment:Enable Trade Notifications"`
26- AuthMethods []AuthMethods `gorm:"foreignKey:UserId;references:Id"`
27- UserDevices []Device `gorm:"foreignKey:UserId;references:Id"`
28- Rules string `gorm:"type:TEXT;comment:User Rules"`
29- CreatedAt time.Time `gorm:"<-:create;comment:Creation Time"`
30- UpdatedAt time.Time `gorm:"comment:Update Time"`
10+ Id int64 `gorm:"primaryKey"`
11+ Password string `gorm:"type:varchar(100);not null;comment:User Password"`
12+ Algo string `gorm:"type:varchar(20);default:'default';comment:Encryption Algorithm"`
13+ Salt string `gorm:"type:varchar(20);default:null;comment:Password Salt"`
14+ Avatar string `gorm:"type:MEDIUMTEXT;comment:User Avatar"`
15+ Balance int64 `gorm:"default:0;comment:User Balance"` // User Balance Amount
16+ ReferCode string `gorm:"type:varchar(20);default:'';comment:Referral Code"`
17+ RefererId int64 `gorm:"index:idx_referer;comment:Referrer ID"`
18+ Commission int64 `gorm:"default:0;comment:Commission"` // Commission Amount
19+ ReferralPercentage uint8 `gorm:"default:0;comment:Referral"` // Referral Percentage
20+ OnlyFirstPurchase * bool `gorm:"default:true;not null;comment:Only First Purchase"` // Only First Purchase Referral
21+ GiftAmount int64 `gorm:"default:0;comment:User Gift Amount"`
22+ Enable * bool `gorm:"default:true;not null;comment:Is Account Enabled"`
23+ IsAdmin * bool `gorm:"default:false;not null;comment:Is Admin"`
24+ EnableBalanceNotify * bool `gorm:"default:false;not null;comment:Enable Balance Change Notifications"`
25+ EnableLoginNotify * bool `gorm:"default:false;not null;comment:Enable Login Notifications"`
26+ EnableSubscribeNotify * bool `gorm:"default:false;not null;comment:Enable Subscription Notifications"`
27+ EnableTradeNotify * bool `gorm:"default:false;not null;comment:Enable Trade Notifications"`
28+ AuthMethods []AuthMethods `gorm:"foreignKey:UserId;references:Id"`
29+ UserDevices []Device `gorm:"foreignKey:UserId;references:Id"`
30+ Rules string `gorm:"type:TEXT;comment:User Rules"`
31+ CreatedAt time.Time `gorm:"<-:create;comment:Creation Time"`
32+ UpdatedAt time.Time `gorm:"comment:Update Time"`
33+ DeletedAt gorm.DeletedAt `gorm:"index;comment:Deletion Time"`
3134}
3235
3336func (* User ) TableName () string {
0 commit comments