阿里访问代码移动到统一访问包里
parent
9817cc5d8a
commit
abe6c3e635
@ -0,0 +1,14 @@
|
||||
package com.glxp.api.httpClient.serviceClient;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.glxp.api.req.alihealth.AlihealthKytCommonParametersReqeust;
|
||||
import com.glxp.api.util.alihealth.AlihealthUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
public interface AlihealthClient {
|
||||
String accessAliInterface(AlihealthKytCommonParametersReqeust alihealthKytCommonParametersReqeust, String appSecret);
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.glxp.api.httpClient.serviceClient.impl;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.glxp.api.httpClient.serviceClient.AlihealthClient;
|
||||
import com.glxp.api.req.alihealth.AlihealthKytCommonParametersReqeust;
|
||||
import com.glxp.api.util.alihealth.AlihealthUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
@Service
|
||||
public class AlihealthImpl implements AlihealthClient {
|
||||
@Resource
|
||||
private AlihealthUtils alihealthUtils;
|
||||
@Value("${ALIHEALTH_URL:http://gw.api.taobao.com/router/rest}")
|
||||
private String alihealthUrl;
|
||||
|
||||
@Override
|
||||
public String accessAliInterface(AlihealthKytCommonParametersReqeust alihealthKytCommonParametersReqeust, String appSecret) {
|
||||
Map map = alihealthUtils.disposeSign(alihealthKytCommonParametersReqeust, appSecret);
|
||||
String json = HttpUtil.get(alihealthUrl, map);
|
||||
return json;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue