mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 16:00:25 +08:00
feat: 系统日志支持按描述搜索
This commit is contained in:
@@ -14,8 +14,9 @@ type Syslog struct {
|
||||
func (r *Syslog) Syslogs(rc *req.Ctx) {
|
||||
g := rc.GinCtx
|
||||
condition := &entity.Syslog{
|
||||
Type: int8(ginx.QueryInt(g, "type", 0)),
|
||||
CreatorId: uint64(ginx.QueryInt(g, "creatorId", 0)),
|
||||
Type: int8(ginx.QueryInt(g, "type", 0)),
|
||||
CreatorId: uint64(ginx.QueryInt(g, "creatorId", 0)),
|
||||
Description: ginx.Query(g, "description", ""),
|
||||
}
|
||||
rc.ResData = r.SyslogApp.GetPageList(condition, ginx.GetPageParam(g), new([]entity.Syslog), "create_time DESC")
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ func newSyslogRepo() repository.Syslog {
|
||||
}
|
||||
|
||||
func (m *syslogRepoImpl) GetPageList(condition *entity.Syslog, pageParam *model.PageParam, toEntity any, orderBy ...string) *model.PageResult[any] {
|
||||
qd := gormx.NewQuery(condition).WithCondModel(condition).WithOrderBy(orderBy...)
|
||||
qd := gormx.NewQuery(condition).Like("description", condition.Description).
|
||||
Eq("creator_id", condition.CreatorId).Eq("type", condition.Type).WithOrderBy(orderBy...)
|
||||
return gormx.PageQuery(qd, pageParam, toEntity)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user