lyhzzz пре 3 година
родитељ
комит
29fdb6bc2b
56 измењених фајлова са 1069 додато и 198 уклоњено
  1. 17 10
      pom.xml
  2. 43 0
      src/main/java/com/fdkankan/fusion/common/PageInfo.java
  3. 9 0
      src/main/java/com/fdkankan/fusion/common/RequestBase.java
  4. 4 0
      src/main/java/com/fdkankan/fusion/common/ResultCode.java
  5. 82 0
      src/main/java/com/fdkankan/fusion/common/ResultData.java
  6. 145 0
      src/main/java/com/fdkankan/fusion/common/util/JwtUtil.java
  7. 0 1
      src/main/java/com/fdkankan/fusion/common/util/OBJToGLBUtil.java
  8. 13 0
      src/main/java/com/fdkankan/fusion/common/util/ShellUtil.java
  9. 37 0
      src/main/java/com/fdkankan/fusion/common/util/StorageType.java
  10. 605 0
      src/main/java/com/fdkankan/fusion/common/util/UploadToOssUtil.java
  11. 0 63
      src/main/java/com/fdkankan/fusion/common/util/VideoUtil.java
  12. 1 2
      src/main/java/com/fdkankan/fusion/controller/CaseController.java
  13. 4 4
      src/main/java/com/fdkankan/fusion/controller/CaseFilesController.java
  14. 1 1
      src/main/java/com/fdkankan/fusion/controller/CaseFilesTypeController.java
  15. 3 3
      src/main/java/com/fdkankan/fusion/controller/CaseFusionController.java
  16. 5 5
      src/main/java/com/fdkankan/fusion/controller/CaseTagController.java
  17. 4 4
      src/main/java/com/fdkankan/fusion/controller/CaseTagPointController.java
  18. 1 4
      src/main/java/com/fdkankan/fusion/controller/CaseVideoController.java
  19. 4 5
      src/main/java/com/fdkankan/fusion/controller/CaseVideoFolderController.java
  20. 3 3
      src/main/java/com/fdkankan/fusion/controller/CaseViewController.java
  21. 5 5
      src/main/java/com/fdkankan/fusion/controller/FusionGuideController.java
  22. 4 4
      src/main/java/com/fdkankan/fusion/controller/FusionGuidePathController.java
  23. 6 6
      src/main/java/com/fdkankan/fusion/controller/FusionMeterController.java
  24. 5 5
      src/main/java/com/fdkankan/fusion/controller/HotIconController.java
  25. 1 1
      src/main/java/com/fdkankan/fusion/controller/LoginController.java
  26. 4 4
      src/main/java/com/fdkankan/fusion/controller/ModelController.java
  27. 1 1
      src/main/java/com/fdkankan/fusion/controller/SceneController.java
  28. 1 1
      src/main/java/com/fdkankan/fusion/controller/TestController.java
  29. 2 3
      src/main/java/com/fdkankan/fusion/controller/UploadController.java
  30. 1 5
      src/main/java/com/fdkankan/fusion/exception/BusinessException.java
  31. 1 1
      src/main/java/com/fdkankan/fusion/exception/GlobalExceptionHandler.java
  32. 1 1
      src/main/java/com/fdkankan/fusion/httpClient/client/FdKKClient.java
  33. 3 3
      src/main/java/com/fdkankan/fusion/interceptor/TokenInterceptor.java
  34. 1 1
      src/main/java/com/fdkankan/fusion/request/CaseParam.java
  35. 1 1
      src/main/java/com/fdkankan/fusion/request/ModelPram.java
  36. 1 1
      src/main/java/com/fdkankan/fusion/request/ScenePram.java
  37. 1 1
      src/main/java/com/fdkankan/fusion/service/ICaseService.java
  38. 1 1
      src/main/java/com/fdkankan/fusion/service/IModelService.java
  39. 1 1
      src/main/java/com/fdkankan/fusion/service/ISceneService.java
  40. 3 3
      src/main/java/com/fdkankan/fusion/service/impl/CaseFilesServiceImpl.java
  41. 1 1
      src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java
  42. 8 8
      src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java
  43. 2 2
      src/main/java/com/fdkankan/fusion/service/impl/CaseTagPointServiceImpl.java
  44. 1 1
      src/main/java/com/fdkankan/fusion/service/impl/CaseTagServiceImpl.java
  45. 1 1
      src/main/java/com/fdkankan/fusion/service/impl/CaseVideoFolderServiceImpl.java
  46. 4 4
      src/main/java/com/fdkankan/fusion/service/impl/CaseVideoServiceImpl.java
  47. 4 4
      src/main/java/com/fdkankan/fusion/service/impl/CaseViewServiceImpl.java
  48. 1 1
      src/main/java/com/fdkankan/fusion/service/impl/FdHotService.java
  49. 3 3
      src/main/java/com/fdkankan/fusion/service/impl/FusionGuidePathServiceImpl.java
  50. 2 2
      src/main/java/com/fdkankan/fusion/service/impl/FusionGuideServiceImpl.java
  51. 2 2
      src/main/java/com/fdkankan/fusion/service/impl/FusionMeterServiceImpl.java
  52. 3 3
      src/main/java/com/fdkankan/fusion/service/impl/FusionNumServiceImpl.java
  53. 1 1
      src/main/java/com/fdkankan/fusion/service/impl/HotIconServiceImpl.java
  54. 7 7
      src/main/java/com/fdkankan/fusion/service/impl/ModelServiceImpl.java
  55. 3 3
      src/main/java/com/fdkankan/fusion/service/impl/SceneService.java
  56. 1 1
      src/main/java/com/fdkankan/fusion/service/impl/UploadService.java

+ 17 - 10
pom.xml

@@ -18,13 +18,6 @@
 
     <dependencies>
 
-
-        <dependency>
-            <groupId>com.fdkankan</groupId>
-            <artifactId>4dkankan-utils-fyun</artifactId>
-            <version>2.0.0-SNAPSHOT</version>
-        </dependency>
-
         <dependency>
             <groupId>com.fdkankan</groupId>
             <artifactId>4dkankan-utils-redis</artifactId>
@@ -93,10 +86,24 @@
             <version>1.18.20</version>
         </dependency>
 
+
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>2.8.3</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+            <version>0.9.1</version>
+        </dependency>
+
         <dependency>
-            <groupId>org.bytedeco</groupId>
-            <artifactId>ffmpeg</artifactId>
-            <version>4.3.1-1.5.4</version>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+            <version>3.10.3</version>
         </dependency>
 
     </dependencies>

+ 43 - 0
src/main/java/com/fdkankan/fusion/common/PageInfo.java

@@ -0,0 +1,43 @@
+package com.fdkankan.fusion.common;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class PageInfo<T> {
+
+    private long pageNum;
+
+    private long pageSize;
+
+    private long total;
+
+    private T list;
+
+    public static PageInfo PageInfo(Page page){
+        return PageInfo.builder()
+            .pageNum(page.getCurrent())
+            .pageSize(page.getSize())
+            .total(page.getTotal())
+            .list(page.getRecords())
+            .build();
+    }
+    public static PageInfo PageInfo(Long currentPage, Long pageSize, Long total, List<?> list){
+        return PageInfo.builder()
+            .pageNum(currentPage)
+            .pageSize(pageSize)
+            .total(total)
+            .list(list)
+            .build();
+    }
+
+
+}

+ 9 - 0
src/main/java/com/fdkankan/fusion/common/RequestBase.java

@@ -0,0 +1,9 @@
+package com.fdkankan.fusion.common;
+
+import lombok.Data;
+
+@Data
+public class RequestBase {
+    private Integer pageNum = 1;
+    private Integer pageSize = 10;
+}

+ 4 - 0
src/main/java/com/fdkankan/fusion/common/ResultCode.java

@@ -1,7 +1,11 @@
 package com.fdkankan.fusion.common;
 
 public enum ResultCode {
+    SUCCESS(0,"操作成功"),
+    ERROR(-1,"操作失败"),
 
+    MISSING_REQUIRED_PARAMETERS(4001,"参数缺少"),
+    USER_NOT_LOGIN(2001,"用户未登录"),
     UPLOAD_ERROR(7001,"文件上传失败"),
     UPLOAD_FILE_NO_EXIST(7002,"上传文件不存在"),
     UPLOAD_FILE_TO_LONG(7003,"文件上传过大"),

+ 82 - 0
src/main/java/com/fdkankan/fusion/common/ResultData.java

@@ -0,0 +1,82 @@
+package com.fdkankan.fusion.common;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Calendar;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ResultData<T> implements Serializable {
+    /**
+     * 状态码
+     */
+    private int code;
+    /**
+     * 响应信息
+     */
+    private String message;
+    /**
+     * 后端返回结果
+     */
+    private T data;
+    /**
+     * 后端返回结果
+     */
+    private Boolean success;
+    /**
+     * 响应时间戳
+     */
+    private long timestamp = Calendar.getInstance().getTimeInMillis();
+
+    public static ResultData ok() {
+        return ok(null);
+    }
+
+    public static ResultData ok(Object data) {
+        return ok(ResultCode.SUCCESS.msg, data);
+    }
+
+    public static ResultData ok(String msg, Object data) {
+        return base(ResultCode.SUCCESS.code, msg, data, true);
+    }
+
+    public static ResultData ok(int page, int pageSize, int total, Object data) {
+        return ok(new PageInfo(page, pageSize, total, data));
+    }
+
+    public static ResultData error( String msg) {
+        return error(ResultCode.ERROR.code, msg, null);
+    }
+    public static ResultData error(int code, String msg) {
+        return error(code, msg, null);
+    }
+
+    public static ResultData error(int code, String msg, Object data) {
+        return base(code, msg, data, false);
+    }
+
+    public static ResultData error(ResultCode errorCode, Object data) {
+        return base(errorCode.code, errorCode.msg, data, false);
+    }
+
+    public static ResultData error(ResultCode errorCode) {
+        return error(errorCode.code, errorCode.msg);
+    }
+    public static String errorString(ResultCode errorCode) {
+        return JSONObject.toJSONString(error(errorCode.code, errorCode.msg));
+    }
+
+    private static ResultData base(int code, String msg, Object data, Boolean success) {
+        ResultData rd = new ResultData();
+        rd.setCode(code);
+        rd.setMessage(msg);
+        rd.setData(data);
+        rd.setSuccess(success);
+        return rd;
+    }
+}

+ 145 - 0
src/main/java/com/fdkankan/fusion/common/util/JwtUtil.java

@@ -0,0 +1,145 @@
+package com.fdkankan.fusion.common.util;
+
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.exceptions.JWTDecodeException;
+import com.auth0.jwt.interfaces.DecodedJWT;
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.JwtBuilder;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.SignatureAlgorithm;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+public class JwtUtil {
+
+    //生成签名的时候使用的秘钥secret
+    private static final String SECRET = "XX#$%()(#*!()!KL<><MQLMNQNQJQK&sdfkjsdrow32234545fdf>?N<:{LWPW";
+
+    /**
+     * 用户登录成功后生成Jwt
+     * 使用Hs256算法  私匙使用用户密码
+     *
+     * @param ttlMillis jwt过期时间
+     * @param userName  用户名
+     * @return
+     */
+    public static String createJWT(long ttlMillis, String userName, String loginType) {
+        //指定签名的时候使用的签名算法,也就是header那部分,jjwt已经将这部分内容封装好了。
+        SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
+
+        //生成JWT的时间
+        long nowMillis = System.currentTimeMillis();
+        Date now = new Date(nowMillis);
+
+        //创建payload的私有声明(根据特定的业务需要添加,如果要拿这个做验证,一般是需要和jwt的接收方提前沟通好验证方式的)
+        Map<String, Object> claims = new HashMap<String, Object>();
+        claims.put("userName", userName);
+        claims.put("loginType", loginType);
+
+        //下面就是在为payload添加各种标准声明和私有声明了
+        //这里其实就是new一个JwtBuilder,设置jwt的body
+        JwtBuilder builder = Jwts.builder()
+                //如果有私有声明,一定要先设置这个自己创建的私有的声明,这个是给builder的claim赋值,一旦写在标准的声明赋值之后,就是覆盖了那些标准的声明的
+                .setClaims(claims)
+                //设置jti(JWT ID):是JWT的唯一标识,根据业务需要,这个可以设置为一个不重复的值,主要用来作为一次性token,从而回避重放攻击。
+                .setId(UUID.randomUUID().toString())
+                //iat: jwt的签发时间
+                .setIssuedAt(now)
+                //代表这个JWT的主体,即它的所有人,这个是一个json格式的字符串,可以存放什么userid,roldid之类的,作为什么用户的唯一标志。
+                .setSubject(userName)
+                //设置签名使用的签名算法和签名使用的秘钥
+                .signWith(signatureAlgorithm, SECRET);
+
+        if (ttlMillis >= 0) {
+            long expMillis = nowMillis + ttlMillis;
+            Date exp = new Date(expMillis);
+            //设置过期时间
+            builder.setExpiration(exp);
+        }/*else{
+            //设置过期时间半小时
+            DateTime expDate = new DateTime().plusMinutes(30);
+            builder.setExpiration(expDate.toDate());
+        }*/
+        return builder.compact();
+    }
+
+
+    /**
+     * Token的解密
+     * @param token 加密后的token
+     * @return
+     */
+    public static Claims parseJWT(String token) {
+        //得到DefaultJwtParser
+        Claims claims = Jwts.parser()
+                //设置签名的秘钥
+                .setSigningKey(SECRET)
+                //设置需要解析的jwt
+                .parseClaimsJws(token).getBody();
+        return claims;
+    }
+
+
+    /**
+     * 校验token
+     * 在这里可以使用官方的校验,我这里校验的是token中携带的密码于数据库一致的话就校验通过
+     * @param token
+     * @param userName
+     * @return
+     */
+    public static Boolean isVerify(String token, String userName) {
+
+        try {
+            //得到DefaultJwtParser
+            Claims claims = Jwts.parser()
+                //设置签名的秘钥
+                .setSigningKey(SECRET)
+                //设置需要解析的jwt
+                .parseClaimsJws(token).getBody();
+
+            if (claims.get("userName").equals(userName)) {
+                return true;
+            }
+        }catch (Exception e){
+            return false;
+        }
+        return false;
+    }
+
+    /**
+     * 获得token中的信息无需secret解密也能获得
+     *
+     * @return token中包含的用户名
+     */
+    public static String getUsername(String token) {
+        try {
+            DecodedJWT jwt = JWT.decode(token);
+            return jwt.getClaim("userName").asString();
+        } catch (JWTDecodeException e) {
+            return null;
+        }
+    }
+    /**
+     * 获得token中的信息无需secret解密也能获得
+     *
+     * @return token中包含的用户名
+     */
+    public static String getLoginType(String token) {
+        try {
+            DecodedJWT jwt = JWT.decode(token);
+            return jwt.getClaim("loginType").asString();
+        } catch (JWTDecodeException e) {
+            return null;
+        }
+    }
+
+    public static void main(String[] args) {
+        long start = System.currentTimeMillis();
+        System.out.println(getUsername("eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMzUzNjUwMTEyOCIsImxvZ2luVHlwZSI6InVzZXIiLCJ1c2VyTmFtZSI6IjEzNTM2NTAxMTI4IiwiaWF0IjoxNjU4ODI4NjA2LCJqdGkiOiI4NjczYjFiMi0xYjc4LTRmMTEtOGQ5My05OWE0OWRlMGVhMjAifQ.0oYzEwTsV1iLn_cMeiqLc5upJfcYipRbIDSndSxeuK0"));
+        System.out.println(System.currentTimeMillis() - start);
+    }
+
+}

+ 0 - 1
src/main/java/com/fdkankan/fusion/common/util/OBJToGLBUtil.java

@@ -1,6 +1,5 @@
 package com.fdkankan.fusion.common.util;
 
-import com.fdkankan.common.util.CreateObjUtil;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.exception.BusinessException;
 import lombok.extern.slf4j.Slf4j;

+ 13 - 0
src/main/java/com/fdkankan/fusion/common/util/ShellUtil.java

@@ -62,4 +62,17 @@ public class ShellUtil {
         }
     }
 
+    public static void unZip(String zipPath, String dataPath) {
+        log.info("解压zip开始");
+        String command = "unzip -O GBK/GB18030CP936 " + zipPath + " -d " + dataPath;
+        execCmd(command);
+        log.info("解压zip完毕:" + command);
+    }
+
+    public static void unRar(String rarPath, String dataPath) {
+        log.info("解压rar开始");
+        String command = "unrar e " + rarPath + " " + dataPath;
+        execCmd(command);
+        log.info("解压rar完毕:" + command);
+    }
 }

+ 37 - 0
src/main/java/com/fdkankan/fusion/common/util/StorageType.java

@@ -0,0 +1,37 @@
+package com.fdkankan.fusion.common.util;
+
+public enum StorageType {
+
+    OSS("oss", "阿里云"),
+    AWS("aws", "亚马逊"),
+    LOCAL("local", "本地");
+
+    private String code;
+    private String message;
+
+    private StorageType(String code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public String code() {
+        return code;
+    }
+
+    public String message() {
+        return message;
+    }
+
+    public static StorageType get(String code){
+        StorageType[] values = StorageType.values();
+        String enumValue = null;
+        for(StorageType eachValue : values){
+            enumValue = eachValue.code();
+            if(enumValue.equals(code)){
+                return eachValue;
+            }
+        }
+        return null;
+    }
+
+}

+ 605 - 0
src/main/java/com/fdkankan/fusion/common/util/UploadToOssUtil.java

@@ -0,0 +1,605 @@
+package com.fdkankan.fusion.common.util;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.FileUtil;
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.*;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.io.*;
+import java.net.FileNameMap;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Component
+public class UploadToOssUtil {
+
+
+	@Value("${oss.point:http://oss-cn-shenzhen-internal.aliyuncs.com}")
+	private String point;
+
+	@Value("${oss.key:LTAIUrvuHqj8pvry}")
+	private String key;
+
+	@Value("${oss.secrey:JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4}")
+	private String secrey;
+
+	@Value("${oss.bucket:4dkankan}")
+	private String bucket;
+
+	@Value("${upload.type:oss}")
+	private String type;
+
+	@Value("${local.path:/home/4dkankan}")
+	private String localPath;
+
+	/**
+	 * oss文件上传命令
+	 * 第一个参数是oss路径,要包含bucket名称
+	 * 第二个参数是本地文件路径
+	 */
+	private static final String UPLOAD_SH = "bash /opt/ossutil/upload.sh %s %s";
+
+	//上传的数据是byte[],key是上传后的文件名
+	public void upload(byte[] data,String key1) throws IOException{
+		log.info("开始上传文件 源路径:{},目标路径:{},type:{}" , new String(data, "UTF-8"),key1,type);
+		StorageType storageType = StorageType.get(type);
+		switch (storageType){
+			case OSS:
+				uploadOss(data,key1);
+				break;
+			case AWS:
+				break;
+			case LOCAL:
+				uploadLocal(data,key1);
+				break;
+		}
+	}
+	public void upload(String filePath, String key1) {
+		log.info("开始上传文件 源路径:{},目标路径:{},type:{}" , filePath,key1,type);
+		StorageType storageType = StorageType.get(type);
+		switch (storageType){
+			case OSS:
+				uploadOss(filePath,key1);
+				break;
+			case AWS:
+				uploadAws(filePath,key1);
+				break;
+			case LOCAL:
+				uploadLocal(filePath,key1);
+				break;
+		}
+	}
+
+
+	public void delete(String key1) throws IOException{
+		switch (type){
+			case "oss":deleteOss(key1); break;
+			case "local":FileUtil.del(key1);  break;
+		}
+	}
+
+	/**
+	 * 删除目录或者文件
+	 * @param prefix
+	 * @return
+	 */
+	public int deleteFile(String prefix){
+		switch (type){
+			case "oss":deleteOssFile(prefix); break;
+			case "local":FileUtil.del(prefix);  break;
+		}
+		return 1;
+	}
+
+	public void deleteOss(String objectName){
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		try {
+			ossClient.deleteObject(bucket, objectName);
+		} catch (Exception e) {
+			log.error("OSS删除文件失败,key=" + objectName);
+		}finally {
+			if(ossClient != null){
+				ossClient.shutdown();
+			}
+		}
+	}
+
+	public void deleteOssFile(String prefix){
+		int maxKeys = 200;
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		try {
+
+			String nextMarker = null;
+			ObjectListing objectListing;
+
+			do {
+				objectListing = ossClient.listObjects(new ListObjectsRequest(this.bucket).withPrefix(prefix).withMarker(nextMarker).withMaxKeys(maxKeys));
+				List<OSSObjectSummary> sums = objectListing.getObjectSummaries();
+				if (CollUtil.isEmpty(sums)) {
+					return;
+				}
+				List<String> keys = new ArrayList<>();
+				for (OSSObjectSummary sum : sums) {
+					keys.add(sum.getKey());
+				}
+				DeleteObjectsRequest deleteObjectsRequest =
+					new DeleteObjectsRequest(bucket).withKeys(keys).withEncodingType("url");
+				DeleteObjectsResult deleteObjectsResult = ossClient
+					.deleteObjects(deleteObjectsRequest);
+				List<String> deletedObjects = deleteObjectsResult.getDeletedObjects();
+				try {
+					for (String deletedObject : deletedObjects) {
+						String decode = URLDecoder.decode(deletedObject, "UTF-8");
+						log.info("删除oss文件:{}", decode);
+					}
+				} catch (UnsupportedEncodingException e) {
+					e.printStackTrace();
+				}
+
+//				ListUtil.page(keys, 100, subKeys -> {
+//					DeleteObjectsRequest deleteObjectsRequest = new DeleteObjectsRequest(bucket)
+//						.withKeys(
+//							subKeys).withEncodingType("url");
+//					DeleteObjectsResult deleteObjectsResult = ossClient
+//						.deleteObjects(deleteObjectsRequest);
+//					List<String> deletedObjects = deleteObjectsResult.getDeletedObjects();
+//					try {
+//						for (String deletedObject : deletedObjects) {
+//							String decode = URLDecoder.decode(deletedObject, "UTF-8");
+//							log.info("删除oss文件:{}", decode);
+//						}
+//					} catch (UnsupportedEncodingException e) {
+//						e.printStackTrace();
+//					}
+//				});
+			}while (objectListing.isTruncated());
+		}catch (Exception  e){
+			e.printStackTrace();
+		}finally {
+			if(ossClient != null){
+				ossClient.shutdown();
+			}
+		}
+	}
+
+
+	public void uploadOss(byte[] data,String objectName){
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		try {
+			ossClient.putObject(bucket, objectName, new ByteArrayInputStream(data));
+		} catch (Exception e) {
+			log.error("oss上传文件失败", e);
+		}finally {
+			if(ossClient != null){
+				ossClient.shutdown();
+			}
+		}
+	}
+	public void uploadLocal(byte[] data,String key1){
+		InputStream in = new ByteArrayInputStream(data);
+		File file = new File(key1);
+		String path = key1.substring(0, key1.lastIndexOf("/"));
+		if (!file.exists()) {
+			new File(path).mkdir();
+		}
+		FileOutputStream fos = null;
+		try {
+			fos = new FileOutputStream(file);
+			int len = 0;
+			byte[] buf = new byte[1024];
+			while ((len = in.read(buf)) != -1) {
+				fos.write(buf, 0, len);
+			}
+			fos.flush();
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			if (null != fos) {
+				try {
+					fos.close();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+			}
+		}
+	}
+
+
+	public void uploadOss(String filePath, String key1){
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		try {
+			File file = new File(filePath);
+			if (!file.exists()) {
+				log.error("要上传的文件不存在:" + filePath);
+				return;
+			}
+			ObjectMetadata metadata = new ObjectMetadata();
+			if(filePath.contains(".jpg")){
+				metadata.setContentType("image/jpeg");
+			}
+			ossClient.putObject(bucket, key1, new File(filePath), metadata);
+
+		} catch (Exception e) {
+			log.error(e.toString() + filePath);
+		} finally {
+			ossClient.shutdown();
+		}
+	}
+
+	public void uploadAws(String filePath, String key1){
+		try{
+		}catch (Exception e){
+			e.printStackTrace();
+		}
+	}
+	public void uploadLocal(String filePath, String key1){
+		try {
+			File srcFile = new File(filePath);
+			File file = new File(localPath + key1);
+			FileUtils.copyFile(srcFile,file);
+		}catch (Exception e){
+			e.printStackTrace();
+		}
+	}
+
+
+	/**
+	 * 获取文件类型
+	 */
+	public static String getContentType(String filePath){
+		FileNameMap fileNameMap = URLConnection.getFileNameMap();
+		String contentType = fileNameMap.getContentTypeFor(filePath);
+		System.out.println(contentType);
+		return contentType;
+
+	}
+
+	/**
+	 * 检查文件是否为空
+	 *
+	 * @param imageFile
+	 * @return
+	 */
+	private static boolean isEmpty(MultipartFile imageFile) {
+		if (imageFile == null || imageFile.getSize() <= 0) {
+			return true;
+		}
+		return false;
+	}
+
+	public List<String> listKeys(String sourcePath){
+		StorageType storageType = StorageType.get(type);
+		switch (storageType){
+			case OSS:
+				return this.listKeysFromAli(sourcePath);
+			case AWS:
+				return this.listKeysFromAws(sourcePath);
+			case LOCAL:
+				return this.listKeysFromLocal(sourcePath);
+		}
+		return null;
+	}
+
+	/**
+	 * 获得文件列表-阿里云
+	 * @return
+	 */
+	public List<String> listKeysFromAli(String sourcePath) {
+		List<String> keyList = new ArrayList<>();
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		try {
+			boolean flag = true;
+			String nextMaker = null;
+			ListObjectsRequest listObjectsRequest = new ListObjectsRequest(this.bucket);
+			//指定下一级文件
+			listObjectsRequest.setPrefix(sourcePath);
+			//设置分页的页容量
+			listObjectsRequest.setMaxKeys(200);
+			do
+			{
+				//获取下一页的起始点,它的下一项
+				listObjectsRequest.setMarker(nextMaker);
+				ObjectListing objectListing = ossClient.listObjects(listObjectsRequest);
+				List<OSSObjectSummary> objectSummaries = objectListing.getObjectSummaries();
+				List<String> collect = objectSummaries.stream().map(summary -> {
+					return summary.getKey();
+				}).collect(Collectors.toList());
+				if(CollUtil.isNotEmpty(collect)){
+					keyList.addAll(collect);
+				}
+				nextMaker = objectListing.getNextMarker();
+				//全部执行完后,为false
+				flag = objectListing.isTruncated();
+			} while (flag);
+		}catch (Exception e){
+			log.error("获取文件列表失败,path="+sourcePath, e);
+		}finally {
+			if(ossClient != null){
+				ossClient.shutdown();
+			}
+		}
+
+
+		ossClient.shutdown();
+
+		return keyList;
+	}
+
+	/**
+	 * 获得文件列表-亚马逊
+	 * @return
+	 */
+	public List<String> listKeysFromAws(String sourcePath) {
+		return null;
+	}
+
+	/**
+	 * 获得文件列表-阿里云
+	 * @return
+	 */
+	public List<String> listKeysFromLocal(String sourcePath) {
+		List<String> keyList = new ArrayList<>();
+		return keyList;
+	}
+
+	/**
+	 * <p>
+	        拷贝目录
+	 * </p>
+	 * @author dengsixing
+	 * @date 2022/1/18
+	 * @param sourcePath
+	 * @param targetPath
+	 **/
+	public void copyFiles(String sourcePath, String targetPath) throws IOException {
+		StorageType storageType = StorageType.get(type);
+		switch (storageType){
+			case OSS:
+				this.copyFilesFromAli(sourcePath, targetPath);
+				break;
+			case AWS:
+				break;
+			case LOCAL: this.copyFilesFromLocal(sourcePath, targetPath);
+		}
+	}
+
+	/**
+	 * <p>
+	 拷贝文件
+	 * </p>
+	 * @author dengsixing
+	 * @date 2022/1/18
+	 * @param sourceKey
+	 * @param targetKey
+	 **/
+	public void copyObject(String sourceKey, String targetKey) throws IOException {
+		StorageType storageType = StorageType.get(type);
+		switch (storageType){
+			case OSS:
+				this.copyObjectFromAli(sourceKey, targetKey);
+				break;
+			case AWS:
+				break;
+		}
+	}
+
+	/**
+	 * <p>
+	 拷贝-阿里云
+	 * </p>
+	 * @author dengsixing
+	 * @date 2022/1/18
+	 * @param sourcePath
+	 * @param targetPath
+	 **/
+	public void copyObjectFromAli(String sourcePath, String targetPath) throws IOException {
+
+		// 创建OSSClient实例。
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		// 复制文件
+		log.info("开始复制:" + sourcePath);
+		ossClient.copyObject(this.bucket, sourcePath, this.bucket, targetPath);
+		log.info("复制成功:" + sourcePath);
+		ossClient.shutdown();
+	}
+
+
+
+	/**
+	 * <p>
+	 拷贝-阿里云
+	 * </p>
+	 * @author dengsixing
+	 * @date 2022/1/18
+	 * @param sourcePath
+	 * @param targetPath
+	 **/
+	public void copyFilesFromAli(String sourcePath, String targetPath) throws IOException {
+
+		//获取源文件列表
+		List<String> sourceKeyList = this.listKeysFromAli(sourcePath);
+		if(CollUtil.isEmpty(sourceKeyList)){
+			return;
+		}
+		// 创建OSSClient实例。
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		// 复制文件
+		sourceKeyList.parallelStream().forEach(key -> {
+			log.info("开始复制:" + key);
+			ossClient.copyObject(this.bucket, key, this.bucket, key.replace(sourcePath, targetPath));
+			log.info("复制成功:" + key);
+		});
+
+		ossClient.shutdown();
+	}
+
+
+	/**
+	 * <p>
+	 拷贝-本地
+	 * </p>
+	 * @author dengsixing
+	 * @date 2022/1/18
+	 * @param sourcePath
+	 * @param targetPath
+	 **/
+	public void copyFilesFromLocal(String sourcePath, String targetPath) throws IOException {
+		// TODO: 2022/1/21
+
+	}
+
+	/**
+	 * 获取文件内容
+	 * @param bucketName
+	 * @param objectName
+	 * @return
+	 */
+	public String getObjectContent(String bucketName, String objectName){
+		StorageType storageType = StorageType.get(type);
+		switch (storageType){
+			case OSS:
+				return this.getObjectContentFromAli(bucketName, objectName);
+			case AWS:
+			case LOCAL:
+				return this.getObjectContentFromLocal(objectName);
+		}
+		return null;
+	}
+
+	/**
+	 * 获取文件内容-阿里云
+	 * @param bucketName
+	 * @param objectName
+	 * @return
+	 */
+	public String getObjectContentFromAli(String bucketName, String objectName){
+		//创建oss客户端
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		InputStream objectContent = null;
+		StringBuilder contentJson = new StringBuilder();
+		try {
+			// ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。
+			OSSObject ossObject = ossClient.getObject(bucketName, objectName);
+			objectContent = ossObject.getObjectContent();
+			try(BufferedReader reader = new BufferedReader(new InputStreamReader(objectContent))){
+				while (true) {
+					String line = reader.readLine();
+					if (line == null) break;
+					contentJson.append(line);
+				}
+			} catch (IOException e) {
+				log.error("读取scene.json文件流失败", e);
+			}
+		}catch (Exception e){
+			log.error("s3获取文件内容失败,key="+objectName, e);
+		}finally {
+			if(ossClient != null){
+				ossClient.shutdown();
+			}
+		}
+
+		return contentJson.toString();
+	}
+
+	/**
+	 * 获取文件内容-阿里云
+	 * @param objectName
+	 * @return
+	 */
+	public boolean existOnAli(String objectName){
+		//创建oss客户端
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		// ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。
+		try{
+			boolean exist = ossClient.doesObjectExist(bucket, objectName);
+			return exist;
+		}catch (Exception e){
+			log.error("s4判断是否存在key异常,key=" + objectName, e);
+		}finally {
+			if(ossClient != null){
+				ossClient.shutdown();
+			}
+		}
+		return false;
+	}
+
+
+	/**
+	 * 判断key是否存在
+	 * @param key
+	 * @return
+	 */
+	public boolean existKey(String key){
+		StorageType storageType = StorageType.get(type);
+		switch (storageType){
+			case OSS:
+				return this.existOnAli(key);
+			case AWS:
+			default:
+				return false;
+		}
+	}
+
+	/**
+	 * 获取文件内容-本地
+	 * @param objectName
+	 * @return
+	 */
+	public String getObjectContentFromLocal(String objectName){
+		// TODO: 2022/1/21
+		return null;
+	}
+
+	/**
+	 * oss下载文件到本地
+	 * @param objectName
+	 * @param localPath
+	 */
+	public boolean download(String objectName, String localPath){
+		StorageType storageType = StorageType.get(this.type);
+		switch (storageType){
+			case OSS:
+				return this.downFormAli(objectName, localPath);
+			case AWS:
+		}
+		return false;
+	}
+
+	/**
+	 * 从阿里云oss下载文件到本地
+	 * @param objectName 云端文件k地址
+	 * @param localPath 本地文件地址
+	 * @return
+	 */
+	public boolean downFormAli(String objectName, String localPath){
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		try {
+			GetObjectRequest request  = new GetObjectRequest(bucket,objectName);
+			ossClient.getObject(request, new File(localPath));
+			return true;
+		}catch (Exception e){
+			log.error("阿里云oss文件下载失败,key=" + objectName, e);
+		}finally {
+			if(ossClient != null){
+				ossClient.shutdown();
+			}
+		}
+		return false;
+	}
+
+
+}

+ 0 - 63
src/main/java/com/fdkankan/fusion/common/util/VideoUtil.java

@@ -1,15 +1,6 @@
 package com.fdkankan.fusion.common.util;
 
-import com.fdkankan.common.util.CreateObjUtil;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.bytedeco.ffmpeg.avcodec.AVPacket;
-import org.bytedeco.ffmpeg.global.avcodec;
-import org.bytedeco.ffmpeg.global.avutil;
-import org.bytedeco.javacpp.Loader;
-import org.bytedeco.javacv.FFmpegFrameGrabber;
-import org.bytedeco.javacv.FFmpegFrameRecorder;
-import org.bytedeco.javacv.Frame;
 
 import java.io.*;
 import java.util.*;
@@ -17,60 +8,6 @@ import java.util.*;
 @Slf4j
 public class VideoUtil {
 
-    /**
-     *  多个视频的合并
-     * @param videoAddrSet  地址集合
-     * @param output  合并后的视频输出地址
-     */
-    public static String videoMerge(LinkedHashSet<String> videoAddrSet, String output)
-            throws org.bytedeco.javacv.FrameRecorder.Exception, org.bytedeco.javacv.FrameGrabber.Exception {
-        File tagFile = new File(output);
-        if(!tagFile.exists()){
-            tagFile.mkdirs();
-        }
-        String fileName =  UUID.randomUUID().toString().replace("-","")+".mp4";
-        output +="/"+fileName;
-
-        List<String> videoList = new ArrayList<>(videoAddrSet);
-
-        FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(videoList.get(0));
-        grabber.start();
-
-        FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(output, grabber.getImageWidth(),
-                grabber.getImageHeight(), 0);
-        recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
-//		recorder.setAudioChannels(1);
-//		recorder.setInterleaved(true);
-        recorder.setFormat("mp4");
-        recorder.setFrameRate(grabber.getFrameRate());
-        recorder.setPixelFormat(avutil.AV_PIX_FMT_YUV420P); // yuv420p
-        int bitrate = grabber.getVideoBitrate();
-        if (bitrate == 0) {
-            bitrate = grabber.getAudioBitrate();
-        }
-        recorder.setVideoBitrate(bitrate);
-
-        recorder.start();
-        Frame frame = null;
-        for (; (frame = grabber.grabImage()) != null;) {
-            // 封装/复用
-            recorder.record(frame);
-        }
-        for(int i=1;i<videoList.size();i++) {
-            FFmpegFrameGrabber grabberTemp = new FFmpegFrameGrabber(videoList.get(i));
-            grabberTemp.start();
-            for (; (frame = grabberTemp.grabImage()) != null;) {
-                // 封装/复用
-                recorder.record(frame);
-            }
-            grabberTemp.close();
-        }
-
-        recorder.close();
-        grabber.close();
-        return fileName;
-    }
-
 
     public static String mergeVideo(LinkedHashSet<String> fromVideoFileList, String newVideoFile) {
         File tagFile = new File(newVideoFile);

+ 1 - 2
src/main/java/com/fdkankan/fusion/controller/CaseController.java

@@ -2,9 +2,8 @@ package com.fdkankan.fusion.controller;
 
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.CaseEntity;
 import com.fdkankan.fusion.request.CaseParam;
 import com.fdkankan.fusion.service.ICaseNumService;

+ 4 - 4
src/main/java/com/fdkankan/fusion/controller/CaseFilesController.java

@@ -2,9 +2,9 @@ package com.fdkankan.fusion.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.CaseFiles;
 import com.fdkankan.fusion.service.ICaseFilesService;
 import org.apache.commons.lang3.StringUtils;
@@ -36,7 +36,7 @@ public class CaseFilesController {
     public ResultData add(@RequestBody CaseFiles caseFiles ){
         if(caseFiles.getCaseId() == null || StringUtils.isEmpty(caseFiles.getFilesTitle())
                 || caseFiles.getFilesTypeId()== null || StringUtils.isEmpty(caseFiles.getFilesUrl())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseFilesService.save(caseFiles);
         return ResultData.ok();
@@ -44,7 +44,7 @@ public class CaseFilesController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody CaseFiles caseFiles ){
         if(caseFiles.getFilesId() == null ){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseFilesService.removeById(caseFiles.getFilesId());
         return ResultData.ok();

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/CaseFilesTypeController.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.controller;
 
 
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.service.ICaseFilesTypeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;

+ 3 - 3
src/main/java/com/fdkankan/fusion/controller/CaseFusionController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.fusion.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.CaseFusion;
 import com.fdkankan.fusion.entity.FusionNum;
 import com.fdkankan.fusion.exception.BusinessException;
@@ -57,7 +57,7 @@ public class CaseFusionController {
     @PostMapping("/delete")
     public ResultData delete(@RequestParam(required = false) Integer id){
         if(id == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         return ResultData.ok(fusionNumService.removeById(id));
     }

+ 5 - 5
src/main/java/com/fdkankan/fusion/controller/CaseTagController.java

@@ -2,8 +2,8 @@ package com.fdkankan.fusion.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.CaseTag;
 import com.fdkankan.fusion.entity.CaseTagPoint;
 import com.fdkankan.fusion.exception.BusinessException;
@@ -36,7 +36,7 @@ public class CaseTagController {
     public ResultData add(@RequestBody CaseTag caseTag){
         if(caseTag.getHotIconId()==null ||  StringUtils.isEmpty(caseTag.getHotIconUrl())
               ||caseTag.getCaseId() == null  || StringUtils.isEmpty(caseTag.getTagTitle())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         //新增时取消icon上次使用标识,增加使用次数,设置新的上次使用标识
         if(caseTag.getHotIconId() !=null){
@@ -55,7 +55,7 @@ public class CaseTagController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody CaseTag caseTag){
         if(caseTag.getTagId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseTagService.removeById(caseTag.getTagId());
         return ResultData.ok();
@@ -64,7 +64,7 @@ public class CaseTagController {
     @PostMapping("/update")
     public ResultData update(@RequestBody CaseTag caseTag){
         if(caseTag.getTagId() == null ){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseTag.setUpdateTime(null);
         caseTagService.updateById(caseTag);

+ 4 - 4
src/main/java/com/fdkankan/fusion/controller/CaseTagPointController.java

@@ -2,8 +2,8 @@ package com.fdkankan.fusion.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.CaseTag;
 import com.fdkankan.fusion.entity.CaseTagPoint;
 import com.fdkankan.fusion.exception.BusinessException;
@@ -43,7 +43,7 @@ public class CaseTagPointController {
     @PostMapping("/updateSort")
     public ResultData updateSort(@RequestBody CaseTagPoint caseTagPoint){
         if(caseTagPoint.getTagPointId() == null || caseTagPoint.getSort() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<CaseTagPoint> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(CaseTagPoint::getTagPointId,caseTagPoint.getTagPointId() ).set(CaseTagPoint::getSort,caseTagPoint.getSort());
@@ -54,7 +54,7 @@ public class CaseTagPointController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody CaseTagPoint caseTagPoint){
         if(caseTagPoint.getTagPointId() == null ){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseTagPointService.removeById(caseTagPoint.getTagPointId());
         return ResultData.ok();

+ 1 - 4
src/main/java/com/fdkankan/fusion/controller/CaseVideoController.java

@@ -2,14 +2,11 @@ package com.fdkankan.fusion.controller;
 
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.response.Result;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.CaseVideo;
 import com.fdkankan.fusion.request.CaseParam;
 import com.fdkankan.fusion.request.CaseVideoParam;
 import com.fdkankan.fusion.service.ICaseVideoService;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;

+ 4 - 5
src/main/java/com/fdkankan/fusion/controller/CaseVideoFolderController.java

@@ -2,15 +2,14 @@ package com.fdkankan.fusion.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.CaseVideo;
 import com.fdkankan.fusion.entity.CaseVideoFolder;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.request.CaseVideoParam;
 import com.fdkankan.fusion.service.ICaseVideoFolderService;
 import com.fdkankan.fusion.service.ICaseVideoService;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -41,7 +40,7 @@ public class CaseVideoFolderController {
     public ResultData updateNameOrSort(@RequestBody CaseVideoFolder param){
         if(param.getVideoFolderId() == null ||
                 (param.getSort() == null && StringUtils.isEmpty(param.getVideoFolderName()))){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<CaseVideoFolder> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(CaseVideoFolder::getVideoFolderId,param.getVideoFolderId());
@@ -58,7 +57,7 @@ public class CaseVideoFolderController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody CaseVideoFolder param){
         if(param.getVideoFolderId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseVideoFolderService.delete(param.getVideoFolderId());
         return ResultData.ok();

+ 3 - 3
src/main/java/com/fdkankan/fusion/controller/CaseViewController.java

@@ -1,9 +1,9 @@
 package com.fdkankan.fusion.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.CaseView;
 import com.fdkankan.fusion.service.ICaseViewService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -48,7 +48,7 @@ public class CaseViewController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody CaseView caseView){
         if(caseView.getViewId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseViewService.removeById(caseView.getViewId());
         return ResultData.ok();

+ 5 - 5
src/main/java/com/fdkankan/fusion/controller/FusionGuideController.java

@@ -2,8 +2,8 @@ package com.fdkankan.fusion.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.FusionGuide;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.service.IFusionGuideService;
@@ -29,7 +29,7 @@ public class FusionGuideController {
     @GetMapping("/allList")
     public ResultData allList(@RequestParam(required = false) Integer fusionId){
         if(fusionId == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         return ResultData.ok(fusionGuideService.getAllList(fusionId));
     }
@@ -42,7 +42,7 @@ public class FusionGuideController {
     public ResultData update(@RequestBody FusionGuide fusionGuide){
         if(fusionGuide.getFusionGuideId() == null ||
                 (fusionGuide.getSort() == null && StringUtils.isEmpty(fusionGuide.getTitle()) && StringUtils.isEmpty(fusionGuide.getCover())  )){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<FusionGuide> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(FusionGuide::getFusionGuideId,fusionGuide.getFusionGuideId());
@@ -62,7 +62,7 @@ public class FusionGuideController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody FusionGuide fusionGuide){
         if(fusionGuide.getFusionGuideId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         fusionGuideService.removeById(fusionGuide.getFusionGuideId());
         return ResultData.ok();

+ 4 - 4
src/main/java/com/fdkankan/fusion/controller/FusionGuidePathController.java

@@ -2,8 +2,8 @@ package com.fdkankan.fusion.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.FusionGuide;
 import com.fdkankan.fusion.entity.FusionGuidePath;
 import com.fdkankan.fusion.exception.BusinessException;
@@ -42,7 +42,7 @@ public class FusionGuidePathController {
     public ResultData update(@RequestBody FusionGuidePath fusionGuidePath){
         if(fusionGuidePath.getGuidePathId() == null ||
                 (fusionGuidePath.getSort() == null && StringUtils.isEmpty(fusionGuidePath.getCover())) ){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<FusionGuidePath> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(FusionGuidePath::getGuidePathId,fusionGuidePath.getGuidePathId());
@@ -60,7 +60,7 @@ public class FusionGuidePathController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody FusionGuidePath fusionGuidePath){
         if(fusionGuidePath.getGuidePathId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         fusionGuidePathService.removeById(fusionGuidePath.getGuidePathId());
         return ResultData.ok();

+ 6 - 6
src/main/java/com/fdkankan/fusion/controller/FusionMeterController.java

@@ -2,8 +2,8 @@ package com.fdkankan.fusion.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.FusionMeter;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.service.IFusionMeterService;
@@ -30,7 +30,7 @@ public class FusionMeterController {
     public ResultData allList(@RequestParam(required = false) Integer fusionId,
                               @RequestParam(required = false) String meterTitle){
         if(fusionId == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         return ResultData.ok(fusionMeterService.getListByFusionId(fusionId,meterTitle));
     }
@@ -44,7 +44,7 @@ public class FusionMeterController {
     @PostMapping("/updateMeterTitle")
     public ResultData updateMeterTitle(@RequestBody FusionMeter fusionMeter){
         if(fusionMeter.getFusionMeterId() == null || StringUtils.isEmpty(fusionMeter.getMeterTitle())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<FusionMeter> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(FusionMeter::getFusionMeterId,fusionMeter.getFusionMeterId())
@@ -55,7 +55,7 @@ public class FusionMeterController {
     @PostMapping("/hide")
     public ResultData hide( @RequestBody FusionMeter fusionMeter){
         if((fusionMeter.getFusionMeterId() == null&& fusionMeter.getFusionId()== null) || fusionMeter.getHide()== null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<FusionMeter> wrapper = new LambdaUpdateWrapper<>();
         if(fusionMeter.getFusionId()!=null){
@@ -72,7 +72,7 @@ public class FusionMeterController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody FusionMeter fusionMeter){
         if(fusionMeter.getFusionMeterId() == null ){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         fusionMeterService.removeById(fusionMeter.getFusionMeterId());
         return ResultData.ok();

+ 5 - 5
src/main/java/com/fdkankan/fusion/controller/HotIconController.java

@@ -1,10 +1,10 @@
 package com.fdkankan.fusion.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.util.JwtUtil;
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.common.response.ResultData;
-import com.fdkankan.common.util.JwtUtil;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.HotIcon;
 import com.fdkankan.fusion.service.ICaseTagService;
 import com.fdkankan.fusion.service.IHotIconService;
@@ -51,7 +51,7 @@ public class HotIconController {
         hotIcon.setIconUrl(iconUrl);
         hotIcon.setUserName(username);
         if(StringUtils.isEmpty(hotIcon.getIconUrl())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         //取消用户之前新增标记
         hotIconService.cancelIsNew(username);
@@ -67,7 +67,7 @@ public class HotIconController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody HotIcon hotIcon){
         if(hotIcon.getIconId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseTagService.updateDFHotIcon(hotIcon.getIconId());
         hotIconService.removeById(hotIcon.getIconId());

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/LoginController.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.controller;
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.httpClient.client.FdKKClient;
 import com.fdkankan.fusion.httpClient.request.FdkkLoginRequest;
 import com.fdkankan.fusion.httpClient.response.FdkkLoginVo;

+ 4 - 4
src/main/java/com/fdkankan/fusion/controller/ModelController.java

@@ -1,9 +1,9 @@
 package com.fdkankan.fusion.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.response.ResultData;
-import com.fdkankan.common.util.JwtUtil;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.ResultData;
+import com.fdkankan.fusion.common.util.JwtUtil;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.entity.Model;
 import com.fdkankan.fusion.exception.BusinessException;
@@ -48,7 +48,7 @@ public class ModelController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody ModelPram param,@RequestHeader String token){
         if(param.getModelId() == null){
-            throw  new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw  new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         modelService.delete(param.getModelId());
         return ResultData.ok();

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/SceneController.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.controller;
 
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.request.ScenePram;
 import com.fdkankan.fusion.service.ISceneService;
 import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 1
src/main/java/com/fdkankan/fusion/controller/TestController.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.controller;
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.httpClient.client.FdKKClient;
 import com.fdkankan.fusion.httpClient.client.LaserClient;
 import com.fdkankan.fusion.httpClient.client.OverallClient;

+ 2 - 3
src/main/java/com/fdkankan/fusion/controller/UploadController.java

@@ -1,11 +1,10 @@
 package com.fdkankan.fusion.controller;
 
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.service.impl.UploadService;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;

+ 1 - 5
src/main/java/com/fdkankan/fusion/exception/BusinessException.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.exception;
 
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultCode;
 import lombok.Data;
 
@@ -16,10 +16,6 @@ public class BusinessException extends RuntimeException {
         this.code = code;
         this.message = msg;
     }
-    public BusinessException(ErrorCode errorCode) {
-        this.code = errorCode.code();
-        this.message = errorCode.message();
-    }
     public BusinessException(ResultCode errorCode) {
         this.code = errorCode.code;
         this.message = errorCode.msg;

+ 1 - 1
src/main/java/com/fdkankan/fusion/exception/GlobalExceptionHandler.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.exception;
 
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.ResponseBody;

+ 1 - 1
src/main/java/com/fdkankan/fusion/httpClient/client/FdKKClient.java

@@ -2,7 +2,7 @@ package com.fdkankan.fusion.httpClient.client;
 
 import com.alibaba.fastjson.JSONObject;
 import com.dtflys.forest.annotation.*;
-import com.fdkankan.common.response.PageInfo;
+import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.httpClient.address.FdkkAddressSource;
 import com.fdkankan.fusion.httpClient.request.FdkkLoginRequest;
 import com.fdkankan.fusion.httpClient.response.FdkkLoginVo;

+ 3 - 3
src/main/java/com/fdkankan/fusion/interceptor/TokenInterceptor.java

@@ -2,8 +2,8 @@ package com.fdkankan.fusion.interceptor;
 
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.redis.util.RedisUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -46,7 +46,7 @@ public class TokenInterceptor implements HandlerInterceptor {
 
 	private void needLogin(HttpServletRequest request, HttpServletResponse response) {
 		try {
-			String result = JSONObject.toJSONString(ResultData.error(ErrorCode.USER_NOT_LOGIN));
+			String result = JSONObject.toJSONString(ResultData.error(ResultCode.USER_NOT_LOGIN));
 			response.getWriter().append(result);
 		} catch (IOException e) {
 			log.info("LoginInterceptor|needLogin|IOException|" + e);

+ 1 - 1
src/main/java/com/fdkankan/fusion/request/CaseParam.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.request;
 
-import com.fdkankan.common.request.RequestBase;
+import com.fdkankan.fusion.common.RequestBase;
 import lombok.Data;
 
 import java.util.HashMap;

+ 1 - 1
src/main/java/com/fdkankan/fusion/request/ModelPram.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.request;
 
-import com.fdkankan.common.request.RequestBase;
+import com.fdkankan.fusion.common.RequestBase;
 import lombok.Data;
 
 import java.util.List;

+ 1 - 1
src/main/java/com/fdkankan/fusion/request/ScenePram.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.request;
 
-import com.fdkankan.common.request.RequestBase;
+import com.fdkankan.fusion.common.RequestBase;
 import lombok.Data;
 
 import java.util.List;

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/ICaseService.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service;
 
-import com.fdkankan.common.response.PageInfo;
+import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.entity.CaseEntity;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.fusion.request.CaseParam;

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/IModelService.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service;
 
-import com.fdkankan.common.response.PageInfo;
+import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.entity.Model;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.fusion.request.ModelPram;

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/ISceneService.java

@@ -1,6 +1,6 @@
 package com.fdkankan.fusion.service;
 
-import com.fdkankan.common.response.PageInfo;
+import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.request.ScenePram;
 
 public interface ISceneService {

+ 3 - 3
src/main/java/com/fdkankan/fusion/service/impl/CaseFilesServiceImpl.java

@@ -1,9 +1,9 @@
 package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.CaseFiles;
 import com.fdkankan.fusion.mapper.ICaseFilesMapper;
 import com.fdkankan.fusion.service.ICaseFilesService;
@@ -26,7 +26,7 @@ public class CaseFilesServiceImpl extends ServiceImpl<ICaseFilesMapper, CaseFile
     @Override
     public List<CaseFiles> allList(Integer caseId, Integer caseFilesTypeId) {
         if(caseId == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaQueryWrapper<CaseFiles> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(CaseFiles::getCaseId,caseId);

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java

@@ -3,6 +3,7 @@ package com.fdkankan.fusion.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.util.OBJToGLBUtil;
+import com.fdkankan.fusion.common.util.UploadToOssUtil;
 import com.fdkankan.fusion.entity.CaseNumEntity;
 import com.fdkankan.fusion.entity.Model;
 import com.fdkankan.fusion.mapper.ICaseNumMapper;
@@ -10,7 +11,6 @@ import com.fdkankan.fusion.request.SceneNumParam;
 import com.fdkankan.fusion.service.ICaseNumService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.fusion.service.IModelService;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;

+ 8 - 8
src/main/java/com/fdkankan/fusion/service/impl/CaseServiceImpl.java

@@ -2,11 +2,11 @@ package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.entity.Model;
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.common.response.PageInfo;
-import com.fdkankan.common.util.JwtUtil;
+import com.fdkankan.fusion.common.PageInfo;
+import com.fdkankan.fusion.common.util.JwtUtil;
 import com.fdkankan.fusion.entity.CaseEntity;
 import com.fdkankan.fusion.mapper.ICaseMapper;
 import com.fdkankan.fusion.request.CaseParam;
@@ -64,7 +64,7 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
     @Override
     public List<SceneVo> sceneList(CaseParam param, String token) {
         if(param.getCaseId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         if(param.getTypeMap() == null){
             HashMap<Integer, List<String>> typeMap = caseNumService.getTypeMap(param.getCaseId());
@@ -110,7 +110,7 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
     public void addOrUpdate(CaseParam param, String token) {
         String userName = JwtUtil.getUsername(token);
         if(StringUtils.isEmpty(param.getCaseTitle())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         CaseEntity caseEntity ;
         if(param.getCaseId() == null){
@@ -127,11 +127,11 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
     @Override
     public void addScene(CaseParam param) {
         if(param.getCaseId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         CaseEntity caseEntity = this.getById(param.getCaseId());
         if(caseEntity == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseNumService.addBatch(param.getCaseId(),param.getSceneNumParam());
     }
@@ -139,7 +139,7 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, CaseEntity> implem
     @Override
     public void delete(Integer caseId) {
         if(caseId == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         //删除关联的场景
         caseNumService.deleteByCaseId(caseId);

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/impl/CaseTagPointServiceImpl.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.entity.CaseTag;
 import com.fdkankan.fusion.entity.CaseTagPoint;
 import com.fdkankan.fusion.exception.BusinessException;
@@ -45,7 +45,7 @@ public class CaseTagPointServiceImpl extends ServiceImpl<ICaseTagPointMapper, Ca
     @Override
     public void place(CaseTagPoint caseTagPoint) {
         if(caseTagPoint.getTagId() == null || StringUtils.isEmpty(caseTagPoint.getTagPoint())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         if(StringUtils.isEmpty(caseTagPoint.getTagPointTitle())){
             Long count = this.getCountByTagId(caseTagPoint.getTagId());

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/impl/CaseTagServiceImpl.java

@@ -2,7 +2,7 @@ package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.entity.CaseTag;
 import com.fdkankan.fusion.entity.CaseTagPoint;
 import com.fdkankan.fusion.entity.HotIcon;

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/impl/CaseVideoFolderServiceImpl.java

@@ -1,13 +1,13 @@
 package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.fusion.common.util.UploadToOssUtil;
 import com.fdkankan.fusion.entity.CaseVideo;
 import com.fdkankan.fusion.entity.CaseVideoFolder;
 import com.fdkankan.fusion.mapper.ICaseVideoFolderMapper;
 import com.fdkankan.fusion.service.ICaseVideoFolderService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.fusion.service.ICaseVideoService;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;

+ 4 - 4
src/main/java/com/fdkankan/fusion/service/impl/CaseVideoServiceImpl.java

@@ -3,9 +3,10 @@ package com.fdkankan.fusion.service.impl;
 import cn.hutool.core.io.FileUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.util.UploadToOssUtil;
 import com.fdkankan.fusion.common.util.VideoUtil;
 import com.fdkankan.fusion.entity.CaseEntity;
 import com.fdkankan.fusion.entity.CaseVideoFolder;
@@ -18,7 +19,6 @@ import com.fdkankan.fusion.service.ICaseService;
 import com.fdkankan.fusion.service.ICaseVideoFolderService;
 import com.fdkankan.fusion.service.ICaseVideoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -59,7 +59,7 @@ public class CaseVideoServiceImpl extends ServiceImpl<ICaseVideoMapper, CaseVide
     @Override
     public List<CaseVideo> getAllList(Integer folderId) {
         if(folderId == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         QueryWrapper<CaseVideo> wrapper = new QueryWrapper<>();
         wrapper.lambda().eq(CaseVideo::getFolderId,folderId);
@@ -71,7 +71,7 @@ public class CaseVideoServiceImpl extends ServiceImpl<ICaseVideoMapper, CaseVide
     @Override
     public void uploadAddVideo(MultipartFile[] files, Integer folderId,Integer caseId) throws IOException {
         if(files.length <=0 || caseId == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         CaseEntity caseEntity = caseService.getById(caseId);
         if(caseEntity == null){

+ 4 - 4
src/main/java/com/fdkankan/fusion/service/impl/CaseViewServiceImpl.java

@@ -2,7 +2,7 @@ package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.entity.CaseView;
 import com.fdkankan.fusion.mapper.ICaseViewMapper;
@@ -31,7 +31,7 @@ public class CaseViewServiceImpl extends ServiceImpl<ICaseViewMapper, CaseView>
     @Override
     public List<CaseView> allList(Integer caseId, String num,String smallImgH, String smallImgW){
         if(caseId == null && StringUtils.isEmpty(num)){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaQueryWrapper<CaseView> wrapper = new LambdaQueryWrapper<>();
         if(caseId != null){
@@ -52,7 +52,7 @@ public class CaseViewServiceImpl extends ServiceImpl<ICaseViewMapper, CaseView>
         if(caseView.getCaseId() == null || StringUtils.isEmpty(caseView.getNum()) || StringUtils.isEmpty(caseView.getNumThumb())
             || caseView.getNumType() == null || StringUtils.isEmpty(caseView.getViewImg()) || StringUtils.isEmpty(caseView.getViewTitle())
             || StringUtils.isEmpty(caseView.getViewPoint())) {
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         String ImageSmall = caseView.getViewImg() +small;
         caseView.setViewImgSmall(ImageSmall);
@@ -62,7 +62,7 @@ public class CaseViewServiceImpl extends ServiceImpl<ICaseViewMapper, CaseView>
     @Override
     public void updateNameOrSort(CaseView caseView) {
         if(caseView.getViewId() == null || (caseView.getSort() == null && StringUtils.isEmpty(caseView.getViewTitle()))) {
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<CaseView> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper.eq(CaseView::getViewId,caseView.getViewId());

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/impl/FdHotService.java

@@ -5,13 +5,13 @@ import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.fusion.common.FilePath;
+import com.fdkankan.fusion.common.util.UploadToOssUtil;
 import com.fdkankan.fusion.laser.entity.PoiEntity;
 import com.fdkankan.fusion.laser.entity.PoiHotDto;
 import com.fdkankan.fusion.laser.entity.PoiTypeEntity;
 import com.fdkankan.fusion.laser.service.PoiService;
 import com.fdkankan.fusion.laser.service.PoiTypeService;
 import com.fdkankan.fusion.response.HotVo;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

+ 3 - 3
src/main/java/com/fdkankan/fusion/service/impl/FusionGuidePathServiceImpl.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.entity.FusionGuidePath;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.mapper.IFusionGuidePathMapper;
@@ -26,7 +26,7 @@ public class FusionGuidePathServiceImpl extends ServiceImpl<IFusionGuidePathMapp
     @Override
     public List<FusionGuidePath> getListByGuideId(Integer guideId) {
         if(guideId == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaQueryWrapper<FusionGuidePath> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(FusionGuidePath::getGuideId,guideId);
@@ -39,7 +39,7 @@ public class FusionGuidePathServiceImpl extends ServiceImpl<IFusionGuidePathMapp
     public FusionGuidePath  add(FusionGuidePath fusionGuidePath) {
         if(fusionGuidePath.getGuideId() == null || StringUtils.isEmpty(fusionGuidePath.getPosition())
                 || StringUtils.isEmpty(fusionGuidePath.getCover()) || StringUtils.isEmpty(fusionGuidePath.getTarget())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaQueryWrapper<FusionGuidePath> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(FusionGuidePath::getGuideId,fusionGuidePath.getGuideId());

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/impl/FusionGuideServiceImpl.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.entity.FusionGuide;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.mapper.IFusionGuideMapper;
@@ -43,7 +43,7 @@ public class FusionGuideServiceImpl extends ServiceImpl<IFusionGuideMapper, Fusi
     public FusionGuide add(FusionGuide fusionGuide) {
         if(fusionGuide.getFusionId() == null || StringUtils.isEmpty(fusionGuide.getTitle())
             || StringUtils.isEmpty(fusionGuide.getCover())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         Long count = this.getCountByFusionId(fusionGuide.getFusionId());
         fusionGuide.setSort(count + 1);

+ 2 - 2
src/main/java/com/fdkankan/fusion/service/impl/FusionMeterServiceImpl.java

@@ -1,7 +1,7 @@
 package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.entity.FusionMeter;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.mapper.IFusionMeterMapper;
@@ -37,7 +37,7 @@ public class FusionMeterServiceImpl extends ServiceImpl<IFusionMeterMapper, Fusi
     public void add(FusionMeter fusionMeter) {
         if(fusionMeter.getFusionId() == null || fusionMeter.getLength() == null
                 || fusionMeter.getMeterType() == null || StringUtils.isEmpty(fusionMeter.getPosition())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         String meterTitle = "总长度";
         if(fusionMeter.getMeterType() == 2){

+ 3 - 3
src/main/java/com/fdkankan/fusion/service/impl/FusionNumServiceImpl.java

@@ -3,7 +3,7 @@ package com.fdkankan.fusion.service.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.entity.CaseFusion;
 import com.fdkankan.fusion.entity.FusionNum;
 import com.fdkankan.fusion.entity.Model;
@@ -110,7 +110,7 @@ public class FusionNumServiceImpl extends ServiceImpl<IFusionNumMapper, FusionNu
     @Override
     public void add(FusionParam param) {
         if(param.getModelId()==null || param.getCaseId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         List<CaseFusion> list = caseFusionService.getListByCaseId(param.getCaseId());
         CaseFusion caseFusion = null;
@@ -133,7 +133,7 @@ public class FusionNumServiceImpl extends ServiceImpl<IFusionNumMapper, FusionNu
     @Override
     public void updateModel(FusionParam param) {
         if(param.getFusionNumId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<FusionNum> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(FusionNum::getFusionNumId,param.getFusionNumId());

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/impl/HotIconServiceImpl.java

@@ -2,7 +2,7 @@ package com.fdkankan.fusion.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.entity.HotIcon;

+ 7 - 7
src/main/java/com/fdkankan/fusion/service/impl/ModelServiceImpl.java

@@ -7,12 +7,13 @@ import java.util.List;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fdkankan.common.response.PageInfo;
-import com.fdkankan.common.util.CreateObjUtil;
-import com.fdkankan.common.util.JwtUtil;
+import com.fdkankan.fusion.common.PageInfo;
+import com.fdkankan.fusion.common.util.JwtUtil;
 import com.fdkankan.fusion.common.FilePath;
 import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.util.OBJToGLBUtil;
+import com.fdkankan.fusion.common.util.ShellUtil;
+import com.fdkankan.fusion.common.util.UploadToOssUtil;
 import com.fdkankan.fusion.entity.CaseNumEntity;
 import com.fdkankan.fusion.entity.FusionNum;
 import com.fdkankan.fusion.entity.Model;
@@ -24,9 +25,8 @@ import com.fdkankan.fusion.service.ICaseNumService;
 import com.fdkankan.fusion.service.IFusionNumService;
 import com.fdkankan.fusion.service.IModelService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
+import jdk.nashorn.tools.Shell;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.tools.zip.ZipFile;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -97,10 +97,10 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
             }
             file.transferTo(newObjFile);
             if(fileName.toLowerCase().contains("zip")){
-                CreateObjUtil.unZip(newObjFile.getPath(),objPath);
+                ShellUtil.unZip(newObjFile.getPath(),objPath);
             }
             if(fileName.toLowerCase().contains("rar")){
-                CreateObjUtil.unRar(newObjFile.getPath(),objPath);
+                ShellUtil.unRar(newObjFile.getPath(),objPath);
             }
 
             OBJToGLBUtil.objToGlb(objPath+"/"+modelName,glbPath);

+ 3 - 3
src/main/java/com/fdkankan/fusion/service/impl/SceneService.java

@@ -3,9 +3,9 @@ package com.fdkankan.fusion.service.impl;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.common.response.PageInfo;
+import com.fdkankan.fusion.common.PageInfo;
 import com.fdkankan.fusion.httpClient.client.FdKKClient;
 import com.fdkankan.fusion.httpClient.client.FdKKNewClient;
 import com.fdkankan.fusion.httpClient.client.LaserClient;
@@ -37,7 +37,7 @@ public class SceneService implements ISceneService {
     @Override
     public PageInfo pageList(ScenePram param, String token) {
         if(param.getType() == null){
-           throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+           throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         List<SceneVo> sceneVoList = new ArrayList<>();
         long total = 0;

+ 1 - 1
src/main/java/com/fdkankan/fusion/service/impl/UploadService.java

@@ -1,8 +1,8 @@
 package com.fdkankan.fusion.service.impl;
 
 import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.common.util.UploadToOssUtil;
 import com.fdkankan.fusion.exception.BusinessException;
-import com.fdkankan.fyun.oss.UploadToOssUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;