mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-03-05 17:45:39 +08:00
refactor: 数据同步优化, base.App、base.Repo新增Save方法
This commit is contained in:
@@ -24,7 +24,7 @@ type Db interface {
|
||||
|
||||
Count(condition *entity.DbQuery) int64
|
||||
|
||||
Save(ctx context.Context, entity *entity.Db, tagIds ...uint64) error
|
||||
SaveDb(ctx context.Context, entity *entity.Db, tagIds ...uint64) error
|
||||
|
||||
// 删除数据库信息
|
||||
Delete(ctx context.Context, id uint64) error
|
||||
@@ -66,7 +66,7 @@ func (d *dbAppImpl) Count(condition *entity.DbQuery) int64 {
|
||||
return d.GetRepo().Count(condition)
|
||||
}
|
||||
|
||||
func (d *dbAppImpl) Save(ctx context.Context, dbEntity *entity.Db, tagIds ...uint64) error {
|
||||
func (d *dbAppImpl) SaveDb(ctx context.Context, dbEntity *entity.Db, tagIds ...uint64) error {
|
||||
// 查找是否存在
|
||||
oldDb := &entity.Db{Name: dbEntity.Name, InstanceId: dbEntity.InstanceId}
|
||||
err := d.GetBy(oldDb)
|
||||
|
||||
Reference in New Issue
Block a user