From 0a533c4ea7c445eb8cea6b5ffb20f5ecd3071655 Mon Sep 17 00:00:00 2001 From: dark Date: Mon, 23 Dec 2024 12:03:03 +0800 Subject: [PATCH] =?UTF-8?q?grom=20=E7=BB=93=E6=9E=84=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- structs/file.go | 24 ++++++++++++++++++++++++ structs/path.go | 17 +++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 structs/file.go create mode 100644 structs/path.go 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 +}