# shoplus-open-api-sdk
**Repository Path**: Deep_feel/shoplus-open-api-sdk
## Basic Information
- **Project Name**: shoplus-open-api-sdk
- **Description**: No description available
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-07-14
- **Last Updated**: 2021-07-20
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# shoplus-open-api-sdk
sdk for Java
Shoplus开放平台对应的sdk
## 接口信息
比如获取商品详情接口
- 接口名:products.detail
- 版本号:"1.0"
- 请求参数:id
- 返回信息 product对象
```
{
"code":"0",
"data":{
"title":"苹果iPhoneX",
"id":1,
"seoUrl":"*****"
}
}
```
## maven依赖
```java
io.gitee.deep_feel
shoplus-sdk
1.0.0-RELEASE
```
## sdk使用方式
```
String url = "https://test-api-portal-shoplus.algobuy.net/open-api";
String appKey = "**********************";
String secret = "*************";
OpenClient client = new OpenClient(url, appKey, secret);
// 创建请求对象
CommonRequest request = new CommonRequest("products.detail", "1.0");
// 请求参数
Map param = new HashMap<>(16);
param.put("id", 510112L);
request.setParam(param);
// 发送请求
CommonResponse response = client.execute(request);
if (response.isSuccess()) {
// 返回结果
Map responseData = response.getData();
System.out.println(responseData.get("title"));
System.out.println(responseData.get("seoUrl"));
} else {
System.out.println("errorCode:" + response.getCode() + ",errorMsg:" + response.getMsg());
}
```