Commit 68c2ff6f authored by 张欣's avatar 张欣

对接企查查接口加分页

parent d8476a84
......@@ -33,13 +33,14 @@ public class QccController {
* @return
*/
@GetMapping("/qiyeSearch")
public ResponseEntity<JSONObject> qiyeSearch(@RequestParam String keyword) throws Exception {
public ResponseEntity<JSONObject> qiyeSearch(@RequestParam String keyword,@RequestParam String pageSize,@RequestParam String pageIndex) throws Exception {
String interfaceUrl = "http://api.qichacha.com/ECIV4/Search";
HttpHead reqHeader = new HttpHead();
String[] autherHeader = QccUtil.RandomAuthentHeader(appkey,seckey);
reqHeader.setHeader("Token", autherHeader[0]);
reqHeader.setHeader("Timespan", autherHeader[1]);
String reqUri = interfaceUrl.concat("?key=").concat(appkey).concat("&keyword=").concat(keyword);
String reqUri = interfaceUrl.concat("?key=").concat(appkey).concat("&keyword=").concat(keyword)
.concat("&pageSize=").concat(pageSize).concat("&pageIndex=").concat(pageIndex);
String resultJson = QccHttpUtil.httpGet(reqUri, reqHeader.getAllHeaders());
JSONObject jObject = JSONObject.parseObject(resultJson);
log.info("企查查企业查询接口返回结果为:"+resultJson);
......@@ -53,13 +54,14 @@ public class QccController {
* @return
*/
@GetMapping("/qiyePartnerInfoQuery")
public ResponseEntity<JSONObject> qiyePartnerInfoQuery(@RequestParam String keyword) throws Exception {
public ResponseEntity<JSONObject> qiyePartnerInfoQuery(@RequestParam String keyword,@RequestParam String pageSize,@RequestParam String pageIndex) throws Exception {
String interfaceUrl = "http://api.qichacha.com/ECIPartner/GetList";
HttpHead reqHeader = new HttpHead();
String[] autherHeader = QccUtil.RandomAuthentHeader(appkey,seckey);
reqHeader.setHeader("Token", autherHeader[0]);
reqHeader.setHeader("Timespan", autherHeader[1]);
String reqUri = interfaceUrl.concat("?key=").concat(appkey).concat("&searchKey=").concat(keyword);
String reqUri = interfaceUrl.concat("?key=").concat(appkey).concat("&searchKey=").concat(keyword)
.concat("&pageSize=").concat(pageSize).concat("&pageIndex=").concat(pageIndex);
String resultJson = QccHttpUtil.httpGet(reqUri, reqHeader.getAllHeaders());
JSONObject jObject = JSONObject.parseObject(resultJson);
log.info("企查查企业股东信息查询接口返回结果为:"+resultJson);
......@@ -75,13 +77,14 @@ public class QccController {
* @return
*/
@GetMapping("/personHisOperCompany")
public ResponseEntity<JSONObject> personHisOperCompany(@RequestParam String searchKey,@RequestParam String personName) throws Exception {
public ResponseEntity<JSONObject> personHisOperCompany(@RequestParam String searchKey,@RequestParam String personName,@RequestParam String pageSize,@RequestParam String pageIndex) throws Exception {
String interfaceUrl = "http://api.qichacha.com/PersonHisOperCompany/GetList";
HttpHead reqHeader = new HttpHead();
String[] autherHeader = QccUtil.RandomAuthentHeader(appkey,seckey);
reqHeader.setHeader("Token", autherHeader[0]);
reqHeader.setHeader("Timespan", autherHeader[1]);
String reqUri = interfaceUrl.concat("?key=").concat(appkey).concat("&searchKey=").concat(searchKey).concat("&personName=").concat(personName);
String reqUri = interfaceUrl.concat("?key=").concat(appkey).concat("&searchKey=").concat(searchKey).concat("&personName=").concat(personName)
.concat("&pageSize=").concat(pageSize).concat("&pageIndex=").concat(pageIndex);
String resultJson = QccHttpUtil.httpGet(reqUri, reqHeader.getAllHeaders());
JSONObject jObject = JSONObject.parseObject(resultJson);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment