|
@@ -29,6 +29,7 @@ import org.dromara.system.domain.vo.SysOssVo;
|
|
|
import org.dromara.system.service.ISysOssService;
|
|
import org.dromara.system.service.ISysOssService;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.dromara.business.domain.bo.TournamentsBo;
|
|
import org.dromara.business.domain.bo.TournamentsBo;
|
|
|
import org.dromara.business.service.ITournamentsService;
|
|
import org.dromara.business.service.ITournamentsService;
|
|
@@ -41,6 +42,7 @@ import java.time.format.DateTimeFormatter;
|
|
|
import java.time.format.DateTimeFormatterBuilder;
|
|
import java.time.format.DateTimeFormatterBuilder;
|
|
|
import java.time.temporal.ChronoField;
|
|
import java.time.temporal.ChronoField;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -611,6 +613,8 @@ public class TournamentsServiceImpl implements ITournamentsService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public SysOssVo uploadTournament(MultipartFile file) {
|
|
public SysOssVo uploadTournament(MultipartFile file) {
|
|
|
|
|
+ log.info("uploadTournament开始上传文件: {}, 大小: {} bytes",
|
|
|
|
|
+ file.getOriginalFilename(), file.getSize());
|
|
|
// 1. 上传文件到 OSS
|
|
// 1. 上传文件到 OSS
|
|
|
SysOssVo sysOssVo = ossService.uploadInputstream(file);
|
|
SysOssVo sysOssVo = ossService.uploadInputstream(file);
|
|
|
return sysOssVo;
|
|
return sysOssVo;
|
|
@@ -753,7 +757,18 @@ public class TournamentsServiceImpl implements ITournamentsService {
|
|
|
return TableDataInfo.build(result);
|
|
return TableDataInfo.build(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Async
|
|
|
|
|
+ public CompletableFuture<SysOssVo> uploadTournamentAsync(MultipartFile file) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 上传文件到 OSS
|
|
|
|
|
+ SysOssVo sysOssVo = ossService.uploadInputstream(file);
|
|
|
|
|
+ return CompletableFuture.completedFuture(sysOssVo);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("文件上传失败", e);
|
|
|
|
|
+ return CompletableFuture.completedFuture(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
private Date parseDateTime(String dateTimeStr) throws ParseException {
|
|
private Date parseDateTime(String dateTimeStr) throws ParseException {
|
|
|
if (dateTimeStr == null || dateTimeStr.isBlank()) {
|
|
if (dateTimeStr == null || dateTimeStr.isBlank()) {
|