diff --git a/structs/file.go b/structs/file.go new file mode 100644 index 0000000..5fd37f5 --- /dev/null +++ b/structs/file.go @@ -0,0 +1,24 @@ +package OrmStructs + +import "gorm.io/gorm" + +type File struct { + ID int64 `gorm:"type:bigint;primary_key;AUTO_INCREMENT;comment:文件id"` // 文件id + Name string `gorm:"type:varchar(255);not null;index:index_check;comment:文件名称"` // 文件名称 + Size int64 `gorm:"type:bigint;not null;comment:文件大小"` // 文件大小 + Path string `gorm:"type:varchar(255);not null;index:index_check;comment:文件路径"` // 文件路径 + OrigName string `gorm:"type:varchar(255);not null;comment:文件原始名称"` // 文件原始名称 + Type string `gorm:"type:varchar(255);not null;comment:文件类型"` // 文件url + Hash string `gorm:"type:varchar(255);not null;comment:文件hash"` // 文件hash + CreaterUserID int64 `gorm:"type:bigint;not null;comment:创建者id"` // 创建者id + CreaterUserName string `gorm:"type:varchar(255);not null;comment:创建者名称"` // 创建者名称 + UpdaterUserID int64 `gorm:"type:bigint;not null;comment:更新者id"` // 更新者id + UpdaterUserName string `gorm:"type:varchar(255);not null;comment:更新者名称"` // 更新者名称 + DeleterUserID int64 `gorm:"type:bigint;not null;comment:删除者id"` // 删除者id + DeleterUserName string `gorm:"type:varchar(255);not null;comment:删除者名称"` // 删除者名称 + ConnectID int64 `gorm:"type:bigint;not null;index;comment:连接id"` // 连接id + ConnectName string `gorm:"type:varchar(255);not null;comment:连接名称"` // 连接名称 + ConnectType string `gorm:"type:varchar(255);not null;comment:连接类型"` // 连接类型 + Tenant string `gorm:"type:varchar(255);not null;index:index_check;comment:租户"` // 租户 + gorm.Model +} diff --git a/structs/path.go b/structs/path.go new file mode 100644 index 0000000..1d47c9f --- /dev/null +++ b/structs/path.go @@ -0,0 +1,17 @@ +package OrmStructs + +import "gorm.io/gorm" + +type Path struct { + ID int64 `gorm:"type:bigint;primary_key;AUTO_INCREMENT;comment:文件id"` // 目录id + Name string `gorm:"type:varchar(255);not null;comment:目录名称"` // 目录名称 + ParentID int64 `gorm:"type:bigint;not null;comment:父级目录id"` // 父级目录id + CreaterUserID int64 `gorm:"type:bigint;not null;comment:创建者id"` // 创建者id + CreaterUserName string `gorm:"type:varchar(255);not null;comment:创建者名称"` // 创建者名称 + UpdaterUserID int64 `gorm:"type:bigint;not null;comment:更新者id"` // 更新者id + UpdaterUserName string `gorm:"type:varchar(255);not null;comment:更新者名称"` + DeleterUserID int64 `gorm:"type:bigint;not null;comment:删除者id"` // 删除者id + DeleterUserName string `gorm:"type:varchar(255);not null;comment:删除者名称"` // 删除者名称 + Tenant int64 `gorm:"type:varchar(255);not null;comment:租户"` // 租户 + gorm.Model +}