@@ -121,4 +121,11 @@ public class JobController {
|
||||
public Result getJobList(@RequestParam(required = false) Integer type) {
|
||||
return jobService.getJobList(type);
|
||||
}
|
||||
|
||||
@GetMapping("/list/v2")
|
||||
public Result getJobList(@RequestParam(required = false) Integer type,
|
||||
@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "100") Integer size) {
|
||||
return jobService.getJobList(type, page, size);
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +1,9 @@
|
||||
package com.weilab.biology.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.weilab.biology.core.data.dto.JobLessDto;
|
||||
import com.weilab.biology.core.data.po.Job;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.python.modules.itertools.count;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -22,4 +20,8 @@ public interface JobMapper extends BaseMapper<Job> {
|
||||
|
||||
List<Job> selectJobList(@Param("type") Integer type);
|
||||
|
||||
List<Job> selectJobListByPage(@Param("type") Integer type,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("count") Integer count);
|
||||
|
||||
}
|
@@ -172,6 +172,11 @@ public class JobService {
|
||||
return Result.success(jobs.stream().map(JobLessDto::parseJob).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
public Result getJobList(Integer type, Integer page, Integer size) {
|
||||
List<Job> jobs = jobMapper.selectJobListByPage(type, (page - 1) * size, size);
|
||||
return Result.success(jobs.stream().map(JobLessDto::parseJob).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行下一个job
|
||||
*/
|
||||
@@ -232,7 +237,6 @@ public class JobService {
|
||||
String param1 = job.getJobId().toString();
|
||||
String param2 = job.getRequestTime().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + job.getJobId();
|
||||
|
||||
|
||||
String content = null;
|
||||
switch (status) {
|
||||
case WAIT:
|
||||
|
新增問題並參考
封鎖使用者