fix types.db
This commit is contained in:
parent
28ad46d403
commit
aada90ea78
34
types/db.go
34
types/db.go
|
@ -20,46 +20,46 @@ type (
|
||||||
|
|
||||||
// standard ID,Created,Updated,Deleted definition.
|
// standard ID,Created,Updated,Deleted definition.
|
||||||
Std_IICUDS struct {
|
Std_IICUDS struct {
|
||||||
ID uint `gorm:"primarykey;"`
|
ID uint `gorm:"primarykey;" json:"id"`
|
||||||
Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;"` // 唯一标识,24位NanoID,36位为UUID
|
Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;" json:"identity"` // 唯一标识,24位NanoID,36位为UUID
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time `json:"created_at"`
|
||||||
UpdatedAt time.Time
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
DeletedAt gorm.DeletedAt `gorm:"index";`
|
DeletedAt gorm.DeletedAt `gorm:"index;" json:"deleted_at"`
|
||||||
Status int8 `gorm:"default:0;index;"` // 状态:默认为0,-1禁止,1为正常
|
Status int8 `gorm:"default:0;index;" json:"status"` // 状态:默认为0,-1禁止,1为正常
|
||||||
}
|
}
|
||||||
|
|
||||||
// standard ID,Identity,Created,Updated,Deleted,Status definition.
|
// standard ID,Identity,Created,Updated,Deleted,Status definition.
|
||||||
Std_ICUD struct {
|
Std_ICUD struct {
|
||||||
ID uint `gorm:"primarykey;"`
|
ID uint `gorm:"primarykey;" json:"id"`
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time `json:"created_at"`
|
||||||
UpdatedAt time.Time
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
DeletedAt gorm.DeletedAt `gorm:"index"`
|
DeletedAt gorm.DeletedAt `gorm:"index;" json:"deleted_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// standard ID,Created definition.
|
// standard ID,Created definition.
|
||||||
Std_IdCreated struct {
|
Std_IdCreated struct {
|
||||||
ID uint `gorm:"primarykey;"`
|
ID uint `gorm:"primarykey;" json:"id"`
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time `json:"created_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// standard PassportID,PassportIdentity definition.
|
// standard PassportID,PassportIdentity definition.
|
||||||
Std_Passport struct {
|
Std_Passport struct {
|
||||||
PassportID uint `gorm:"column:passport_id;Index;"`
|
PassportID uint `gorm:"column:passport_id;Index;" json:"passport_id"`
|
||||||
PassportIdentity string `gorm:"column:passport_identity;type:varchar(36);Index;"` // 用户唯一标识,24位NanoID,36位为UUID
|
PassportIdentity string `gorm:"column:passport_identity;type:varchar(36);Index;" json:"passport_identity"` // 用户唯一标识,24位NanoID,36位为UUID
|
||||||
}
|
}
|
||||||
|
|
||||||
// standard ID definition.
|
// standard ID definition.
|
||||||
Std_ID struct {
|
Std_ID struct {
|
||||||
ID uint `gorm:"primarykey;"`
|
ID uint `gorm:"primarykey;" json:"id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// standard Identity definition.
|
// standard Identity definition.
|
||||||
Std_Identity struct {
|
Std_Identity struct {
|
||||||
Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;"` // 唯一标识,24位NanoID,36位为UUID
|
Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;" json:"identity"` // 唯一标识,24位NanoID,36位为UUID
|
||||||
}
|
}
|
||||||
|
|
||||||
// standard Status definition.
|
// standard Status definition.
|
||||||
Std_Status struct {
|
Std_Status struct {
|
||||||
Status int8 `gorm:"default:0;index;"` // 状态:默认为0,-1禁止,1为正常
|
Status int8 `gorm:"default:0;index;" json:"status"` // 状态:默认为0,-1禁止,1为正常
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue