From 40f16ff7071c793bc02cf3f8ca8c0aa60aa85e21 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 19 七月 2024 09:05:03 +0800
Subject: [PATCH] 提交

---
 server/service/src/main/java/com/doumee/core/utils/Constants.java |   66 +++++++++------------------------
 1 files changed, 18 insertions(+), 48 deletions(-)

diff --git a/server/service/src/main/java/com/doumee/core/utils/Constants.java b/server/service/src/main/java/com/doumee/core/utils/Constants.java
index 7c59e5e..04d4d45 100644
--- a/server/service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -22,6 +22,7 @@
 import org.apache.http.util.EntityUtils;
 
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.math.BigDecimal;
@@ -52,9 +53,6 @@
     public static final String HK_ROOTORG_CODE ="HK_ROOTORG_CODE" ;
     public static final String HK_ROOTORG_NAME ="HK_ROOTORG_NAME" ;
     public static final String REDIS_TOKEN_KEY = "token_";
-    public static final String CUSTOMER = "CUSTOMER";
-    public static final String BUSINESS = "BUSINESS";
-
 
     //琚嫓璁夸汉淇℃伅鏍¢獙鏂瑰紡锛�0鎵嬫満鍙峰崟鐙牎楠� 1鎵嬫満鍙峰拰濮撳悕缁勫悎鏍¢獙锛�
     public static final String ZBOM_CRM_AUTH_API_KEY = "ZBOM_CRM_AUTH_API_KEY";
@@ -333,6 +331,7 @@
     public static final String WEIXIN_DEFAULT_IMGS = "WEIXIN_DEFAULT_IMGS";
     public static final String USER_CARD_DEFAULT_IMG = "USER_CARD_DEFAULT_IMG";
     public static final String USERS_FILE = "USERS_FILE";
+    public static final String SHARES_FILE = "SHARES_FILE";
     public static final String NEWS_FILE = "NEWS_FILE";
     public static final String USER_LABEL = "USER_LABEL";
     //鍙戦�佷細璁紑濮�  瀹氭椂鎻愬墠澶氬皯鍒嗛挓鍙戦��
@@ -365,12 +364,14 @@
 
 
     public static final String WX_MINI_CONFIG = "WX_MINI_CONFIG";
+    public static final String SHARE_HAIBAO_HEADER_TITLE = "SHARE_HAIBAO_HEADER_TITLE";
     public static final String WX_APPID_CUSTOMER = "WX_APPID_CUSTOMER";
     public static final String WX_SECRET_CUSTOMER = "WX_SECRET_CUSTOMER";
     public static final String WX_APPID_PERSONNEL = "WX_APPID_PERSONNEL";
     public static final String WX_SECRET_PERSONNEL = "WX_SECRET_PERSONNEL";
     public static final String WX_TOKEN_CUSTOMER = "WX_TOKEN_CUSTOMER";
     public static final String WX_TOKEN_PERSONNEL = "WX_TOKEN_PERSONNEL";
+    public static final String ZBOM_CRM_POSTCUS_API_KEY  = "ZBOM_CRM_POSTCUS_API_KEY";
 
 
     public interface RedisKeys {
@@ -384,6 +385,8 @@
        String ZBOM_ENCODE_URL ="ZBOM_ENCODE_URL";
        String ZBOM_SMS_API_KEY ="ZBOM_SMS_API_KEY";
        String ZBOM_ZHONGTAI_API_URL ="ZBOM_ZHONGTAI_API_URL";
+       String ZBOM_CRM_POSTCUS_API_KEY ="ZBOM_CRM_POSTCUS_API_KEY";
+       String ZBOM_AREA_REDIS_KEY ="ZBOM_AREA_REDIS_KEY";
        String ZBOM_SMS_API_URL ="ZBOM_SMS_API_URL";
        String IAM_APPKEY ="IAM_APPKEY";
        String SHOP_TREE ="SHOP_TREE";
@@ -686,13 +689,13 @@
     }
 
 
-    public InputStream generateWxMiniImgStream(String accessToken,String scene,String page) {
+    public static InputStream generateWxMiniImgStream(String accessToken,String scene,String page) {
         //鐢熸垚鍥剧墖涓婁紶OSS
         Map<String,Object> body = new HashMap<>();
         // 鍦烘櫙鐮侊紝涓庡墠绔害瀹氾紝鏈�缁堟槸闇�瑕佸墠绔В鏋�
         body.put("scene", scene);
         // 姝e紡鐗堜负 "release"锛屼綋楠岀増涓� "trial"锛屽紑鍙戠増涓� "develop"銆傞粯璁ゆ槸姝e紡鐗堛��
-        body.put("env_version", "release");
+        body.put("env_version", "develop");
         body.put("page", page);
         // 閫忔槑锛屾牴鎹綘鐨勫満鏅嚜琛岃缃産ody鍙傛暟
         body.put("is_hyaline", true);
@@ -705,57 +708,24 @@
             Response response = client.newCall(request).execute();
             if (response.isSuccessful()) {
                 InputStream inputStream = new ByteArrayInputStream(response.body().bytes());
+          /*      ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                    byte[] buffer = new byte[1024];
+                    int len = -1;
+                    while ((len = inputStream.read(buffer)) != -1) {
+                        baos.write(buffer, 0, len);
+                    }
+                System.out.println("data:mediatype;base64," + Base64.getEncoder().encodeToString(baos.toByteArray()));*/
                 return inputStream;
             }
         } catch (Exception e) {
             e.printStackTrace();
         }
-        throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鐢熸垚鍥剧墖澶辫触");
+        return  null;
+//        throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鐢熸垚鍥剧墖澶辫触");
     }
 
 
-    /**
-     * 鍙戦�乬et璇锋眰
-     * @param url 璇锋眰URL
-     * @param param 璇锋眰鍙傛暟 key:value url鎼哄甫鍙傛暟 鎴栬�呮棤鍙傚彲涓嶅~
-     * @return
-     */
-    public static String doGet(String url, Map<String, String> param) {
-        // 鍒涘缓Httpclient瀵硅薄
-        CloseableHttpClient httpclient = HttpClients.createDefault();
-        String resultString = "";
-        CloseableHttpResponse response = null;
-        try {
-            // 鍒涘缓uri
-            URIBuilder builder = new URIBuilder(url);
-            if (param != null) {
-                for (String key : param.keySet()) {
-                    builder.addParameter(key, param.get(key));
-                }
-            }
-            URI uri = builder.build();
-            // 鍒涘缓http GET璇锋眰
-            HttpGet httpGet = new HttpGet(uri);
-            // 鎵ц璇锋眰
-            response = httpclient.execute(httpGet);
-            // 鍒ゆ柇杩斿洖鐘舵�佹槸鍚︿负200
-            if (response.getStatusLine().getStatusCode() == 200) {
-                resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (response != null) {
-                    response.close();
-                }
-                httpclient.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return resultString;
-    }
+
 
 
 

--
Gitblit v1.9.3