From 645c16466ce9dbe563c03943b0ab5fd46c8eed00 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期一, 29 六月 2020 16:40:33 +0800
Subject: [PATCH] 免单券类型获得
---
fanli/src/main/java/com/yeshi/fanli/controller/admin/UploadController.java | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/UploadController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/UploadController.java
index 9c12447..49caef7 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/UploadController.java
+++ b/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();
--
Gitblit v1.8.0