@@ -80,18 +80,11 @@ public class JobService {
|
||||
|
||||
/**
|
||||
* 提交job
|
||||
*
|
||||
* @param dataStr 文本内容
|
||||
* @param param 其他参数(json格式)
|
||||
* @param mail 邮箱
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional
|
||||
public Result submit(String dataStr, BufferedInputStream dataStream, JSONObject param, String mail, Integer type) {
|
||||
Job job = new Job("", JSON.toJSONString(param), mail, JobStatusEnum.WAIT.getKey(), LocalDateTime.now(), type);
|
||||
public Result submit(String dataStr, BufferedInputStream dataStream, JSONObject param, Job job) {
|
||||
jobMapper.insert(job);
|
||||
sendEmail(job, JobStatusEnum.WAIT, mail);
|
||||
sendEmail(job, JobStatusEnum.WAIT, job.getMail());
|
||||
|
||||
try {
|
||||
//将请求数据写入本地文件,之后向python传递文件路径参数
|
||||
@@ -172,8 +165,8 @@ 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);
|
||||
public Result getJobList(Integer type, Boolean filterCreating, Integer page, Integer size) {
|
||||
List<Job> jobs = jobMapper.selectJobListByPage(type, filterCreating, (page - 1) * size, size);
|
||||
return Result.success(jobs.stream().map(JobLessDto::parseJob).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user