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;
|
|
/**
|
* @author zhongrj
|
*
|
* 资格审核测试接口
|
*/
|
@RestController
|
@AllArgsConstructor
|
public class Investigate {
|
|
/**
|
*
|
* @param idCardNo 身份证号码
|
* @return
|
*/
|
@GetMapping("/investigate")
|
public String getInvestigate(String idCardNo){
|
System.out.println("idCardNo = " + idCardNo);
|
return InvestigateUtil.httpGet(idCardNo);
|
}
|
|
/**
|
* 数据反向测试
|
* @param body 数据反向测试
|
* @return
|
*/
|
@PostMapping("/investigate/testBody")
|
public String testBody(@RequestBody String body){
|
JSONObject jsonObject = new JSONObject(body);
|
Object data = jsonObject.get("data");
|
JSONObject jsonData = new JSONObject(data.toString());
|
JSONArray jsonArray = jsonData.getJSONArray("res");
|
if (jsonArray.length()>0){
|
String zdxsfzqkry = jsonArray.getJSONObject(0).get("zdxsfzqkry").toString();
|
return zdxsfzqkry;
|
}
|
return null;
|
}
|
}
|