use of lee.study.down.model.TaskInfo in project proxyee-down by monkeyWie.
the class OpenController method open.
@RequestMapping("createTask")
public ResultInfo open(@RequestBody CreateTaskForm createTaskForm) throws Exception {
ResultInfo resultInfo = HttpDownController.commonBuildTask(createTaskForm.getRequest());
if (resultInfo.getStatus() == ResultStatus.SUCC.getCode()) {
TaskInfo taskInfo = ContentManager.DOWN.getTaskInfo(resultInfo.getData().toString());
NewTaskForm taskForm = new NewTaskForm();
taskForm.setId(taskInfo.getId());
if (!StringUtils.isEmpty(createTaskForm.getFileName())) {
taskForm.setFileName(createTaskForm.getFileName());
} else {
taskForm.setFileName(taskInfo.getFileName());
}
if (!StringUtils.isEmpty(taskInfo.getFilePath())) {
taskForm.setFilePath(taskInfo.getFilePath());
} else {
taskForm.setFilePath(createTaskForm.getFilePath());
}
taskForm.setUnzip(createTaskForm.getUnzipFlag() == 1);
taskForm.setUnzipPath(createTaskForm.getUnzipPath());
taskForm.setConnections(createTaskForm.getConnections());
resultInfo = HttpDownController.commonStartTask(taskForm);
}
return resultInfo;
}
Aggregations