Skip to content

Commit

Permalink
feat: 条目条件查询接口 (#735)
Browse files Browse the repository at this point in the history
* build: v0.20.4

* feat: 条目条件查询接口
  • Loading branch information
chivehao authored Nov 13, 2024
1 parent 779b23a commit ec0326f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

更新日志文档,版本顺序从新到旧,最新版本在最前(上)面。

# 0.20.4

## 优化

- 条目条件查询接口

# 0.20.3

## 新特性
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.20.3
version=0.20.4
Original file line number Diff line number Diff line change
Expand Up @@ -348,16 +348,16 @@ public Mono<PagingWrap<Subject>> listEntitiesByCondition(FindSubjectCondition co
}
}

Query query = Query.query(criteria)
.sort(Sort.by(Sort.Order.asc("name")))
.sort(Sort.by(Sort.Order.asc("type")))
.sort(Sort.by(Sort.Order.asc("nsfw")))
.sort(Sort.by(updateTimeDesc
? Sort.Order.desc("update_time")
: Sort.Order.asc("update_time")))
.sort(Sort.by(airTimeDesc
? Sort.Order.desc("air_time")
Query query = Query.query(criteria);

if (updateTimeDesc) {
query = query.sort(Sort.by(Sort.Order.desc("update_time")));
}

query = query
.sort(Sort.by(airTimeDesc ? Sort.Order.desc("air_time")
: Sort.Order.asc("air_time")))
.sort(Sort.by(Sort.Order.asc("name")))
.with(pageRequest);

Flux<SubjectEntity> subjectEntityFlux = template.select(query, SubjectEntity.class);
Expand Down

0 comments on commit ec0326f

Please sign in to comment.