lcl 1 year ago
parent
commit
ba4707c812

BIN
src/main/java/com/ym/adminap/.DS_Store


+ 9 - 3
src/main/java/com/ym/adminap/controller/DesController.java

@@ -2,10 +2,13 @@ package com.ym.adminap.controller;
 
 import java.net.URLEncoder;
 
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.ym.adminap.util.DesUtil;
+import com.ym.adminap.util.HttpRestUtils;
 
 
 @RestController
@@ -35,10 +38,13 @@ public class DesController {
 		// String value = DesUtil.decrypt("yfYokORyAWCPn0wPy3rTmPjTLxD2JGBo3I7i0nyUL+bbRgCu9Y7j5gq4N9ho pq+VkPkvw1yn9FZTpqyJ+4c7lScJbEIZCj0+mevk/l8Zugakouy72fKZ3bgi eZoz+UpV1UQ2TyW6//sU0tIZ17tggOteXxVSfeEJ7ltEd+Tyn/Uj2hYW5DOj 5Hx00wpx77FnNPXZVL4t2owsabtt8KbTQA==");
 
 		String value = DesUtil.encrypt("{\"UserId\":\"5436\",\"Balance\":\"0.05\",\"NoticeUrl\":\"https://weixintest.electrifiedpanda.com:8030/trans/paynotify4\",\"OrderNo\":\"11000000000002202307261004285640\"}");
+		value = URLEncoder.encode(value);
 
-		String encode = URLEncoder.encode(value);
-		value += "<br />" + encode;
+		String content = "";
+		MultiValueMap<String, String> param = new LinkedMultiValueMap<String, String>();
+		param.add("value", value);
+		content = HttpRestUtils.post("https://ap.yunmic.com/api/v1/users/usebalance", param);
 		
-		return value;
+		return content;
 	}
 }

+ 0 - 1
src/main/java/com/ym/adminap/util/HttpRestUtils.java

@@ -3,7 +3,6 @@ package com.ym.adminap.util;
 import org.springframework.http.*;
 import org.springframework.http.client.SimpleClientHttpRequestFactory;
 import org.springframework.util.MultiValueMap;
-import org.springframework.web.client.HttpClientErrorException;
 import org.springframework.web.client.RestTemplate;
 
 public class HttpRestUtils {