From 358b34c7f412a4dd77c1779fb81efaaed3cdcacc Mon Sep 17 00:00:00 2001 From: "meilin.huang" <954537473@qq.com> Date: Sat, 11 Dec 2021 11:19:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=B8=8E=E9=A1=B9=E7=9B=AE=E5=85=B3=E8=81=94=E5=8F=8A=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E8=B5=84=E6=BA=90=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=BB=A5=E9=A1=B9=E7=9B=AE=E5=85=B3=E8=81=94=E6=88=90=E5=91=98?= =?UTF-8?q?=E4=B8=BA=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/model/model.go | 7 ++--- lastupdate.tmp | 1 - .../src/views/ops/machine/MachineEdit.vue | 26 +++++++++++++------ .../src/views/ops/machine/MachineList.vue | 25 +++++++++++++++--- .../src/views/ops/redis/ValueDialog.vue | 19 ++++++-------- server/devops/api/db.go | 2 +- server/devops/api/form/form.go | 6 +++-- server/devops/api/machine.go | 13 +++++++++- server/devops/api/redis.go | 2 +- server/devops/api/vo/vo.go | 26 ++++++++++--------- server/devops/domain/entity/machine.go | 4 ++- .../infrastructure/persistence/db_repo.go | 15 ++++++++++- .../persistence/machine_repo.go | 15 ++++++++++- .../infrastructure/persistence/redis_repo.go | 15 ++++++++++- 14 files changed, 128 insertions(+), 48 deletions(-) delete mode 100755 lastupdate.tmp diff --git a/base/model/model.go b/base/model/model.go index d601dedf..42376ba0 100644 --- a/base/model/model.go +++ b/base/model/model.go @@ -173,14 +173,15 @@ func GetPageBySql(sql string, param *PageParam, toModel interface{}, args ...int countSql := strings.Replace(sql, selectCol, "COUNT(*) AS total ", 1) // 查询count var count int - db.Raw(countSql, args...).Scan(&count) + err := db.Raw(countSql, args...).Scan(&count).Error + biz.ErrIsNilAppendErr(err, "查询失败: %s") if count == 0 { return &PageResult{Total: 0, List: []string{}} } // 分页查询 limitSql := sql + " LIMIT " + strconv.Itoa(param.PageNum-1) + ", " + strconv.Itoa(param.PageSize) - err := db.Raw(limitSql).Scan(toModel).Error - biz.ErrIsNil(err, "查询失败") + err = db.Raw(limitSql).Scan(toModel).Error + biz.ErrIsNil(err, "查询失败: %s") return &PageResult{Total: int64(count), List: toModel} } diff --git a/lastupdate.tmp b/lastupdate.tmp deleted file mode 100755 index 0e345af9..00000000 --- a/lastupdate.tmp +++ /dev/null @@ -1 +0,0 @@ -{"/Users/hml/Desktop/project/go/mayfly-go/controllers":1610075329396211594} \ No newline at end of file diff --git a/mayfly_go_web/src/views/ops/machine/MachineEdit.vue b/mayfly_go_web/src/views/ops/machine/MachineEdit.vue index d2255096..0aebd4d7 100644 --- a/mayfly_go_web/src/views/ops/machine/MachineEdit.vue +++ b/mayfly_go_web/src/views/ops/machine/MachineEdit.vue @@ -2,17 +2,11 @@