refactor🎨 初始化gen创建者信息
This commit is contained in:
1 parent
816b10681b
commit
ddc3a1d403
2 files changed
+4
No files matched your search
@@ -66,6 +66,7 @@ func (e *SysColumns) GetList(tx *gorm.DB) ([]SysColumns, error) {
|
||||
|
||||
func (e *SysColumns) Create(tx *gorm.DB) (SysColumns, error) {
|
||||
var doc SysColumns
|
||||
e.CreateBy = "1"
|
||||
result := tx.Table("sys_columns").Create(&e)
|
||||
if result.Error != nil {
|
||||
err := result.Error
|
||||
@@ -82,6 +83,7 @@ func (e *SysColumns) Update(tx *gorm.DB) (update SysColumns, err error) {
|
||||
|
||||
//参数1:是要修改的数据
|
||||
//参数2:是修改的数据
|
||||
e.UpdateBy = "1"
|
||||
if err = tx.Table("sys_columns").Model(&update).Updates(&e).Error; err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ func (e *SysTables) GetTree(tx *gorm.DB) ([]SysTables, error) {
|
||||
|
||||
func (e *SysTables) Create(tx *gorm.DB) (SysTables, error) {
|
||||
var doc SysTables
|
||||
e.CreateBy = "1"
|
||||
result := tx.Table("sys_tables").Create(&e)
|
||||
if result.Error != nil {
|
||||
err := result.Error
|
||||
@@ -156,6 +157,7 @@ func (e *SysTables) Update(tx *gorm.DB) (update SysTables, err error) {
|
||||
|
||||
//参数1:是要修改的数据
|
||||
//参数2:是修改的数据
|
||||
e.UpdateBy="1"
|
||||
if err = tx.Table("sys_tables").Where("table_id = ?", e.TableId).Updates(&e).Error; err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user