智慧保安后台管理项目备份
Administrator
2021-08-14 2ad27a5a23c354b22b81f3d151faaef88c98686b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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;
    }
}