2022-07-14 11:39:12 +08:00
|
|
|
package persistence
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"mayfly-go/internal/sys/domain/entity"
|
|
|
|
|
"mayfly-go/internal/sys/domain/repository"
|
2023-10-26 17:15:49 +08:00
|
|
|
"mayfly-go/pkg/base"
|
2023-07-01 14:34:42 +08:00
|
|
|
"mayfly-go/pkg/gormx"
|
2022-07-14 11:39:12 +08:00
|
|
|
"mayfly-go/pkg/model"
|
|
|
|
|
)
|
|
|
|
|
|
2023-10-26 17:15:49 +08:00
|
|
|
type syslogRepoImpl struct {
|
|
|
|
|
base.RepoImpl[*entity.SysLog]
|
|
|
|
|
}
|
2022-07-14 11:39:12 +08:00
|
|
|
|
2022-09-09 18:26:08 +08:00
|
|
|
func newSyslogRepo() repository.Syslog {
|
2023-10-26 17:15:49 +08:00
|
|
|
return &syslogRepoImpl{base.RepoImpl[*entity.SysLog]{M: new(entity.SysLog)}}
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|
2022-07-14 11:39:12 +08:00
|
|
|
|
2023-10-26 17:15:49 +08:00
|
|
|
func (m *syslogRepoImpl) GetPageList(condition *entity.SysLogQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
2023-07-08 20:05:55 +08:00
|
|
|
qd := gormx.NewQuery(new(entity.SysLog)).Like("description", condition.Description).
|
2023-07-04 14:13:47 +08:00
|
|
|
Eq("creator_id", condition.CreatorId).Eq("type", condition.Type).WithOrderBy(orderBy...)
|
2023-07-01 14:34:42 +08:00
|
|
|
return gormx.PageQuery(qd, pageParam, toEntity)
|
2022-07-14 11:39:12 +08:00
|
|
|
}
|