1. 接口地址
POST /order/openapi/doShelves
2. 请求参数
{
"productId":"12312412",
"type": 1 //上下架标识 1 待上架 2上架 3下架
}3. 返回值
成功:
{
"code": 200,
"msg": "操作成功",
"data": null
}失败:
{
"code": 500,
"msg": "操作失败",
"data": null
}4. 如何调用
curl示例:
curl -X POST "http://192.168.80.143:8081/order/openapi/doShelves" \
-H "Authorization: Bearer <API Key>" \
-H "Content-Type: application/json" \
-d '{
"productId": "1837301791183183873",
"type": 1,
}'java示例:
public static void main(String[] args) {
HashMap<String, Object> jsonMap = new HashMap<>();
//实例id
jsonMap.put("productId", "1837301791183183873");
//实例名称
jsonMap.put("type", 1);
//将Map转换为JSON字符串
String json = JSONUtil.toJsonStr(jsonMap);
Map<String, String> headerMap = new HashMap<>();
headerMap.put("Authorization", "Bearer <API Key>");
//链式构建请求
String result = HttpRequest.post("http://192.168.80.143:8081/order/openapi/doShelves")
.addHeaders(headerMap) //请求头
.body(json) // 设置请求体
.execute().body();
System.out.println(result);
}作者:冯豪东 创建时间:2025-04-11 00:59
最后编辑:冯豪东 更新时间:2025-06-12 03:26
最后编辑:冯豪东 更新时间:2025-06-12 03:26