2021-09-11 14:04:09 +08:00
|
|
|
package persistence
|
|
|
|
|
|
|
|
|
|
import (
|
2022-06-02 17:41:11 +08:00
|
|
|
"mayfly-go/internal/sys/domain/entity"
|
|
|
|
|
"mayfly-go/internal/sys/domain/repository"
|
|
|
|
|
"mayfly-go/pkg/biz"
|
2023-07-01 14:34:42 +08:00
|
|
|
"mayfly-go/pkg/gormx"
|
2022-06-02 17:41:11 +08:00
|
|
|
"mayfly-go/pkg/model"
|
2021-09-11 14:04:09 +08:00
|
|
|
)
|
|
|
|
|
|
2022-09-09 18:26:08 +08:00
|
|
|
type msgRepoImpl struct{}
|
2021-09-11 14:04:09 +08:00
|
|
|
|
2022-09-09 18:26:08 +08:00
|
|
|
func newMsgRepo() repository.Msg {
|
|
|
|
|
return new(msgRepoImpl)
|
|
|
|
|
}
|
2021-09-11 14:04:09 +08:00
|
|
|
|
2023-07-01 14:34:42 +08:00
|
|
|
func (m *msgRepoImpl) GetPageList(condition *entity.Msg, pageParam *model.PageParam, toEntity any, orderBy ...string) *model.PageResult[any] {
|
|
|
|
|
qd := gormx.NewQuery(condition).WithCondModel(condition).WithOrderBy(orderBy...)
|
|
|
|
|
return gormx.PageQuery(qd, pageParam, toEntity)
|
2021-09-11 14:04:09 +08:00
|
|
|
}
|
|
|
|
|
|
2022-09-09 18:26:08 +08:00
|
|
|
func (m *msgRepoImpl) Insert(account *entity.Msg) {
|
2023-07-01 14:34:42 +08:00
|
|
|
biz.ErrIsNil(gormx.Insert(account), "新增消息记录失败")
|
2021-09-11 14:04:09 +08:00
|
|
|
}
|