添加一套连线客api

This commit is contained in:
huahua
2024-07-24 15:35:03 +08:00
parent f20b0a722a
commit f425ce9487

View File

@@ -6,6 +6,7 @@ import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.zbkj.common.config.properties.SmsProperties; import com.zbkj.common.config.properties.SmsProperties;
import com.zbkj.common.constants.LxkOpenApiConstant; import com.zbkj.common.constants.LxkOpenApiConstant;
import com.zbkj.common.constants.SysConfigConstants;
import com.zbkj.common.model.lxkopenapi.*; import com.zbkj.common.model.lxkopenapi.*;
import com.zbkj.common.response.lxkopenapi.Idcard.IdCardResult; import com.zbkj.common.response.lxkopenapi.Idcard.IdCardResult;
import com.zbkj.common.response.lxkopenapi.express.QueryExpressResult; import com.zbkj.common.response.lxkopenapi.express.QueryExpressResult;
@@ -28,14 +29,24 @@ public class LxkOpenApiService {
private static final String HTTPS_URL_PREFIX = "https://saasmall.lianxianke.cn/lxk-api/"; private static final String HTTPS_URL_PREFIX = "https://saasmall.lianxianke.cn/lxk-api/";
@Autowired @Autowired
private SmsProperties lxkOpenApiProperties; private SmsProperties lxkOpenApiProperties;
@Autowired
private SystemConfigService systemConfigService;
private String getBaseUrl() {
String baseUrl = systemConfigService.getValueByKey(SysConfigConstants.CONFIG_LXK_SERVER_API_URL);
if (StrUtil.isBlank(baseUrl)) {
baseUrl = HTTPS_URL_PREFIX;
}
return baseUrl;
}
private String getHttpsUrl(String openServiceApi) { private String getHttpsUrl(String openServiceApi) {
return String.format("%s%s", HTTPS_URL_PREFIX, openServiceApi); return String.format("%s%s", getBaseUrl(), openServiceApi);
} }
private String getHttpsPageURL(String openServiceApi, Integer pageSize, Integer pageNum, String orderByColumn, String isAsc) { private String getHttpsPageURL(String openServiceApi, Integer pageSize, Integer pageNum, String orderByColumn, String isAsc) {
return String.format("%s%s?pageSize=%s&pageNum=%s&orderByColumn=%s&isAsc=%s", return String.format("%s%s?pageSize=%s&pageNum=%s&orderByColumn=%s&isAsc=%s",
HTTPS_URL_PREFIX, openServiceApi, pageSize, pageNum, orderByColumn, isAsc); getBaseUrl(), openServiceApi, pageSize, pageNum, orderByColumn, isAsc);
} }
/** /**
@@ -251,10 +262,10 @@ public class LxkOpenApiService {
jsonObject.put("no", queryExpressRequest.getNo()); jsonObject.put("no", queryExpressRequest.getNo());
log.info("查询物流,请求参数:{}", jsonObject); log.info("查询物流,请求参数:{}", jsonObject);
String result = HttpUtil.createPost(httpsUrl) String result = HttpUtil.createPost(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.contentType("application/json") .contentType("application/json")
.body(jsonObject.toJSONString(0)).execute().body(); .body(jsonObject.toJSONString(0)).execute().body();
return JSONUtil.toBean(result, QueryExpressResult.class); return JSONUtil.toBean(result, QueryExpressResult.class);
} }
@@ -267,11 +278,11 @@ public class LxkOpenApiService {
public UserPackageRecordResult expressRecord(PageQueryRequest pageQueryRequest) { public UserPackageRecordResult expressRecord(PageQueryRequest pageQueryRequest) {
String httpsUrl = getExpressRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc()); String httpsUrl = getExpressRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, UserPackageRecordResult.class); return JSONUtil.toBean(result, UserPackageRecordResult.class);
} }
@@ -283,11 +294,11 @@ public class LxkOpenApiService {
public CommonInfoCountResult expressInfoCount() { public CommonInfoCountResult expressInfoCount() {
String httpsUrl = getExpressInfoCountURL(); String httpsUrl = getExpressInfoCountURL();
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, CommonInfoCountResult.class); return JSONUtil.toBean(result, CommonInfoCountResult.class);
} }
@@ -305,10 +316,10 @@ public class LxkOpenApiService {
jsonObject.put("templateId", smsSendRequest.getTemplateId()); jsonObject.put("templateId", smsSendRequest.getTemplateId());
jsonObject.put("paramMap", smsSendRequest.getParamMap()); jsonObject.put("paramMap", smsSendRequest.getParamMap());
String result = HttpUtil.createPost(httpsUrl) String result = HttpUtil.createPost(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.contentType("application/json") .contentType("application/json")
.body(jsonObject.toJSONString(0)).execute().body(); .body(jsonObject.toJSONString(0)).execute().body();
return JSONUtil.toBean(result, SendMesgResult.class); return JSONUtil.toBean(result, SendMesgResult.class);
} }
@@ -326,10 +337,10 @@ public class LxkOpenApiService {
jsonObject.put("templateId", smsSendRequest.getTemplateId()); jsonObject.put("templateId", smsSendRequest.getTemplateId());
jsonObject.put("paramMap", smsSendRequest.getParamMap()); jsonObject.put("paramMap", smsSendRequest.getParamMap());
String result = HttpUtil.createPost(httpsUrl) String result = HttpUtil.createPost(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.contentType("application/json") .contentType("application/json")
.body(jsonObject.toJSONString(0)).execute().body(); .body(jsonObject.toJSONString(0)).execute().body();
return JSONUtil.toBean(result, SendMesgResult.class); return JSONUtil.toBean(result, SendMesgResult.class);
} }
@@ -342,11 +353,11 @@ public class LxkOpenApiService {
public UserPackageRecordResult smsRecord(PageQueryRequest pageQueryRequest) { public UserPackageRecordResult smsRecord(PageQueryRequest pageQueryRequest) {
String httpsUrl = getSmsRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc()); String httpsUrl = getSmsRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, UserPackageRecordResult.class); return JSONUtil.toBean(result, UserPackageRecordResult.class);
} }
@@ -358,11 +369,11 @@ public class LxkOpenApiService {
public CommonInfoCountResult smsInfoCount() { public CommonInfoCountResult smsInfoCount() {
String httpsUrl = getSmsInfoCountURL(); String httpsUrl = getSmsInfoCountURL();
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, CommonInfoCountResult.class); return JSONUtil.toBean(result, CommonInfoCountResult.class);
} }
@@ -378,10 +389,10 @@ public class LxkOpenApiService {
jsonObject.put("lng", geoLatLngRequest.getLng()); jsonObject.put("lng", geoLatLngRequest.getLng());
jsonObject.put("lat", geoLatLngRequest.getLat()); jsonObject.put("lat", geoLatLngRequest.getLat());
String result = HttpUtil.createPost(httpsUrl) String result = HttpUtil.createPost(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.contentType("application/json") .contentType("application/json")
.body(jsonObject.toJSONString(0)).execute().body(); .body(jsonObject.toJSONString(0)).execute().body();
return JSONUtil.toBean(result, AddressGeoResult.class); return JSONUtil.toBean(result, AddressGeoResult.class);
} }
@@ -396,10 +407,10 @@ public class LxkOpenApiService {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("address", address); jsonObject.put("address", address);
String result = HttpUtil.createPost(httpsUrl) String result = HttpUtil.createPost(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.contentType("application/json") .contentType("application/json")
.body(jsonObject.toJSONString(0)).execute().body(); .body(jsonObject.toJSONString(0)).execute().body();
return JSONUtil.toBean(result, AddressGeoResult.class); return JSONUtil.toBean(result, AddressGeoResult.class);
} }
@@ -413,11 +424,11 @@ public class LxkOpenApiService {
public UserPackageRecordResult geoRecord(PageQueryRequest pageQueryRequest) { public UserPackageRecordResult geoRecord(PageQueryRequest pageQueryRequest) {
String httpsUrl = getGeoRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc()); String httpsUrl = getGeoRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, UserPackageRecordResult.class); return JSONUtil.toBean(result, UserPackageRecordResult.class);
} }
@@ -429,11 +440,11 @@ public class LxkOpenApiService {
public CommonInfoCountResult geoInfoCount() { public CommonInfoCountResult geoInfoCount() {
String httpsUrl = getGeoInfoCountURL(); String httpsUrl = getGeoInfoCountURL();
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, CommonInfoCountResult.class); return JSONUtil.toBean(result, CommonInfoCountResult.class);
} }
@@ -451,10 +462,10 @@ public class LxkOpenApiService {
jsonObject.put("idCardNo", faceFaceRequest.getIdCardNo()); jsonObject.put("idCardNo", faceFaceRequest.getIdCardNo());
jsonObject.put("name", faceFaceRequest.getName()); jsonObject.put("name", faceFaceRequest.getName());
String result = HttpUtil.createPost(httpsUrl) String result = HttpUtil.createPost(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.contentType("application/json") .contentType("application/json")
.body(jsonObject.toJSONString(0)).execute().body(); .body(jsonObject.toJSONString(0)).execute().body();
return JSONUtil.toBean(result, FaceResult.class); return JSONUtil.toBean(result, FaceResult.class);
} }
@@ -471,10 +482,10 @@ public class LxkOpenApiService {
jsonObject.put("idCardNo", facePlusRequest.getIdCardNo()); jsonObject.put("idCardNo", facePlusRequest.getIdCardNo());
jsonObject.put("name", facePlusRequest.getName()); jsonObject.put("name", facePlusRequest.getName());
String result = HttpUtil.createPost(httpsUrl) String result = HttpUtil.createPost(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.contentType("application/json") .contentType("application/json")
.body(jsonObject.toJSONString(0)).execute().body(); .body(jsonObject.toJSONString(0)).execute().body();
return JSONUtil.toBean(result, FaceResult.class); return JSONUtil.toBean(result, FaceResult.class);
} }
@@ -496,10 +507,10 @@ public class LxkOpenApiService {
jsonObject.put("idCardNo", faceCompareRequest.getIdCardNo()); jsonObject.put("idCardNo", faceCompareRequest.getIdCardNo());
} }
String result = HttpUtil.createPost(httpsUrl) String result = HttpUtil.createPost(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.contentType("application/json") .contentType("application/json")
.body(jsonObject.toJSONString(0)).execute().body(); .body(jsonObject.toJSONString(0)).execute().body();
return JSONUtil.toBean(result, FaceResult.class); return JSONUtil.toBean(result, FaceResult.class);
} }
@@ -512,11 +523,11 @@ public class LxkOpenApiService {
public UserPackageRecordResult facePlusRecord(PageQueryRequest pageQueryRequest) { public UserPackageRecordResult facePlusRecord(PageQueryRequest pageQueryRequest) {
String httpsUrl = getFacePlusRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc()); String httpsUrl = getFacePlusRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, UserPackageRecordResult.class); return JSONUtil.toBean(result, UserPackageRecordResult.class);
} }
@@ -528,11 +539,11 @@ public class LxkOpenApiService {
public CommonInfoCountResult facePlusCount() { public CommonInfoCountResult facePlusCount() {
String httpsUrl = getFacePlusInfoCountURL(); String httpsUrl = getFacePlusInfoCountURL();
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, CommonInfoCountResult.class); return JSONUtil.toBean(result, CommonInfoCountResult.class);
} }
@@ -549,10 +560,10 @@ public class LxkOpenApiService {
jsonObject.put("name", verifyIdCardRequest.getName()); jsonObject.put("name", verifyIdCardRequest.getName());
log.info(jsonObject.toJSONString(0)); log.info(jsonObject.toJSONString(0));
String result = HttpUtil.createPost(httpsUrl) String result = HttpUtil.createPost(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.contentType("application/json") .contentType("application/json")
.body(jsonObject.toJSONString(0)).execute().body(); .body(jsonObject.toJSONString(0)).execute().body();
log.info(result); log.info(result);
return JSONUtil.toBean(result, IdCardResult.class); return JSONUtil.toBean(result, IdCardResult.class);
} }
@@ -567,11 +578,11 @@ public class LxkOpenApiService {
public UserPackageRecordResult idCardRecord(PageQueryRequest pageQueryRequest) { public UserPackageRecordResult idCardRecord(PageQueryRequest pageQueryRequest) {
String httpsUrl = getIdCardRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc()); String httpsUrl = getIdCardRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, UserPackageRecordResult.class); return JSONUtil.toBean(result, UserPackageRecordResult.class);
} }
@@ -583,11 +594,11 @@ public class LxkOpenApiService {
public CommonInfoCountResult idCardInfoCount() { public CommonInfoCountResult idCardInfoCount() {
String httpsUrl = getIdCardInfoCountURL(); String httpsUrl = getIdCardInfoCountURL();
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, CommonInfoCountResult.class); return JSONUtil.toBean(result, CommonInfoCountResult.class);
} }
@@ -603,10 +614,10 @@ public class LxkOpenApiService {
jsonObject.put("content", verifyWordsRequest.getContent()); jsonObject.put("content", verifyWordsRequest.getContent());
jsonObject.put("type", verifyWordsRequest.getType()); jsonObject.put("type", verifyWordsRequest.getType());
String result = HttpUtil.createPost(httpsUrl) String result = HttpUtil.createPost(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.contentType("application/json") .contentType("application/json")
.body(jsonObject.toJSONString(0)).execute().body(); .body(jsonObject.toJSONString(0)).execute().body();
return JSONUtil.toBean(result, VerifyWordsResult.class); return JSONUtil.toBean(result, VerifyWordsResult.class);
} }
@@ -619,11 +630,11 @@ public class LxkOpenApiService {
public UserPackageRecordResult wordsRecord(PageQueryRequest pageQueryRequest) { public UserPackageRecordResult wordsRecord(PageQueryRequest pageQueryRequest) {
String httpsUrl = getWordsRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc()); String httpsUrl = getWordsRecordURL(pageQueryRequest.getPageSize(), pageQueryRequest.getPageNum(), pageQueryRequest.getOrderByColumn(), pageQueryRequest.getIsAsc());
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, UserPackageRecordResult.class); return JSONUtil.toBean(result, UserPackageRecordResult.class);
} }
@@ -635,11 +646,11 @@ public class LxkOpenApiService {
public CommonInfoCountResult wordsInfoCount() { public CommonInfoCountResult wordsInfoCount() {
String httpsUrl = getWordsInfoCountURL(); String httpsUrl = getWordsInfoCountURL();
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.header("access_key", lxkOpenApiProperties.getLxkAccessKey()) .header("access_key", lxkOpenApiProperties.getLxkAccessKey())
.header("secret_key", lxkOpenApiProperties.getLxkSecretKey()) .header("secret_key", lxkOpenApiProperties.getLxkSecretKey())
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
return JSONUtil.toBean(result, CommonInfoCountResult.class); return JSONUtil.toBean(result, CommonInfoCountResult.class);
} }
@@ -652,9 +663,9 @@ public class LxkOpenApiService {
public IpInfoResult getCurrentIp() { public IpInfoResult getCurrentIp() {
String httpsUrl = getApiIpUrl(); String httpsUrl = getApiIpUrl();
String result = HttpUtil.createGet(httpsUrl) String result = HttpUtil.createGet(httpsUrl)
.execute() .execute()
.charset("utf-8") .charset("utf-8")
.body(); .body();
IpResult ipResult = JSONUtil.toBean(result, IpResult.class); IpResult ipResult = JSONUtil.toBean(result, IpResult.class);
return ipResult.getData(); return ipResult.getData();
} }