2022-09-09 18:26:08 +08:00
|
|
|
package persistence
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"mayfly-go/internal/machine/domain/entity"
|
|
|
|
|
"mayfly-go/internal/machine/domain/repository"
|
2023-10-26 17:15:49 +08:00
|
|
|
"mayfly-go/pkg/base"
|
2022-09-09 18:26:08 +08:00
|
|
|
"mayfly-go/pkg/model"
|
|
|
|
|
)
|
|
|
|
|
|
2023-10-26 17:15:49 +08:00
|
|
|
type machineScriptRepoImpl struct {
|
|
|
|
|
base.RepoImpl[*entity.MachineScript]
|
|
|
|
|
}
|
2022-09-09 18:26:08 +08:00
|
|
|
|
|
|
|
|
func newMachineScriptRepo() repository.MachineScript {
|
2023-10-26 17:15:49 +08:00
|
|
|
return &machineScriptRepoImpl{base.RepoImpl[*entity.MachineScript]{M: new(entity.MachineScript)}}
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 分页获取机器信息列表
|
2023-10-26 17:15:49 +08:00
|
|
|
func (m *machineScriptRepoImpl) GetPageList(condition *entity.MachineScript, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
2024-04-28 23:45:57 +08:00
|
|
|
qd := model.NewModelCond(condition).OrderBy(orderBy...)
|
2024-05-05 14:53:30 +08:00
|
|
|
return m.PageByCondToAny(qd, pageParam, toEntity)
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|