mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-15 12:16:34 +08:00
refactor: 消息模块重构,infra包路径简写等
This commit is contained in:
33
server/internal/redis/infra/persistence/redis_repo.go
Normal file
33
server/internal/redis/infra/persistence/redis_repo.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package persistence
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/redis/domain/entity"
|
||||
"mayfly-go/internal/redis/domain/repository"
|
||||
"mayfly-go/pkg/base"
|
||||
"mayfly-go/pkg/model"
|
||||
)
|
||||
|
||||
type redisRepoImpl struct {
|
||||
base.RepoImpl[*entity.Redis]
|
||||
}
|
||||
|
||||
func newRedisRepo() repository.Redis {
|
||||
return &redisRepoImpl{}
|
||||
}
|
||||
|
||||
// 分页获取redis信息列表
|
||||
func (r *redisRepoImpl) GetRedisList(condition *entity.RedisQuery, orderBy ...string) (*model.PageResult[*entity.Redis], error) {
|
||||
qd := model.NewCond().
|
||||
Eq("id", condition.Id).
|
||||
Like("host", condition.Host).
|
||||
Eq("code", condition.Code).
|
||||
In("code", condition.Codes)
|
||||
|
||||
keyword := condition.Keyword
|
||||
if keyword != "" {
|
||||
keyword = "%" + keyword + "%"
|
||||
qd.And("host like ? or name like ? or code like ?", keyword, keyword, keyword)
|
||||
}
|
||||
|
||||
return r.PageByCond(qd, condition.PageParam)
|
||||
}
|
||||
Reference in New Issue
Block a user