Files
mayfly-go/server/internal/sys/infrastructure/persistence/account.go

25 lines
694 B
Go
Raw Normal View History

package persistence
import (
"mayfly-go/internal/sys/domain/entity"
"mayfly-go/internal/sys/domain/repository"
"mayfly-go/pkg/base"
"mayfly-go/pkg/model"
)
2024-01-21 22:52:20 +08:00
type AccountRepoImpl struct {
base.RepoImpl[*entity.Account]
2022-09-09 18:26:08 +08:00
}
func newAccountRepo() repository.Account {
2024-01-21 22:52:20 +08:00
return &AccountRepoImpl{base.RepoImpl[*entity.Account]{M: new(entity.Account)}}
2023-07-24 22:36:07 +08:00
}
func (m *AccountRepoImpl) GetPageList(condition *entity.AccountQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
qd := model.NewCond().
Like("name", condition.Name).
Like("username", condition.Username).
In("id", condition.Ids)
2024-05-05 14:53:30 +08:00
return m.PageByCondToAny(qd, pageParam, toEntity)
}