1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.ruoyi.service.impl;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.ModelTestTask;
import com.ruoyi.service.StrategyModelTestTask;
import com.ruoyi.web.response.ModelTestResponse;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional
public class StrategyModelTestTaskFinish implements StrategyModelTestTask, InitializingBean {
@Autowired
private ApplicationContext applicationContext;
@Autowired
private StrategyModelTestTaskContext strategyModelTestTaskContext;
@Override
public ModelTestResponse doView(ModelTestTask modelTestTask) {
throw new ServiceException("不能开始一个结束的任务", HttpStatus.ERROR);
}
@Override
public void doStartTest(ModelTestTask modelTestTask) {
throw new ServiceException("不能开始一个结束的任务", HttpStatus.ERROR);
}
@Override
public void doConfirmTest(ModelTestTask modelTestTask) {
throw new ServiceException("不能确认一个结束的任务", HttpStatus.ERROR);
}
@Override
public void doSubmitTest(ModelTestTask modelTestTask, List<String> imagesUrl) {
throw new ServiceException("不能提交一个结束的任务", HttpStatus.ERROR);
}
@Override
public void afterPropertiesSet() throws Exception {
strategyModelTestTaskContext.putResource(ModelTestTask.TASK_STATUS_FINISH, applicationContext.getBean(this.getClass()));
}
}