mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-12 12:20:25 +08:00
25 lines
670 B
Go
25 lines
670 B
Go
package persistence
|
|
|
|
import (
|
|
"mayfly-go/internal/msg/domain/entity"
|
|
"mayfly-go/internal/msg/domain/repository"
|
|
"mayfly-go/pkg/biz"
|
|
"mayfly-go/pkg/gormx"
|
|
"mayfly-go/pkg/model"
|
|
)
|
|
|
|
type msgRepoImpl struct{}
|
|
|
|
func newMsgRepo() repository.Msg {
|
|
return new(msgRepoImpl)
|
|
}
|
|
|
|
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)
|
|
}
|
|
|
|
func (m *msgRepoImpl) Insert(account *entity.Msg) {
|
|
biz.ErrIsNil(gormx.Insert(account), "新增消息记录失败")
|
|
}
|