2021-09-11 14:04:09 +08:00
|
|
|
package persistence
|
|
|
|
|
|
|
|
|
|
import (
|
2023-07-03 21:42:04 +08:00
|
|
|
"mayfly-go/internal/msg/domain/entity"
|
|
|
|
|
"mayfly-go/internal/msg/domain/repository"
|
2023-10-26 17:15:49 +08:00
|
|
|
"mayfly-go/pkg/base"
|
2022-06-02 17:41:11 +08:00
|
|
|
"mayfly-go/pkg/model"
|
2021-09-11 14:04:09 +08:00
|
|
|
)
|
|
|
|
|
|
2023-10-26 17:15:49 +08:00
|
|
|
type msgRepoImpl struct {
|
|
|
|
|
base.RepoImpl[*entity.Msg]
|
|
|
|
|
}
|
2021-09-11 14:04:09 +08:00
|
|
|
|
2022-09-09 18:26:08 +08:00
|
|
|
func newMsgRepo() repository.Msg {
|
2023-10-26 17:15:49 +08:00
|
|
|
return &msgRepoImpl{base.RepoImpl[*entity.Msg]{M: new(entity.Msg)}}
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|
2021-09-11 14:04:09 +08:00
|
|
|
|
2023-10-26 17:15:49 +08:00
|
|
|
func (m *msgRepoImpl) GetPageList(condition *entity.Msg, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
2024-04-28 23:45:57 +08:00
|
|
|
pd := model.NewModelCond(condition).OrderBy(orderBy...)
|
|
|
|
|
return m.PageByCond(pd, pageParam, toEntity)
|
2021-09-11 14:04:09 +08:00
|
|
|
}
|