mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-04-07 13:57:36 +00:00
fix order
This commit is contained in:
@@ -68,11 +68,16 @@ public class PageRequestDto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<SortField<Object>> getSortFields() {
|
public List<SortField<Object>> getSortFields() {
|
||||||
return sortBy.entrySet().stream()
|
List<SortField<Object>> sortFields = sortBy.entrySet().stream()
|
||||||
.map(
|
.map(
|
||||||
(entry) ->
|
(entry) ->
|
||||||
field(name(entry.getKey())).sort(SortOrder.valueOf(entry.getValue().getKeyword())))
|
field(name(entry.getKey())).sort(SortOrder.valueOf(entry.getValue().getKeyword())))
|
||||||
.toList();
|
.toList();
|
||||||
|
if (sortFields.isEmpty()) {
|
||||||
|
return List.of(field(name("id")).sort(SortOrder.ASC));
|
||||||
|
} else {
|
||||||
|
return sortFields;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkPageAndSize(int page, int size) {
|
private void checkPageAndSize(int page, int size) {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class QrtzJobRepository extends QrtzJobDetailsDao {
|
|||||||
StringUtils.isNotEmpty(queryDto.name())
|
StringUtils.isNotEmpty(queryDto.name())
|
||||||
? QRTZ_JOB_DETAILS.SCHED_NAME.eq(queryDto.name())
|
? QRTZ_JOB_DETAILS.SCHED_NAME.eq(queryDto.name())
|
||||||
: noCondition())
|
: noCondition())
|
||||||
.orderBy(pageRequestDto.getSortFields())
|
.orderBy(QRTZ_JOB_DETAILS.qrtzTriggers().TRIGGER_NAME)
|
||||||
.limit(pageRequestDto.getSize())
|
.limit(pageRequestDto.getSize())
|
||||||
.offset(pageRequestDto.getOffset())
|
.offset(pageRequestDto.getOffset())
|
||||||
.fetch();
|
.fetch();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
VITE_APP_PORT=5173
|
VITE_APP_PORT=5173
|
||||||
VITE_SOURCE_MAP=true
|
VITE_SOURCE_MAP=true
|
||||||
# mock
|
# mock
|
||||||
VITE_ENABLE_MOCK=true
|
#VITE_ENABLE_MOCK=true
|
||||||
VITE_BASE_URL=http://localhost:5173
|
#VITE_BASE_URL=http://localhost:5173
|
||||||
# local
|
# local
|
||||||
#VITE_ENABLE_MOCK=false
|
VITE_ENABLE_MOCK=false
|
||||||
#VITE_BASE_URL=http://localhost:8080
|
VITE_BASE_URL=http://localhost:8080
|
||||||
# dev
|
# dev
|
||||||
#VITE_ENABLE_MOCK=false
|
#VITE_ENABLE_MOCK=false
|
||||||
#VITE_BASE_URL=https://localhost/api
|
#VITE_BASE_URL=https://localhost/api
|
||||||
|
|||||||
Reference in New Issue
Block a user