fix: 获取job列表接口改为三个月以内的数据
Signed-off-by: skyyemperor <skyyemperor@qq.com>
This commit is contained in:
		| @@ -9,7 +9,7 @@ import java.io.IOException; | ||||
| 
 | ||||
| 
 | ||||
| @Component | ||||
| public class TokenFilter implements Filter { | ||||
| public class CorsFilter implements Filter { | ||||
| 
 | ||||
|     @Override | ||||
|     public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { | ||||
| @@ -4,11 +4,6 @@ import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.boot.web.servlet.FilterRegistrationBean; | ||||
| import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.Configuration; | ||||
| import org.springframework.web.filter.DelegatingFilterProxy; | ||||
|  | ||||
| import javax.servlet.DispatcherType; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * Created by skyyemperor on 2020-12-27 10:54 | ||||
| @@ -18,13 +13,13 @@ import java.util.Map; | ||||
| public class FilterConfig { | ||||
|  | ||||
|     @Autowired | ||||
|     private TokenFilter tokenFilter; | ||||
|     private CorsFilter corsFilter; | ||||
|  | ||||
|     @SuppressWarnings({"rawtypes", "unchecked"}) | ||||
|     @Bean | ||||
|     public FilterRegistrationBean tokenFilterRegistration() { | ||||
|         FilterRegistrationBean registration = new FilterRegistrationBean(); | ||||
|         registration.setFilter(tokenFilter); | ||||
|         registration.setFilter(corsFilter); | ||||
|         registration.addUrlPatterns("/*"); | ||||
|         registration.setName("tokenFilter"); | ||||
|         registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); | ||||
|   | ||||
| @@ -20,7 +20,6 @@ public interface JobMapper extends BaseMapper<Job> { | ||||
|  | ||||
|     Job selectNextWaitingJob(); | ||||
|  | ||||
|     List<Job> selectJobList(@Param("type") Integer type, | ||||
|                             @Param("count") Integer count); | ||||
|     List<Job> selectJobList(@Param("type") Integer type); | ||||
|  | ||||
| } | ||||
| @@ -59,12 +59,23 @@ public class JobService { | ||||
|     @Autowired | ||||
|     private TaskExecutorUtil<?> taskExecutorUtil; | ||||
|  | ||||
|     private static final String SUBJECT = "【DeepBIO Result Notice】"; | ||||
|     private static final String SUCCESS_EMAIL_CONTENT = "Your request has been completed, click http://server.wei-group.net/front/biology/#/resultMail?jobId=%s to check the detail information"; | ||||
|     private static final String FAIL_EMAIL_CONTENT = "We are very sorry, but some errors occurred in the task you submitted, click http://server.wei-group.net/front/biology/#/resultMail?jobId=%s to check the detail information"; | ||||
|     private static final String TIMEOUT_EMAIL_CONTENT = "We are very sorry, but the task you submitted was overtime, click http://server.wei-group.net/front/biology/#/resultMail?jobId=%s to check the detail information"; | ||||
|     private static final String RECEIVED_EMAIL_CONTENT = "Your request has been received,  click http://server.wei-group.net/front/biology/#/resultMail?jobId=%s to check the detail information"; | ||||
|     private static final String START_RUNNING_EMAIL_CONTENT = "Your task has started running, click http://server.wei-group.net/front/biology/#/resultMail?jobId=%s to check the detail information"; | ||||
|     @Value("${email.subject}") | ||||
|     private String SUBJECT; | ||||
|  | ||||
|     @Value("${email.content.success}") | ||||
|     private String SUCCESS_EMAIL_CONTENT; | ||||
|  | ||||
|     @Value("${email.content.fail}") | ||||
|     private String FAIL_EMAIL_CONTENT; | ||||
|  | ||||
|     @Value("${email.content.timeout}") | ||||
|     private String TIMEOUT_EMAIL_CONTENT; | ||||
|  | ||||
|     @Value("${email.content.received}") | ||||
|     private String RECEIVED_EMAIL_CONTENT; | ||||
|  | ||||
|     @Value("${email.content.running}") | ||||
|     private String START_RUNNING_EMAIL_CONTENT; | ||||
|  | ||||
|     /** | ||||
|      * 提交job | ||||
| @@ -156,7 +167,7 @@ public class JobService { | ||||
|     } | ||||
|  | ||||
|     public Result getJobList(Integer type) { | ||||
|         List<Job> jobs = jobMapper.selectJobList(type, 200); | ||||
|         List<Job> jobs = jobMapper.selectJobList(type); | ||||
|         return Result.success(jobs.stream().map(JobLessDto::parseJob).collect(Collectors.toList())); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -52,8 +52,9 @@ | ||||
|             <if test="type != null"> | ||||
|                 AND type = #{type} | ||||
|             </if> | ||||
|             AND create_time > DATE_SUB(CURDATE(), INTERVAL 3 MONTH) | ||||
|         </where> | ||||
|         ORDER BY job_id DESC | ||||
|         LIMIT #{count} | ||||
| <!--        LIMIT #{count}--> | ||||
|     </select> | ||||
| </mapper> | ||||
		Reference in New Issue
	
	Block a user