fix: 获取job列表接口改为三个月以内的数据
Signed-off-by: skyyemperor <skyyemperor@qq.com>
This commit is contained in:
父節點
34e481f0a5
當前提交
7a5e6586a8
32
pom.xml
32
pom.xml
@ -32,6 +32,17 @@
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
@ -39,20 +50,15 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
@ -61,13 +67,7 @@
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.76</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<version>1.2.83</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -90,7 +90,7 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>biology</finalName>
|
||||
<finalName>ai-backend-template</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -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>
|
載入中…
x
新增問題並參考
Block a user