解决接口响应超时

This commit is contained in:
chen-xin-zhi 2025-05-08 22:30:12 +08:00
parent 4a6cca7373
commit 9652eea78b
2 changed files with 10 additions and 0 deletions

View File

@ -194,6 +194,14 @@
<version>1.2.62</version> <version>1.2.62</version>
</dependency> </dependency>
<!-- 配置注解处理器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>

View File

@ -4,6 +4,7 @@ import com.greenorange.promotion.annotation.Timeout;
import com.greenorange.promotion.common.ErrorCode; import com.greenorange.promotion.common.ErrorCode;
import com.greenorange.promotion.exception.BusinessException; import com.greenorange.promotion.exception.BusinessException;
import com.greenorange.promotion.exception.ThrowUtils; import com.greenorange.promotion.exception.ThrowUtils;
import lombok.NoArgsConstructor;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.annotation.Pointcut;
@ -21,6 +22,7 @@ public class TimeoutAspect {
private final ExecutorService executorService; private final ExecutorService executorService;
// 构造器注入线程池 // 构造器注入线程池
@Autowired @Autowired
public TimeoutAspect(ExecutorService executorService) { public TimeoutAspect(ExecutorService executorService) {