魏熙美 6 年之前
父節點
當前提交
eab7e26684

+ 24
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/perproties/DaSuProperties.java 查看文件

@@ -0,0 +1,24 @@
1
+package com.community.huiju.common.perproties;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+import org.springframework.boot.context.properties.ConfigurationProperties;
7
+import org.springframework.stereotype.Component;
8
+
9
+/**
10
+ * 提供给 大苏 的 appid 和 appsecret
11
+ * @author weiximei
12
+ */
13
+@Component
14
+@ConfigurationProperties(prefix = "da-su")
15
+@Data
16
+@AllArgsConstructor
17
+@NoArgsConstructor
18
+public class DaSuProperties {
19
+
20
+    private String appid;
21
+
22
+    private String appSecret;
23
+
24
+}

+ 51
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/sign/DaSuSign.java 查看文件

@@ -0,0 +1,51 @@
1
+package com.community.huiju.common.sign;
2
+
3
+import org.apache.commons.lang3.StringUtils;
4
+
5
+import java.util.HashMap;
6
+import java.util.Map;
7
+import java.util.Set;
8
+
9
+/**
10
+ * 大苏签名校验
11
+ */
12
+public class DaSuSign {
13
+
14
+    /**
15
+     * 校验签名是否相等
16
+     * @param val_1
17
+     * @param val_2
18
+     * @return true 相等  false 不相等
19
+     */
20
+    public boolean isMD5Sign(String val_1, String val_2) {
21
+        return StringUtils.equals(val_1, val_2);
22
+    }
23
+
24
+    /**
25
+     *
26
+     * 创建签名
27
+     *
28
+     * @param appid
29
+     * @param appSecret
30
+     * @param datetime 时间戳
31
+     * @param encrypt 加密方式(目前就 MD5)
32
+     * @param communityid 小区id
33
+     * @return
34
+     */
35
+    public String createSign(String appid, String appSecret, String datetime, String encrypt, String communityid) {
36
+        return null;
37
+    }
38
+
39
+
40
+    public static void main(String[] args) {
41
+        Map<String, Object> map = new HashMap<>();
42
+        map.put("a", "1");
43
+        map.put("d", "4");
44
+        map.put("b", "2");
45
+
46
+        Set<Map.Entry<String, Object>> entries = map.entrySet();
47
+        entries.forEach(e -> System.out.println(e.getKey()));
48
+
49
+    }
50
+
51
+}

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/welcome/OkHttpRequestUtils.java 查看文件

@@ -1,6 +1,6 @@
1 1
 package com.community.huiju.common.welcome;
2 2
 
3
-import com.beust.jcommander.internal.Maps;
3
+import com.google.common.collect.Maps;
4 4
 import okhttp3.*;
5 5
 
6 6
 import java.io.ByteArrayOutputStream;

+ 4
- 1
CODE/smart-community/property-api/src/main/resources/application.yml 查看文件

@@ -37,5 +37,8 @@ fu-shi:
37 37
     xGP2TC4KxH2tAn0=
38 38
   parking-code: 19000100250504 # 停车场编码
39 39
 
40
-
40
+# 大苏
41
+da-su:
42
+  appid: dssdw2576sd997
43
+  app-secret: fgexhd855sf4
41 44