新增/private/request.do接口可以设置request.do的返回值

This commit is contained in:
yutou 2021-01-04 14:06:16 +08:00
parent cfb36dd830
commit 24a214489b
2 changed files with 40 additions and 8 deletions

View File

@ -9,7 +9,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ToolsApplication {
public static final String version="1.0.14.1";
public static final String version="1.0.14.2";
public static void main(String[] args) {
System.out.println("当前版本号:"+version);

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yutou.tools.ToolsApplication;
import com.yutou.tools.utils.QQBotManager;
import com.yutou.tools.utils.RedisTools;
import com.yutou.tools.utils.Tools;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -80,6 +81,37 @@ public class tools {
json.put("cookie", cookies);
json.put("header", header);
Tools.sendServer("打印请求", json.toJSONString());
try {
switch (RedisTools.get("request")){
case "success":
return "success";
case "-999":
case "param":
return json.toJSONString();
case "user":
return RedisTools.get("request");
}
}catch (Exception e){
e.printStackTrace();
}
return json.toJSONString();
}
@ResponseBody
@RequestMapping("/private/request.do")
public String setRequest(String ret, String data) {
switch (ret) {
case "success":
RedisTools.set("request", "success");
break;
case "user":
RedisTools.set("request", data);
break;
default:
RedisTools.set("request", "param");
break;
}
return RedisTools.get("request");
}
}