From 5dde1d2a0048289c3275612a437f0aa087c79542 Mon Sep 17 00:00:00 2001 From: zhanluxianshen Date: Wed, 10 Jul 2024 11:26:52 +0800 Subject: [PATCH] replace basemodel by common.model Signed-off-by: zhanluxianshen --- app/admin/models/model.go | 11 ----------- app/other/models/tools/sys_columns.go | 5 +++-- app/other/models/tools/sys_tables.go | 4 ---- 3 files changed, 3 insertions(+), 17 deletions(-) delete mode 100644 app/admin/models/model.go diff --git a/app/admin/models/model.go b/app/admin/models/model.go deleted file mode 100644 index 4a1c439b..00000000 --- a/app/admin/models/model.go +++ /dev/null @@ -1,11 +0,0 @@ -package models - -import ( - "time" -) - -type BaseModel struct { - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - DeletedAt *time.Time `json:"deletedAt"` -} diff --git a/app/other/models/tools/sys_columns.go b/app/other/models/tools/sys_columns.go index f3adeb3a..ff6b8ddf 100644 --- a/app/other/models/tools/sys_columns.go +++ b/app/other/models/tools/sys_columns.go @@ -1,7 +1,8 @@ package tools import ( - "go-admin/app/admin/models" + common "go-admin/common/models" + "gorm.io/gorm" ) @@ -44,7 +45,7 @@ type SysColumns struct { CreateBy int `gorm:"column:create_by;size:20;" json:"createBy"` UpdateBy int `gorm:"column:update_By;size:20;" json:"updateBy"` - models.BaseModel + common.ModelTime } func (*SysColumns) TableName() string { diff --git a/app/other/models/tools/sys_tables.go b/app/other/models/tools/sys_tables.go index 91ded97c..4417a3e0 100644 --- a/app/other/models/tools/sys_tables.go +++ b/app/other/models/tools/sys_tables.go @@ -5,8 +5,6 @@ import ( "strings" "gorm.io/gorm" - - "go-admin/app/admin/models" ) type SysTables struct { @@ -43,8 +41,6 @@ type SysTables struct { DataScope string `gorm:"-" json:"dataScope"` Params Params `gorm:"-" json:"params"` Columns []SysColumns `gorm:"-" json:"columns"` - - models.BaseModel } func (*SysTables) TableName() string {