diff --git a/src/main/java/com/yutou/qqbot/Controllers/AppController.java b/src/main/java/com/yutou/qqbot/Controllers/AppController.java index 9e0a905..e688e0e 100644 --- a/src/main/java/com/yutou/qqbot/Controllers/AppController.java +++ b/src/main/java/com/yutou/qqbot/Controllers/AppController.java @@ -6,6 +6,7 @@ import com.yutou.qqbot.utlis.AppTools; import com.yutou.qqbot.utlis.HttpTools; import com.yutou.qqbot.utlis.RedisTools; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -54,7 +55,7 @@ public class AppController { @ResponseBody @RequestMapping("/qq/send.do") - public String sendQQ(JSONObject json) { + public String sendQQ(@RequestBody JSONObject json) { File image = null; String ret; if (json.containsKey("image")) { diff --git a/src/main/java/com/yutou/qqbot/QQBotApplication.java b/src/main/java/com/yutou/qqbot/QQBotApplication.java index eddd543..000a8a1 100644 --- a/src/main/java/com/yutou/qqbot/QQBotApplication.java +++ b/src/main/java/com/yutou/qqbot/QQBotApplication.java @@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class QQBotApplication { - public static final String version="QQBot v.1.2.7.1"; + public static final String version="QQBot v.1.2.7.2"; public static void main(String[] args) { System.out.println("version = " + version); SpringApplication.run(QQBotApplication.class, args); diff --git a/src/main/java/com/yutou/qqbot/utlis/XiaoMiRouter.java b/src/main/java/com/yutou/qqbot/utlis/XiaoMiRouter.java index ede0045..e106876 100644 --- a/src/main/java/com/yutou/qqbot/utlis/XiaoMiRouter.java +++ b/src/main/java/com/yutou/qqbot/utlis/XiaoMiRouter.java @@ -4,9 +4,6 @@ import com.alibaba.fastjson.JSONObject; import org.apache.commons.codec.digest.DigestUtils; import java.nio.charset.StandardCharsets; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; public class XiaoMiRouter { private final static String key = "a2ffa5c9be07488bbb04a3a47d3c5f6a"; @@ -44,6 +41,8 @@ public class XiaoMiRouter { } public static void main(String[] args) { - + String url = XiaoMiRouter.getDeviceListUrl(); + JSONObject json = JSONObject.parseObject(HttpTools.get(url)); + System.out.println("json = " + json); } }