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 {
|
2024-12-08 13:04:23 +08:00
|
|
|
return &msgRepoImpl{}
|
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...)
|
2024-05-05 14:53:30 +08:00
|
|
|
return m.PageByCondToAny(pd, pageParam, toEntity)
|
2021-09-11 14:04:09 +08:00
|
|
|
}
|