v2.1
This commit is contained in:
父節點
6a6c95925a
當前提交
7a08a5114c
@ -48,7 +48,7 @@ public class JobController {
|
||||
@RequestParam(required = false) String jobId,
|
||||
@RequestParam(required = false) String dataStr,
|
||||
@RequestParam(required = false) MultipartFile dataFile,
|
||||
@RequestParam String param,
|
||||
@RequestParam(defaultValue = "{}") String param,
|
||||
@RequestParam String mail,
|
||||
@RequestParam(defaultValue = "0") Integer type) {
|
||||
if (dataFile == null && StrUtil.isBlank(dataStr)) {
|
||||
@ -174,7 +174,7 @@ public class JobController {
|
||||
return jobService.getJobInfo(jobId);
|
||||
}
|
||||
|
||||
@GetMapping("/list/v2")
|
||||
@GetMapping("/list")
|
||||
public Result getJobList(@RequestParam String appName,
|
||||
@RequestParam(required = false) Integer type,
|
||||
@RequestParam(defaultValue = "true") Boolean filterCreating,
|
||||
|
@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
@ -53,8 +54,6 @@ public class JobService extends ServiceImpl<JobMapper, Job> {
|
||||
*/
|
||||
@Transactional
|
||||
public Result submit(AppConfigDto appConfig, String dataStr, MultipartFile dataFile, JSONObject param, Job job) {
|
||||
this.saveOrUpdate(job);
|
||||
|
||||
try {
|
||||
// dataStr和dataFile均为蛋白质序列,两者含义相同只保留其一,dataFile的优先级大于dataStr
|
||||
// 若dataFile为空,则将dataStr写入本地文件,之后向python传递文件路径参数
|
||||
@ -69,16 +68,15 @@ public class JobService extends ServiceImpl<JobMapper, Job> {
|
||||
param.put("jobId", job.getJobId());
|
||||
param.put("requestDataPath", dataPath);
|
||||
param.put("resultDataPath", appConfig.getResultPath());
|
||||
|
||||
// 更新数据库param字段
|
||||
job.setParam(JSON.toJSONString(param));
|
||||
this.saveOrUpdate(job);
|
||||
updateJobStatus(job, JobStatusEnum.WAITING);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
updateJobStatus(job, JobStatusEnum.FAIL);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
// 更新数据库param字段
|
||||
job.setParam(JSON.toJSONString(param));
|
||||
this.saveOrUpdate(job);
|
||||
updateJobStatus(job, JobStatusEnum.WAITING);
|
||||
|
||||
return getJobInfo(job.getJobId());
|
||||
}
|
||||
|
||||
|
載入中…
x
新增問題並參考
Block a user