mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	refactor: 新增base.Repo与base.App,重构repo与app层代码
This commit is contained in:
		@@ -2,41 +2,28 @@ package repository
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"mayfly-go/internal/machine/domain/entity"
 | 
			
		||||
	"mayfly-go/pkg/base"
 | 
			
		||||
	"mayfly-go/pkg/model"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type MachineCronJob interface {
 | 
			
		||||
	GetPageList(condition *entity.MachineCronJob, pageParam *model.PageParam, toEntity any, orderBy ...string) *model.PageResult[any]
 | 
			
		||||
	base.Repo[*entity.MachineCronJob]
 | 
			
		||||
 | 
			
		||||
	// 根据条件获取
 | 
			
		||||
	GetBy(condition *entity.MachineCronJob, cols ...string) error
 | 
			
		||||
 | 
			
		||||
	// 根据id获取
 | 
			
		||||
	GetById(id uint64, cols ...string) *entity.MachineCronJob
 | 
			
		||||
 | 
			
		||||
	Delete(id uint64)
 | 
			
		||||
 | 
			
		||||
	Insert(entity *entity.MachineCronJob)
 | 
			
		||||
 | 
			
		||||
	UpdateById(entity *entity.MachineCronJob)
 | 
			
		||||
	GetPageList(condition *entity.MachineCronJob, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type MachineCronJobRelate interface {
 | 
			
		||||
	base.Repo[*entity.MachineCronJobRelate]
 | 
			
		||||
 | 
			
		||||
	GetList(condition *entity.MachineCronJobRelate) []entity.MachineCronJobRelate
 | 
			
		||||
 | 
			
		||||
	GetMachineIds(cronJobId uint64) []uint64
 | 
			
		||||
 | 
			
		||||
	GetCronJobIds(machineId uint64) []uint64
 | 
			
		||||
 | 
			
		||||
	Delete(condition *entity.MachineCronJobRelate)
 | 
			
		||||
 | 
			
		||||
	BatchInsert(mcjrs []*entity.MachineCronJobRelate)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type MachineCronJobExec interface {
 | 
			
		||||
	GetPageList(condition *entity.MachineCronJobExec, pageParam *model.PageParam, toEntity any, orderBy ...string) *model.PageResult[any]
 | 
			
		||||
	base.Repo[*entity.MachineCronJobExec]
 | 
			
		||||
 | 
			
		||||
	Insert(mcje *entity.MachineCronJobExec)
 | 
			
		||||
 | 
			
		||||
	Delete(m *entity.MachineCronJobExec)
 | 
			
		||||
	GetPageList(condition *entity.MachineCronJobExec, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user