|
|
@@ -9,9 +9,7 @@ import com.global.iop.util.ApiException; |
|
|
|
import com.global.iop.util.FileItem; |
|
|
|
import com.ruoyi.common.annotation.Log; |
|
|
|
import com.ruoyi.common.enums.BusinessType; |
|
|
|
import com.ruoyi.web.controller.aliexpress.dto.CategoryGetPropValueFeatureDTO; |
|
|
|
import com.ruoyi.web.controller.aliexpress.dto.CategoryQdUploadDTO; |
|
|
|
import com.ruoyi.web.controller.aliexpress.dto.CategorySuggestionDTO; |
|
|
|
import com.ruoyi.web.controller.aliexpress.dto.category.*; |
|
|
|
import com.ruoyi.web.core.config.AliexpressAuthClientConfig; |
|
|
|
import com.ruoyi.web.enumerate.AliexpressCategoryEnu; |
|
|
|
import io.swagger.annotations.Api; |
|
|
@@ -46,6 +44,7 @@ public class AliexpressCategoryController { |
|
|
|
System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取AE属性的PropValueFeature |
|
|
|
*/ |
|
|
@@ -59,7 +58,7 @@ public class AliexpressCategoryController { |
|
|
|
request.addApiParameter("propertyId", reqDto.getPropertyId()); |
|
|
|
request.addApiParameter("valueId", reqDto.getValueId()); |
|
|
|
request.addApiParameter("featureKey", reqDto.getFeatureKey()); |
|
|
|
IopResponse response = client.execute(request); |
|
|
|
IopResponse response = client.execute(request, Protocol.GOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
|
|
|
@@ -75,6 +74,7 @@ public class AliexpressCategoryController { |
|
|
|
System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* suggestion |
|
|
|
*/ |
|
|
@@ -103,6 +103,7 @@ public class AliexpressCategoryController { |
|
|
|
System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* qdUpload |
|
|
|
*/ |
|
|
@@ -112,7 +113,7 @@ public class AliexpressCategoryController { |
|
|
|
public String qdUpload(@RequestParam("file") MultipartFile file, @RequestBody CategoryQdUploadDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.FILE_UPLOAD.getApiName()); |
|
|
|
request.setApiName(AliexpressCategoryEnu.QD_FILE_UPLOAD.getApiName()); |
|
|
|
request.addApiParameter("upload_meta", reqDto.getUpload_meta()); |
|
|
|
try { |
|
|
|
request.addFileParameter("file_data", new FileItem(file.getOriginalFilename(), file.getInputStream(), file.getContentType())); |
|
|
@@ -134,6 +135,21 @@ System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询属于特定类别的sku属性信息 |
|
|
|
*/ |
|
|
|
@Log(title = "查询属于特定类别的sku属性信息", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("查询属于特定类别的sku属性信息") |
|
|
|
@PostMapping("/skuAttributeQuery") |
|
|
|
public String skuAttributeQuery(@RequestBody CategorySkuAttributeQueryDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.SKU_ATTRIBUTE_QUERY.getApiName()); |
|
|
|
request.addApiParameter("query_sku_attribute_info_request", reqDto.getQuery_sku_attribute_info_request()); |
|
|
|
IopResponse response = client.execute(request, reqDto.getAccessToken(), Protocol.TOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
|
|
|
|
//API,用于卖家查询类别树。只支持显示卖家有权发布产品的类别。 |
|
|
|
/* |
|
|
|
IopClient client = new IopClient(url, appkey, appSecret); |
|
|
@@ -146,6 +162,22 @@ System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 用于卖家查询类别树 只支持显示卖家有权发布产品的类别 |
|
|
|
*/ |
|
|
|
@Log(title = "用于卖家查询类别树 只支持显示卖家有权发布产品的类别", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("用于卖家查询类别树 只支持显示卖家有权发布产品的类别") |
|
|
|
@PostMapping("/sellerCategoryTreeQuery") |
|
|
|
public String sellerCategoryTreeQuery(@RequestBody CategorySellerCategoryTreeQueryDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.SELLER_CATEGORY_TREE_QUERY.getApiName()); |
|
|
|
request.addApiParameter("category_id", reqDto.getCategory_id()); |
|
|
|
request.addApiParameter("filter_no_permission", reqDto.getFilter_no_permission()); |
|
|
|
IopResponse response = client.execute(request, reqDto.getAccessToken(), Protocol.TOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
|
|
|
|
//判断叶子类目是否必须尺码表 |
|
|
|
/* |
|
|
|
IopClient client = new IopClient(url, appkey, appSecret); |
|
|
@@ -157,6 +189,21 @@ System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 判断叶子类目是否必须尺码表 |
|
|
|
*/ |
|
|
|
@Log(title = "判断叶子类目是否必须尺码表", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("判断叶子类目是否必须尺码表") |
|
|
|
@PostMapping("/sizeModelsRequiredForPostCat") |
|
|
|
public String sizeModelsRequiredForPostCat(@RequestBody CategorySizeModelsRequiredForPostCatDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.SIZE_MODELS_REQUIRED_FOR_POST_CAT.getApiName()); |
|
|
|
request.addApiParameter("param0", reqDto.getParam0()); |
|
|
|
IopResponse response = client.execute(request, Protocol.TOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
|
|
|
|
//查询海外商家授权品牌 |
|
|
|
/* |
|
|
|
IopClient client = new IopClient(url, appkey, appSecret); |
|
|
@@ -167,6 +214,20 @@ System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询海外商家授权品牌 |
|
|
|
*/ |
|
|
|
@Log(title = "查询海外商家授权品牌", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("查询海外商家授权品牌") |
|
|
|
@PostMapping("/merchantOverseaBrandGet") |
|
|
|
public String merchantOverseaBrandGet(@RequestBody CategorySizeModelsRequiredForPostCatDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.MERCHANT_OVERSEA_BRAND_GET.getApiName()); |
|
|
|
IopResponse response = client.execute(request, reqDto.getAccessToken(), Protocol.TOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
|
|
|
|
//查询类目下欧盟责任人列表 |
|
|
|
/* |
|
|
|
IopClient client = new IopClient(url, appkey, appSecret); |
|
|
@@ -181,6 +242,24 @@ System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询类目下欧盟责任人列表 |
|
|
|
*/ |
|
|
|
@Log(title = "查询类目下欧盟责任人列表", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("查询类目下欧盟责任人列表") |
|
|
|
@PostMapping("/euResponsiblePersonsList") |
|
|
|
public String euResponsiblePersonsList(@RequestBody CategoryEuResponsiblePersonsListDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.EU_RESPONSIBLE_PERSONS_LIST.getApiName()); |
|
|
|
request.setHttpMethod("GET"); |
|
|
|
request.addApiParameter("category_id", reqDto.getCategory_id()); |
|
|
|
request.addApiParameter("channel", reqDto.getChannel()); |
|
|
|
request.addApiParameter("channel_seller_id", reqDto.getChannel_seller_id()); |
|
|
|
IopResponse response = client.execute(request, reqDto.getAccessToken(), Protocol.TOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
|
|
|
|
//根据发布类目id、父属性路径(可选)获取子属性信息,只返回有权限品牌 |
|
|
|
/* |
|
|
|
IopClient client = new IopClient(url, appkey, appSecret); |
|
|
@@ -197,6 +276,26 @@ System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据发布类目id、父属性路径(可选)获取子属性信息,只返回有权限品牌 |
|
|
|
*/ |
|
|
|
@Log(title = "根据发布类目id、父属性路径(可选)获取子属性信息,只返回有权限品牌", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("根据发布类目id、父属性路径(可选)获取子属性信息,只返回有权限品牌") |
|
|
|
@PostMapping("/getChildAttributesResultByPostCateIdAndPath") |
|
|
|
public String getChildAttributesResultByPostCateIdAndPath(@RequestBody CategoryGetChildAttributesResultByPostCateIdAndPathDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.GET_CHILD_ATTRIBUTES_RESULT_BY_POST_CATE_ID_AND_PATH.getApiName()); |
|
|
|
request.addApiParameter("channel", reqDto.getChannel()); |
|
|
|
request.addApiParameter("locale", reqDto.getLocale()); |
|
|
|
request.addApiParameter("product_type", reqDto.getProduct_type()); |
|
|
|
request.addApiParameter("channel_seller_id", reqDto.getChannel_seller_id()); |
|
|
|
request.addApiParameter("param1", reqDto.getParam1()); |
|
|
|
request.addApiParameter("param2", reqDto.getParam2()); |
|
|
|
IopResponse response = client.execute(request, reqDto.getAccessToken(), Protocol.TOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
|
|
|
|
//类目资质信息查询 |
|
|
|
/* |
|
|
|
IopClient client = new IopClient(url, appkey, appSecret); |
|
|
@@ -210,6 +309,23 @@ System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 类目资质信息查询 |
|
|
|
*/ |
|
|
|
@Log(title = "类目资质信息查询", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("类目资质信息查询") |
|
|
|
@PostMapping("/qualificationsList") |
|
|
|
public String qualificationsList(@RequestBody CategoryQualificationsListDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.QUALIFICATIONS_LIST.getApiName()); |
|
|
|
request.setHttpMethod("GET"); |
|
|
|
request.addApiParameter("category_id", reqDto.getCategory_id()); |
|
|
|
request.addApiParameter("local", reqDto.getLocal()); |
|
|
|
IopResponse response = client.execute(request, reqDto.getAccessToken(), Protocol.TOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
|
|
|
|
//获取单个类目信息 |
|
|
|
/* |
|
|
|
IopClient client = new IopClient(url, appkey, appSecret); |
|
|
@@ -221,6 +337,21 @@ System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取单个类目信息 |
|
|
|
*/ |
|
|
|
@Log(title = "获取单个类目信息", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("获取单个类目信息") |
|
|
|
@PostMapping("/getPostCategoryById") |
|
|
|
public String getPostCategoryById(@RequestBody CategoryGetPostCategoryByIdDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.GET_POST_CATEGORY_BY_ID.getApiName()); |
|
|
|
request.addApiParameter("param0", reqDto.getParam0()); |
|
|
|
IopResponse response = client.execute(request, Protocol.TOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
|
|
|
|
//获取指定类目下子类目信息 |
|
|
|
/* |
|
|
|
IopClient client = new IopClient(url, appkey, appSecret); |
|
|
@@ -232,6 +363,21 @@ System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取指定类目下子类目信息 |
|
|
|
*/ |
|
|
|
@Log(title = "获取指定类目下子类目信息", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("获取指定类目下子类目信息") |
|
|
|
@PostMapping("/getChildrenPostCategoryById") |
|
|
|
public String getChildrenPostCategoryById(@RequestBody CategoryGetChildrenPostCategoryByIdDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.GET_CHILDREN_POST_CATEGORY_BY_ID.getApiName()); |
|
|
|
request.addApiParameter("param0", reqDto.getParam0()); |
|
|
|
IopResponse response = client.execute(request, Protocol.TOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
|
|
|
|
//获取指定类目下的子类目信息(可校验卖家权限) |
|
|
|
/* |
|
|
|
IopClient client = new IopClient(url, appkey, appSecret); |
|
|
@@ -246,4 +392,23 @@ IopResponse response = client.execute(request, accessToken, Protocol.TOP); |
|
|
|
System.out.println(response.getBody()); |
|
|
|
Thread.sleep(10); |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取指定类目下的子类目信息(可校验卖家权限) |
|
|
|
*/ |
|
|
|
@Log(title = "获取指定类目下的子类目信息(可校验卖家权限)", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("获取指定类目下的子类目信息(可校验卖家权限)") |
|
|
|
@PostMapping("/treeList") |
|
|
|
public String treeList(@RequestBody CategoryTreeListDTO reqDto) throws ApiException { |
|
|
|
IopClient client = new IopClientImpl(AliexpressAuthClientConfig.getUrl(), AliexpressAuthClientConfig.getAppKey(), AliexpressAuthClientConfig.getAppSecret()); |
|
|
|
IopRequest request = new IopRequest(); |
|
|
|
request.setApiName(AliexpressCategoryEnu.TREE_LIST.getApiName()); |
|
|
|
request.setHttpMethod("GET"); |
|
|
|
request.addApiParameter("channel_seller_id", reqDto.getChannel_seller_id()); |
|
|
|
request.addApiParameter("only_with_permission", reqDto.getOnly_with_permission()); |
|
|
|
request.addApiParameter("channel", reqDto.getChannel()); |
|
|
|
request.addApiParameter("category_id", reqDto.getCategory_id()); |
|
|
|
IopResponse response = client.execute(request, Protocol.TOP); |
|
|
|
return response.getGopResponseBody(); |
|
|
|
} |
|
|
|
} |