Explorar o código

uploadBallScreenVideo

lyhzzz %!s(int64=3) %!d(string=hai) anos
pai
achega
7c56fc3848

+ 14 - 13
src/main/java/com/cdf/interceptor/SceneInterceptor.java

@@ -43,10 +43,8 @@ public class SceneInterceptor implements HandlerInterceptor {
 
 	private static final Log log = LogFactory.getLog("programLog");
 
-	@Autowired
-	private IUserService userService;
-	@Autowired
-	private IFdkkUserService fdkkUserService;
+	@Value("${fdkk.hot-local-path}")
+	private String hotLocalPath;
 	@Resource
 	FdkkClient fdkkClient;
 	@Autowired
@@ -83,9 +81,16 @@ public class SceneInterceptor implements HandlerInterceptor {
 			if(request.getContentType().contains("application/json")){
 				send = fdkkClient.sendPostJson(requestURI, JSONObject.parseObject(ReadAsChars(request)), fdkkToken);
 			}else {
+				HashMap<String,String> map = new HashMap<>();
+				Enumeration<String> parameterNames = request.getParameterNames();
+				while (parameterNames.hasMoreElements()) {
+					String key =  parameterNames.nextElement();
+					String value = request.getParameter(key);
+					map.put(key,value);
+				}
+
 				MultipartHttpServletRequest mRequest = (MultipartHttpServletRequest) request;
 				Map<String, MultipartFile> fileMap = mRequest.getFileMap();
-				HashMap<String,String> map = new HashMap<>();
 				String path = null;
 				if(fileMap.size() >0){
 					for (Map.Entry<String, MultipartFile> next : fileMap.entrySet()) {
@@ -93,19 +98,15 @@ public class SceneInterceptor implements HandlerInterceptor {
 						if(file !=null && file.getSize() >0){
 							String fileName = file.getOriginalFilename();
 							assert fileName != null;
-							String s = fileName.substring(fileName.lastIndexOf("."));
-							File newFile = File.createTempFile(fileName,s);
+							String newFilePath = String.format(hotLocalPath,map.get("num")) + "/"+fileName ;
+
+							File newFile = new File(newFilePath);
 							file.transferTo(newFile);
 							path = newFile.getPath();
 						}
 					}
 				}
-				Enumeration<String> parameterNames = request.getParameterNames();
-				while (parameterNames.hasMoreElements()) {
-					String key =  parameterNames.nextElement();
-					String value = request.getParameter(key);
-					map.put(key,value);
-				}
+
 				if(fileMap.size() >0){
 					send = fdkkClient.sendPostFile(requestURI, map, path,fdkkToken);
 				}else {

+ 2 - 0
src/main/java/com/cdf/service/impl/FdkkSceneEditService.java

@@ -46,8 +46,10 @@ public class FdkkSceneEditService {
     private String hotPath;
     @Value("${fdkk.hot-cdf-path}")
     private String hotCdfPath;
+
     @Value("${fdkk.hot-local-path}")
     private String hotLocalPath;
+
     @Value("${fdkk.qr-code-url}")
     private String qrCodeUrl;
     @Resource

+ 2 - 2
src/main/resources/application.yaml

@@ -30,6 +30,6 @@ forest:
   ## 打开/关闭Forest响应内容日志(默认为 false)
   log-response-content: true
   ## 请求超时时间,单位为毫秒, 默认值为3000
-  timeout: 300000
+  timeout: 3000000
   ## 连接超时时间,单位为毫秒, 默认值为2000
-  connect-timeout: 300000
+  connect-timeout: 3000000