fix: 模版排序不稳定
This commit is contained in:
@@ -9,6 +9,7 @@ import com.lanyuanxiaoyao.service.template.controller.GlobalResponse;
|
|||||||
import com.lanyuanxiaoyao.service.template.controller.SimpleControllerSupport;
|
import com.lanyuanxiaoyao.service.template.controller.SimpleControllerSupport;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -48,7 +49,10 @@ public class TaskController extends SimpleControllerSupport<Task, Void, TaskCont
|
|||||||
|
|
||||||
@GetMapping("template/list")
|
@GetMapping("template/list")
|
||||||
public GlobalResponse<Map<String, Object>> templateList() {
|
public GlobalResponse<Map<String, Object>> templateList() {
|
||||||
var templates = taskService.getTemplates();
|
var templates = taskService.getTemplates()
|
||||||
|
.stream()
|
||||||
|
.sorted(Comparator.comparing(TaskService.TaskTemplate::name))
|
||||||
|
.toList();
|
||||||
return GlobalResponse.responseCrudData(templates, templates.size());
|
return GlobalResponse.responseCrudData(templates, templates.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ spring:
|
|||||||
job-store-type: jdbc
|
job-store-type: jdbc
|
||||||
jdbc:
|
jdbc:
|
||||||
platform: postgres
|
platform: postgres
|
||||||
# initialize-schema: always
|
initialize-schema: always
|
||||||
properties:
|
properties:
|
||||||
org:
|
org:
|
||||||
quartz:
|
quartz:
|
||||||
|
|||||||
Reference in New Issue
Block a user