Commit 2393d6a2 authored by 张欣's avatar 张欣

企查查接口更新

parent 2b016e7a
...@@ -6,6 +6,8 @@ import com.mth.requestsecret.util.QccUtil; ...@@ -6,6 +6,8 @@ import com.mth.requestsecret.util.QccUtil;
import org.apache.http.client.methods.HttpHead; import org.apache.http.client.methods.HttpHead;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -30,7 +32,7 @@ public class QccController { ...@@ -30,7 +32,7 @@ public class QccController {
* @return * @return
*/ */
@GetMapping("/qiyeSearch") @GetMapping("/qiyeSearch")
public String qiyeSearch(@RequestParam String keyword) throws Exception { public ResponseEntity<String> qiyeSearch(@RequestParam String keyword) throws Exception {
String interfaceUrl = "http://api.qichacha.com/ECIV4/Search"; String interfaceUrl = "http://api.qichacha.com/ECIV4/Search";
HttpHead reqHeader = new HttpHead(); HttpHead reqHeader = new HttpHead();
String[] autherHeader = QccUtil.RandomAuthentHeader(appkey,seckey); String[] autherHeader = QccUtil.RandomAuthentHeader(appkey,seckey);
...@@ -39,7 +41,7 @@ public class QccController { ...@@ -39,7 +41,7 @@ public class QccController {
String reqUri = interfaceUrl.concat("?key=").concat(appkey).concat("&keyword=").concat(keyword); String reqUri = interfaceUrl.concat("?key=").concat(appkey).concat("&keyword=").concat(keyword);
String resultJson = QccHttpUtil.httpGet(reqUri, reqHeader.getAllHeaders()); String resultJson = QccHttpUtil.httpGet(reqUri, reqHeader.getAllHeaders());
log.info("企查查企业查询接口返回结果为:"+resultJson); log.info("企查查企业查询接口返回结果为:"+resultJson);
return resultJson; return new ResponseEntity<String>(resultJson, HttpStatus.OK);
} }
...@@ -49,7 +51,7 @@ public class QccController { ...@@ -49,7 +51,7 @@ public class QccController {
* @return * @return
*/ */
@GetMapping("/qiyePartnerInfoQuery") @GetMapping("/qiyePartnerInfoQuery")
public String qiyePartnerInfoQuery(@RequestParam String keyword) throws Exception { public ResponseEntity<String> qiyePartnerInfoQuery(@RequestParam String keyword) throws Exception {
String interfaceUrl = "http://api.qichacha.com/ECIPartner/GetList"; String interfaceUrl = "http://api.qichacha.com/ECIPartner/GetList";
HttpHead reqHeader = new HttpHead(); HttpHead reqHeader = new HttpHead();
String[] autherHeader = QccUtil.RandomAuthentHeader(appkey,seckey); String[] autherHeader = QccUtil.RandomAuthentHeader(appkey,seckey);
...@@ -58,7 +60,7 @@ public class QccController { ...@@ -58,7 +60,7 @@ public class QccController {
String reqUri = interfaceUrl.concat("?key=").concat(appkey).concat("&searchKey=").concat(keyword); String reqUri = interfaceUrl.concat("?key=").concat(appkey).concat("&searchKey=").concat(keyword);
String resultJson = QccHttpUtil.httpGet(reqUri, reqHeader.getAllHeaders()); String resultJson = QccHttpUtil.httpGet(reqUri, reqHeader.getAllHeaders());
log.info("企查查企业股东信息查询接口返回结果为:"+resultJson); log.info("企查查企业股东信息查询接口返回结果为:"+resultJson);
return resultJson; return new ResponseEntity<String>(resultJson, HttpStatus.OK);
} }
...@@ -69,7 +71,7 @@ public class QccController { ...@@ -69,7 +71,7 @@ public class QccController {
* @return * @return
*/ */
@GetMapping("/personHisOperCompany") @GetMapping("/personHisOperCompany")
public String personHisOperCompany(@RequestParam String searchKey,@RequestParam String personName) throws Exception { public ResponseEntity<String> personHisOperCompany(@RequestParam String searchKey,@RequestParam String personName) throws Exception {
String interfaceUrl = "http://api.qichacha.com/PersonHisOperCompany/GetList"; String interfaceUrl = "http://api.qichacha.com/PersonHisOperCompany/GetList";
HttpHead reqHeader = new HttpHead(); HttpHead reqHeader = new HttpHead();
String[] autherHeader = QccUtil.RandomAuthentHeader(appkey,seckey); String[] autherHeader = QccUtil.RandomAuthentHeader(appkey,seckey);
...@@ -78,7 +80,7 @@ public class QccController { ...@@ -78,7 +80,7 @@ public class QccController {
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);
String resultJson = QccHttpUtil.httpGet(reqUri, reqHeader.getAllHeaders()); String resultJson = QccHttpUtil.httpGet(reqUri, reqHeader.getAllHeaders());
log.info("个人历史担任法人企业查询接口返回结果为:"+resultJson); log.info("个人历史担任法人企业查询接口返回结果为:"+resultJson);
return resultJson; return new ResponseEntity<String>(resultJson, HttpStatus.OK);
} }
......
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