mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
refactor: 消息模块重构,infra包路径简写等
This commit is contained in:
39
server/internal/db/infra/persistence/db_data_sync.go
Normal file
39
server/internal/db/infra/persistence/db_data_sync.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package persistence
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/db/domain/entity"
|
||||
"mayfly-go/internal/db/domain/repository"
|
||||
"mayfly-go/pkg/base"
|
||||
"mayfly-go/pkg/model"
|
||||
)
|
||||
|
||||
type dataSyncTaskRepoImpl struct {
|
||||
base.RepoImpl[*entity.DataSyncTask]
|
||||
}
|
||||
|
||||
func newDataSyncTaskRepo() repository.DataSyncTask {
|
||||
return &dataSyncTaskRepoImpl{}
|
||||
}
|
||||
|
||||
// 分页获取数据库信息列表
|
||||
func (d *dataSyncTaskRepoImpl) GetTaskList(condition *entity.DataSyncTaskQuery, orderBy ...string) (*model.PageResult[*entity.DataSyncTask], error) {
|
||||
qd := model.NewCond().
|
||||
Like("task_name", condition.Name).
|
||||
Eq("status", condition.Status)
|
||||
return d.PageByCond(qd, condition.PageParam)
|
||||
}
|
||||
|
||||
type dataSyncLogRepoImpl struct {
|
||||
base.RepoImpl[*entity.DataSyncLog]
|
||||
}
|
||||
|
||||
func newDataSyncLogRepo() repository.DataSyncLog {
|
||||
return &dataSyncLogRepoImpl{}
|
||||
}
|
||||
|
||||
// 分页获取数据库信息列表
|
||||
func (d *dataSyncLogRepoImpl) GetTaskLogList(condition *entity.DataSyncLogQuery, orderBy ...string) (*model.PageResult[*entity.DataSyncLog], error) {
|
||||
qd := model.NewCond().
|
||||
Eq("task_id", condition.TaskId)
|
||||
return d.PageByCond(qd, condition.PageParam)
|
||||
}
|
||||
Reference in New Issue
Block a user