yujian
2020-05-09 7e7db2fa55a9a3af46d4fd8ede0dee147f101d64
fanli/src/main/java/com/yeshi/fanli/controller/admin/UploadController.java
@@ -27,6 +27,8 @@
import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
import com.yeshi.fanli.util.CMQManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.FilePathEnum;
import com.yeshi.fanli.util.RedisKeyEnum;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
@@ -73,7 +75,7 @@
         String contentType = file.getContentType();
         String type = contentType.substring(contentType.indexOf("/") + 1);
         String uploadFilePath = COSManager.getInstance()
               .uploadFile(inputStream, UUID.randomUUID().toString().replace("-", "") + "." + type).getUrl();
               .uploadFile(inputStream, FilePathEnum.section.getPath() + UUID.randomUUID().toString().replace("-", "") + "." + type).getUrl();
         out.print(JsonUtil.loadTrueResult(uploadFilePath));
      } catch (IOException e) {
         e.printStackTrace();
@@ -96,7 +98,7 @@
         String contentType = file.getContentType();
         String type = contentType.substring(contentType.indexOf("/") + 1);
         String uploadFilePath = COSManager.getInstance()
               .uploadFile(inputStream, UUID.randomUUID().toString().replace("-", "") + "." + type + ".apk")
               .uploadFile(inputStream, FilePathEnum.apk.getPath() + UUID.randomUUID().toString().replace("-", "") + "." + type + ".apk")
               .getUrl();
         out.print(JsonUtil.loadTrueResult(uploadFilePath));
      } catch (Exception e) {
@@ -114,7 +116,7 @@
         String contentType = file.getContentType();
         String type = contentType.substring(contentType.indexOf("/") + 1);
         String uploadFilePath = COSManager.getInstance()
               .uploadFile(inputStream, "section/" + date + "/" + timeMillis + "." + type).getUrl();
               .uploadFile(inputStream, FilePathEnum.section.getPath() + timeMillis + "." + type).getUrl();
         JSONObject data = new JSONObject();
         data.put("original", file.getOriginalFilename());
         data.put("name", file.getOriginalFilename());
@@ -148,7 +150,7 @@
            while (its.hasNext()) {
               String key = its.next();
               List<TaoBaoOrder> orders = map.get(key);
               String redisKey = "addorderqueue-" + key;
               String redisKey = RedisKeyEnum.getRedisKey(RedisKeyEnum.addOrderQueue, key);
               // redis做频率限制
               if (Constant.IS_OUTNET) {
                  try {
@@ -274,7 +276,7 @@
         String contentType = file.getContentType();
         String type = contentType.substring(contentType.indexOf("/") + 1);
         // 上传文件相对位置
         String fileUrl="/img/admin/" + UUID.randomUUID().toString().replace("-", "") + "." + type;
         String fileUrl=FilePathEnum.section.getPath() + UUID.randomUUID().toString().replace("-", "") + "." + type;
         
         String uploadPath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();
         
@@ -313,7 +315,7 @@
         String type = contentType.substring(contentType.indexOf("/") + 1);
         
         // 上传文件相对位置
         String fileUrl="/apk/admin/" + UUID.randomUUID().toString().replace("-", "") + "." + type + ".apk";
         String fileUrl= FilePathEnum.apk.getPath() + UUID.randomUUID().toString().replace("-", "") + "." + type + ".apk";
         
         String uploadFilePath = COSManager.getInstance().uploadFile(inputStream, fileUrl).getUrl();