From 63645d248c765244488cd34dbc1bb6528ca6b7c7 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期二, 05 九月 2023 09:58:13 +0800 Subject: [PATCH] 修复编译 --- version-control/models/autoBackup.go | 72 ++++++++++++++++++------------------ 1 files changed, 36 insertions(+), 36 deletions(-) diff --git a/version-control/models/autoBackup.go b/version-control/models/autoBackup.go index c26f9c0..addf7cb 100644 --- a/version-control/models/autoBackup.go +++ b/version-control/models/autoBackup.go @@ -1,37 +1,37 @@ -package models - -type AutoBackupConf struct { - Enable bool `json:"enable"` //鑷姩澶囦唤寮�鍏� - Dir string `json:"dir"` //澶囦唤鐩綍 - Period int `json:"period"` //澶囦唤闂撮殧 - SaveDays int `json:"saveDays"` //淇濆瓨澶╂暟 -} - -func (AutoBackupConf) TableName() string { - return "auto_backup" -} - -func (a *AutoBackupConf) Insert() bool { - result := db.Table(a.TableName()).Create(&a) - if result.Error !=nil { - return false - } - return result.RowsAffected>0 -} - -func (a *AutoBackupConf) Update() bool { - db.Table(a.TableName()).Delete(&a) - result := db.Table(a.TableName()).Create(&a) - if result.Error !=nil { - return false - } - return result.RowsAffected>0 -} - -func (a *AutoBackupConf) Select() (int64, error){ - result := db.Table(a.TableName()).First(&a) - if result.Error != nil || result.RowsAffected == 0 { - return 0, result.Error - } - return result.RowsAffected, nil +package models + +type AutoBackupConf struct { + Enable bool `json:"enable"` //鑷姩澶囦唤寮�鍏� + Dir string `json:"dir"` //澶囦唤鐩綍 + Period int `json:"period"` //澶囦唤闂撮殧 + SaveDays int `json:"saveDays"` //淇濆瓨澶╂暟 +} + +func (AutoBackupConf) TableName() string { + return "auto_backup" +} + +func (a *AutoBackupConf) Insert() bool { + result := db.Table(a.TableName()).Create(&a) + if result.Error !=nil { + return false + } + return result.RowsAffected>0 +} + +func (a *AutoBackupConf) Update() bool { + db.Table(a.TableName()).Delete(&a) + result := db.Table(a.TableName()).Create(&a) + if result.Error !=nil { + return false + } + return result.RowsAffected>0 +} + +func (a *AutoBackupConf) Select() (int64, error){ + result := db.Table(a.TableName()).First(&a) + if result.Error != nil || result.RowsAffected == 0 { + return 0, result.Error + } + return result.RowsAffected, nil } \ No newline at end of file -- Gitblit v1.8.0