| | |
| | | package org.springblade.modules.investigate; |
| | | |
| | | import com.alibaba.druid.support.json.JSONUtils; |
| | | import lombok.AllArgsConstructor; |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | import org.springblade.common.utils.InvestigateUtil; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | |
| | | System.out.println("idCardNo = " + idCardNo); |
| | | return InvestigateUtil.httpGet(idCardNo); |
| | | } |
| | | |
| | | /** |
| | | * 数据反向测试 |
| | | * @param body 数据反向测试 |
| | | * @return |
| | | */ |
| | | @PostMapping("/investigate/testBody") |
| | | public String testBody(@RequestBody String body){ |
| | | System.out.println("body = " + body); |
| | | JSONObject jsonObject = new JSONObject(body); |
| | | Object data = jsonObject.get("data"); |
| | | System.out.println("data = " + data.toString()); |
| | | JSONObject jsonData = new JSONObject(data.toString()); |
| | | Object res = jsonData.get("res"); |
| | | System.out.println("res = " + res); |
| | | JSONArray jsonArray = jsonData.getJSONArray("res"); |
| | | System.out.println("jsonArray = " + jsonArray); |
| | | System.out.println("jsonArray.length() = " + jsonArray.length()); |
| | | if (jsonArray.length()>0){ |
| | | String zdxsfzqkry = jsonArray.getJSONObject(0).get("zdxsfzqkry").toString(); |
| | | return zdxsfzqkry; |
| | | } |
| | | return null; |
| | | } |
| | | } |