|
5 | 5 | "strings" |
6 | 6 | "time" |
7 | 7 |
|
| 8 | + "github.com/saltbo/zpan/internal/app/entity" |
8 | 9 | "gorm.io/gorm" |
9 | 10 | ) |
10 | 11 |
|
@@ -45,20 +46,20 @@ func NewUserCreateOption() UserCreateOption { |
45 | 46 | } |
46 | 47 |
|
47 | 48 | type User struct { |
48 | | - Id int64 `json:"id"` |
49 | | - Email string `json:"email" gorm:"size:32;unique_index;not null"` |
50 | | - Username string `json:"username" gorm:"size:20;unique_index;not null"` |
51 | | - Password string `json:"-" gorm:"size:32;not null"` |
52 | | - Status uint8 `json:"-" gorm:"size:1;not null"` |
53 | | - StatusTxt string `json:"status" gorm:"-"` |
54 | | - Roles string `json:"-" gorm:"size:64;not null"` |
55 | | - RoleTxt string `json:"role" gorm:"-"` |
56 | | - Ticket string `json:"ticket" gorm:"size:6;unique_index;not null"` |
57 | | - Profile UserProfile `json:"profile,omitempty" gorm:"foreignKey:Uid"` |
58 | | - Storage UserStorage `json:"storage,omitempty" gorm:"foreignKey:Uid"` |
59 | | - Created time.Time `json:"created" gorm:"autoCreateTime;not null"` |
60 | | - Updated time.Time `json:"updated" gorm:"autoUpdateTime;not null"` |
61 | | - Deleted gorm.DeletedAt `json:"-"` |
| 49 | + Id int64 `json:"id"` |
| 50 | + Email string `json:"email" gorm:"size:32;unique_index;not null"` |
| 51 | + Username string `json:"username" gorm:"size:20;unique_index;not null"` |
| 52 | + Password string `json:"-" gorm:"size:32;not null"` |
| 53 | + Status uint8 `json:"-" gorm:"size:1;not null"` |
| 54 | + StatusTxt string `json:"status" gorm:"-"` |
| 55 | + Roles string `json:"-" gorm:"size:64;not null"` |
| 56 | + RoleTxt string `json:"role" gorm:"-"` |
| 57 | + Ticket string `json:"ticket" gorm:"size:6;unique_index;not null"` |
| 58 | + Profile UserProfile `json:"profile,omitempty" gorm:"foreignKey:Uid"` |
| 59 | + Storage entity.UserStorage `json:"storage,omitempty" gorm:"foreignKey:Uid"` |
| 60 | + Created time.Time `json:"created" gorm:"autoCreateTime;not null"` |
| 61 | + Updated time.Time `json:"updated" gorm:"autoUpdateTime;not null"` |
| 62 | + Deleted gorm.DeletedAt `json:"-"` |
62 | 63 |
|
63 | 64 | Token string `json:"-" gorm:"-"` |
64 | 65 | } |
|
0 commit comments