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

25 lines
665 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"
)
type configRepoImpl struct {
base.RepoImpl[*entity.Config]
}
2022-09-09 18:26:08 +08:00
func newConfigRepo() repository.Config {
2024-12-08 13:04:23 +08:00
return &configRepoImpl{}
2022-09-09 18:26:08 +08:00
}
func (m *configRepoImpl) GetPageList(condition *entity.Config, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
qd := model.NewCond().
Like("`key`", condition.Key).
2023-08-25 19:41:52 +08:00
And("permission = 'all' OR permission LIKE ?", "%"+condition.Permission+",%").
OrderBy(orderBy...)
2024-05-05 14:53:30 +08:00
return m.PageByCondToAny(qd, pageParam, toEntity)
}