refactor: 精简base.repo与base.app等

This commit is contained in:
meilin.huang
2024-04-28 23:45:57 +08:00
parent 653953ee76
commit f2c7ef78c0
91 changed files with 758 additions and 957 deletions

View File

@@ -71,7 +71,7 @@ func (d *dbAppImpl) SaveDb(ctx context.Context, dbEntity *entity.Db) error {
return errorx.NewBiz("授权凭证不存在")
}
err = d.GetBy(oldDb)
err = d.GetByCond(oldDb)
if dbEntity.Id == 0 {
if err == nil {
return errorx.NewBiz("该实例下数据库名已存在")
@@ -206,7 +206,8 @@ func (d *dbAppImpl) GetDbConnByInstanceId(instanceId uint64) (*dbi.DbConn, error
}
var dbs []*entity.Db
if err := d.ListByCond(&entity.Db{InstanceId: instanceId}, &dbs, "id", "database"); err != nil {
if err := d.ListByCond(model.NewModelCond(&entity.Db{InstanceId: instanceId}).Columns("id", "database"), &dbs); err != nil {
return nil, errorx.NewBiz("获取数据库列表失败")
}
if len(dbs) == 0 {