feat: show job according to creation order

This commit is contained in:
tjq 2021-03-14 00:48:13 +08:00
parent 0fc9978385
commit 1273b16caf
4 changed files with 12 additions and 3 deletions

9
.gitignore vendored
View File

@ -34,4 +34,11 @@ build/
*.jar
*.log
*/.DS_Store
.DS_Store
.DS_Store
.phd
.txt
.trc
*/.phd
*/.txt
*/.trc

View File

@ -53,7 +53,7 @@ class FileCleanupProcessorTest {
@Test
void testCleanWorkerScript() throws Exception {
JSONObject params = new JSONObject();
params.put("dirPath", "/Users/tjq/powerjob/script");
params.put("dirPath", "/");
params.put("filePattern", "(shell|python)_[0-9]*\\.(sh|py)");
params.put("retentionTime", 24);
JSONArray array = new JSONArray();

View File

@ -44,6 +44,8 @@ public class JobInfoDO {
/**
* 任务自带的参数
*/
@Lob
@Column
private String jobParams;
/* ************************** 定时参数 ************************** */

View File

@ -70,7 +70,7 @@ public class JobController {
@PostMapping("/list")
public ResultDTO<PageResult<JobInfoVO>> listJobs(@RequestBody QueryJobInfoRequest request) {
Sort sort = Sort.by(Sort.Direction.DESC, "gmtCreate");
Sort sort = Sort.by(Sort.Direction.ASC, "id");
PageRequest pageRequest = PageRequest.of(request.getIndex(), request.getPageSize(), sort);
Page<JobInfoDO> jobInfoPage;