feat: ready to refine the space model.

This commit is contained in:
lishuang
2023-05-13 22:07:33 +08:00
parent 246829869a
commit 14ff3fea9a
2 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ type Matter struct {
VisitTime time.Time `json:"visitTime" gorm:"type:timestamp not null;default:'2018-01-01 00:00:00'"`
Deleted bool `json:"deleted" gorm:"type:tinyint(1) not null;index:idx_matter_del;default:0"`
DeleteTime time.Time `json:"deleteTime" gorm:"type:timestamp not null;index:idx_matter_delt;default:'2018-01-01 00:00:00'"`
SpaceUuid string `json:"spaceUuid" gorm:"type:char(36) not null;default:'root';index:idx_space_uuid"`
SpaceUuid string `json:"spaceUuid" gorm:"type:char(36) not null;index:idx_space_uuid"`
Parent *Matter `json:"parent" gorm:"-"`
Children []*Matter `json:"-" gorm:"-"`
}
+11 -6
View File
@@ -8,10 +8,15 @@ import (
* shared space
*/
type Space struct {
Uuid string `json:"uuid" gorm:"type:char(36);primary_key;unique"`
Sort int64 `json:"sort" gorm:"type:bigint(20) not null"`
UpdateTime time.Time `json:"updateTime" gorm:"type:timestamp not null;default:CURRENT_TIMESTAMP"`
CreateTime time.Time `json:"createTime" gorm:"type:timestamp not null;default:'2018-01-01 00:00:00'"`
UserUuid string `json:"userUuid" gorm:"type:char(36);unique:uk_user_uuid"`
User *User `json:"user" gorm:"-"`
Uuid string `json:"uuid" gorm:"type:char(36);primary_key;unique"`
Sort int64 `json:"sort" gorm:"type:bigint(20) not null"`
UpdateTime time.Time `json:"updateTime" gorm:"type:timestamp not null;default:CURRENT_TIMESTAMP"`
CreateTime time.Time `json:"createTime" gorm:"type:timestamp not null;default:'2018-01-01 00:00:00'"`
Name string `json:"name" gorm:"type:varchar(100) not null;unique"`
UserUuid string `json:"userUuid" gorm:"type:char(36);index:idx_user_uuid"`
SizeLimit int64 `json:"sizeLimit" gorm:"type:bigint(20) not null;default:-1"`
TotalSizeLimit int64 `json:"totalSizeLimit" gorm:"type:bigint(20) not null;default:-1"`
TotalSize int64 `json:"totalSize" gorm:"type:bigint(20) not null;default:0"`
Type string `json:"type" gorm:"type:varchar(45)"`
User *User `json:"user" gorm:"-"`
}