From 185df737c88202ed40df869642dad632db20c3e4 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Thu, 17 Jun 2021 21:10:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor=F0=9F=8E=A8=EF=BC=9A=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=92=8C=E5=AD=97=E5=85=B8=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=BB=93=E6=9E=84=E4=BD=93=E5=AD=97=E6=AE=B5=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/models/sys_dict_data.go | 5 ++--- app/admin/models/sys_dict_type.go | 5 ++--- app/admin/models/sys_user.go | 4 ++-- cmd/migrate/migration/models/system.go | 12 ------------ 4 files changed, 6 insertions(+), 20 deletions(-) delete mode 100644 cmd/migrate/migration/models/system.go diff --git a/app/admin/models/sys_dict_data.go b/app/admin/models/sys_dict_data.go index 2108c175..4a013737 100644 --- a/app/admin/models/sys_dict_data.go +++ b/app/admin/models/sys_dict_data.go @@ -5,9 +5,6 @@ import ( ) type SysDictData struct { - models.ControlBy - models.ModelTime - DictCode int `json:"dictCode" gorm:"primaryKey;column:dict_code;autoIncrement;comment:主键编码"` DictSort int `json:"dictSort" gorm:"size:20;comment:DictSort"` DictLabel string `json:"dictLabel" gorm:"size:128;comment:DictLabel"` @@ -19,6 +16,8 @@ type SysDictData struct { Status string `json:"status" gorm:"size:4;comment:Status"` Default string `json:"default" gorm:"size:8;comment:Default"` Remark string `json:"remark" gorm:"size:255;comment:Remark"` + models.ControlBy + models.ModelTime } func (SysDictData) TableName() string { diff --git a/app/admin/models/sys_dict_type.go b/app/admin/models/sys_dict_type.go index 735cb874..29442bdc 100644 --- a/app/admin/models/sys_dict_type.go +++ b/app/admin/models/sys_dict_type.go @@ -5,14 +5,13 @@ import ( ) type SysDictType struct { - models.ControlBy - models.ModelTime - ID int `json:"id" gorm:"primaryKey;column:dict_id;autoIncrement;comment:主键编码"` DictName string `json:"dictName" gorm:"size:128;comment:DictName"` DictType string `json:"dictType" gorm:"size:128;comment:DictType"` Status string `json:"status" gorm:"size:4;comment:Status"` Remark string `json:"remark" gorm:"size:255;comment:Remark"` + models.ControlBy + models.ModelTime } func (SysDictType) TableName() string { diff --git a/app/admin/models/sys_user.go b/app/admin/models/sys_user.go index 614dbb77..e239b29f 100644 --- a/app/admin/models/sys_user.go +++ b/app/admin/models/sys_user.go @@ -7,8 +7,6 @@ import ( ) type SysUser struct { - models.ControlBy - models.ModelTime UserId int `gorm:"primaryKey;autoIncrement;comment:编码" json:"userId"` Username string `json:"username" gorm:"size:64;comment:用户名"` Password string `json:"-" gorm:"size:128;comment:密码"` @@ -27,6 +25,8 @@ type SysUser struct { PostIds []int `json:"postIds" gorm:"-"` RoleIds []int `json:"roleIds" gorm:"-"` Dept *SysDept `json:"dept"` + models.ControlBy + models.ModelTime } func (SysUser) TableName() string { diff --git a/cmd/migrate/migration/models/system.go b/cmd/migrate/migration/models/system.go deleted file mode 100644 index b0498c3f..00000000 --- a/cmd/migrate/migration/models/system.go +++ /dev/null @@ -1,12 +0,0 @@ -package models - -type SysSetting struct { - SettingsId int `json:"settings_id" gorm:"primary_key;AUTO_INCREMENT"` - Name string `json:"name" gorm:"type:varchar(256);"` - Logo string `json:"logo" gorm:"type:varchar(256);"` - ModelTime -} - -func (SysSetting) TableName() string { - return "sys_setting" -}