From 3cf0d45159f5370dd9e5ce6bb0e882f65edf8c80 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 18 Jun 2019 09:30:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B9=B1=E7=A0=81=E5=92=8C?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/FileEntityBuilder.java | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java index 28d6322c5b..4497a0b28f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java @@ -2,12 +2,9 @@ package com.fr.design.mainframe.messagecollect.entity; import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; -import com.fr.general.CloudCenter; import com.fr.general.CloudClient; import com.fr.general.IOUtils; -import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; -import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; import com.fr.stable.CoreConstants; @@ -22,7 +19,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; -import java.util.HashMap; import java.util.UUID; /** @@ -32,11 +28,7 @@ import java.util.UUID; public class FileEntityBuilder { private static final String FOCUS_POINT_FILE_ROOT_PATH = "FocusPoint"; - private static final String FOCUS_POINT_FILE_UPLOAD_TOPIC = "__fine_intelli_file_upload__"; private static final String FILE_FROM = "design"; - private static final String FOCUS_POINT_FILE_UPLOAD_TYPE = "FocusPoint"; - private static final String FOCUS_POINT_FILE_UPLOAD_URL = CloudCenter.getInstance().acquireUrlByKind("design.feedback"); - private static final String FOCUS_POINT_URL_KEY = "focuspoint"; /** * 文件夹路径 @@ -111,27 +103,6 @@ public class FileEntityBuilder { String uuid = DesignerEnvManager.getEnvManager().getUUID(); String name = StringUtils.isEmpty(bbsUserName) ? uuid : bbsUserName; - client.uploadFile(file, filePath, name, FILE_FROM); - addMessageQueue(filePath, bbsUserName, uuid); - } - - private static void addMessageQueue(String filePath, String userName, String uuid) { - JSONObject uploadInfo = new JSONObject(FOCUS_POINT_FILE_UPLOAD_URL); - String focusPointUrl = uploadInfo.optString(FOCUS_POINT_URL_KEY); - try { - HashMap params = new HashMap<>(); - params.put("topic", FOCUS_POINT_FILE_UPLOAD_TOPIC); - params.put("username", URLEncoder.encode(userName, EncodeConstants.ENCODING_UTF_8)); - params.put("uuid", uuid); - params.put("filepath", filePath); - params.put("timestamp", String.valueOf(System.currentTimeMillis())); - params.put("signature", String.valueOf(CommonUtils.signature())); - params.put("type", FOCUS_POINT_FILE_UPLOAD_TYPE); - if(StringUtils.isNotEmpty(focusPointUrl)){ - HttpToolbox.post(focusPointUrl, params); - } - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + client.uploadFile(file, filePath, URLEncoder.encode(name, EncodeConstants.ENCODING_UTF_8), FILE_FROM); } }