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>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-devtools</artifactId>
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
@ -39,20 +50,15 @@
|
|||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>runtime</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-mail</artifactId>
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
@ -61,13 +67,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
<version>1.2.76</version>
|
<version>1.2.83</version>
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baomidou</groupId>
|
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
|
||||||
<version>3.4.1</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -90,7 +90,7 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>biology</finalName>
|
<finalName>ai-backend-template</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
@ -9,7 +9,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class TokenFilter implements Filter {
|
public class CorsFilter implements Filter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
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.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
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
|
* Created by skyyemperor on 2020-12-27 10:54
|
||||||
@ -18,13 +13,13 @@ import java.util.Map;
|
|||||||
public class FilterConfig {
|
public class FilterConfig {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenFilter tokenFilter;
|
private CorsFilter corsFilter;
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
@Bean
|
@Bean
|
||||||
public FilterRegistrationBean tokenFilterRegistration() {
|
public FilterRegistrationBean tokenFilterRegistration() {
|
||||||
FilterRegistrationBean registration = new FilterRegistrationBean();
|
FilterRegistrationBean registration = new FilterRegistrationBean();
|
||||||
registration.setFilter(tokenFilter);
|
registration.setFilter(corsFilter);
|
||||||
registration.addUrlPatterns("/*");
|
registration.addUrlPatterns("/*");
|
||||||
registration.setName("tokenFilter");
|
registration.setName("tokenFilter");
|
||||||
registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE);
|
registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE);
|
||||||
|
@ -20,7 +20,6 @@ public interface JobMapper extends BaseMapper<Job> {
|
|||||||
|
|
||||||
Job selectNextWaitingJob();
|
Job selectNextWaitingJob();
|
||||||
|
|
||||||
List<Job> selectJobList(@Param("type") Integer type,
|
List<Job> selectJobList(@Param("type") Integer type);
|
||||||
@Param("count") Integer count);
|
|
||||||
|
|
||||||
}
|
}
|
@ -59,12 +59,23 @@ public class JobService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TaskExecutorUtil<?> taskExecutorUtil;
|
private TaskExecutorUtil<?> taskExecutorUtil;
|
||||||
|
|
||||||
private static final String SUBJECT = "【DeepBIO Result Notice】";
|
@Value("${email.subject}")
|
||||||
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 String SUBJECT;
|
||||||
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";
|
@Value("${email.content.success}")
|
||||||
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 String SUCCESS_EMAIL_CONTENT;
|
||||||
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.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
|
* 提交job
|
||||||
@ -156,7 +167,7 @@ public class JobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Result getJobList(Integer type) {
|
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()));
|
return Result.success(jobs.stream().map(JobLessDto::parseJob).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,8 +52,9 @@
|
|||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
AND type = #{type}
|
AND type = #{type}
|
||||||
</if>
|
</if>
|
||||||
|
AND create_time > DATE_SUB(CURDATE(), INTERVAL 3 MONTH)
|
||||||
</where>
|
</where>
|
||||||
ORDER BY job_id DESC
|
ORDER BY job_id DESC
|
||||||
LIMIT #{count}
|
<!-- LIMIT #{count}-->
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
載入中…
x
新增問題並參考
Block a user