feat: 完善数据库信息保存以及项目、redis相关操作

This commit is contained in:
meilin.huang
2021-07-28 18:03:19 +08:00
parent 3ebc3ee14d
commit bda3920c1e
153 changed files with 5527 additions and 1017 deletions

View File

@@ -1,6 +1,7 @@
package persistence
import (
"mayfly-go/base/biz"
"mayfly-go/base/model"
"mayfly-go/server/devops/domain/entity"
"mayfly-go/server/devops/domain/repository"
@@ -11,7 +12,7 @@ type dbRepo struct{}
var DbDao repository.Db = &dbRepo{}
// 分页获取数据库信息列表
func (d *dbRepo) GetDbList(condition *entity.Db, pageParam *model.PageParam, toEntity interface{}, orderBy ...string) model.PageResult {
func (d *dbRepo) GetDbList(condition *entity.Db, pageParam *model.PageParam, toEntity interface{}, orderBy ...string) *model.PageResult {
return model.GetPage(pageParam, condition, toEntity, orderBy...)
}
@@ -29,3 +30,15 @@ func (d *dbRepo) GetById(id uint64, cols ...string) *entity.Db {
}
return db
}
func (d *dbRepo) Insert(db *entity.Db) {
biz.ErrIsNil(model.Insert(db), "新增数据库信息失败")
}
func (d *dbRepo) Update(db *entity.Db) {
biz.ErrIsNil(model.UpdateById(db), "更新数据库信息失败")
}
func (d *dbRepo) Delete(id uint64) {
model.DeleteById(new(entity.Db), id)
}