1
This commit is contained in:
@@ -6,7 +6,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* 授权列表查询请求(示例类)
|
||||
*/
|
||||
public class AuthorizeListQueryRequest extends ERPRequestBase {
|
||||
public AuthorizeListQueryRequest(ERPAccount erpAccount) {
|
||||
public AuthorizeListQueryRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/user/authorize/list", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import lombok.Getter;
|
||||
* @description:ERP账户枚举类
|
||||
*/
|
||||
@Getter
|
||||
public enum ERPAccount {
|
||||
public enum ERPAccount implements IERPAccount {
|
||||
// 胡歌1016208368633221
|
||||
ACCOUNT_HUGE("1016208368633221", "waLiRMgFcixLbcLjUSSwo370Hp1nBcBu","余生请多关照66","海尔胡歌"),
|
||||
// 刘强东anotherApiKey
|
||||
|
||||
@@ -18,12 +18,12 @@ public abstract class ERPRequestBase {
|
||||
|
||||
protected String url;
|
||||
protected String sign;
|
||||
protected ERPAccount erpAccount;
|
||||
protected IERPAccount erpAccount;
|
||||
@Setter
|
||||
protected JSONObject requestBody;
|
||||
protected long timestamp; // 统一时间戳字段
|
||||
|
||||
public ERPRequestBase(String url, ERPAccount erpAccount) {
|
||||
public ERPRequestBase(String url, IERPAccount erpAccount) {
|
||||
this.url = url;
|
||||
this.erpAccount = erpAccount;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ package com.ruoyi.erp.request;
|
||||
* 对应接口:POST /api/open/express/companies
|
||||
*/
|
||||
public class ExpressCompaniesQueryRequest extends ERPRequestBase {
|
||||
public ExpressCompaniesQueryRequest(ERPAccount erpAccount) {
|
||||
public ExpressCompaniesQueryRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/express/companies", erpAccount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.erp.request;
|
||||
|
||||
/**
|
||||
* 闲管家开放平台凭证({@link ERPAccount} 或库表配置行均可实现本接口)
|
||||
*/
|
||||
public interface IERPAccount {
|
||||
|
||||
String getApiKey();
|
||||
|
||||
String getApiKeySecret();
|
||||
|
||||
/** 闲鱼会员名(授权维度展示用,可为空) */
|
||||
String getXyName();
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* 对应接口:POST /api/open/order/detail
|
||||
*/
|
||||
public class OrderDetailQueryRequest extends ERPRequestBase {
|
||||
public OrderDetailQueryRequest(ERPAccount erpAccount) {
|
||||
public OrderDetailQueryRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/order/detail", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* 对应接口:POST /api/open/order/kam/list
|
||||
*/
|
||||
public class OrderKamListQueryRequest extends ERPRequestBase {
|
||||
public OrderKamListQueryRequest(ERPAccount erpAccount) {
|
||||
public OrderKamListQueryRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/order/kam/list", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* 对应接口:POST /api/open/order/list
|
||||
*/
|
||||
public class OrderListQueryRequest extends ERPRequestBase {
|
||||
public OrderListQueryRequest(ERPAccount erpAccount) {
|
||||
public OrderListQueryRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/order/list", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* 对应接口:POST /api/open/order/modify/price
|
||||
*/
|
||||
public class OrderModifyPriceRequest extends ERPRequestBase {
|
||||
public OrderModifyPriceRequest(ERPAccount erpAccount) {
|
||||
public OrderModifyPriceRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/order/modify/price", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* 对应接口:POST /api/open/order/ship
|
||||
*/
|
||||
public class OrderShipRequest extends ERPRequestBase {
|
||||
public OrderShipRequest(ERPAccount erpAccount) {
|
||||
public OrderShipRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/order/ship", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
* 限制:每批次最多50个商品
|
||||
*/
|
||||
public class ProductBatchCreateRequest extends ERPRequestBase {
|
||||
public ProductBatchCreateRequest(ERPAccount erpAccount) {
|
||||
public ProductBatchCreateRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/batchCreate", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* - flash_sale_type(选填):闲鱼特卖类型
|
||||
*/
|
||||
public class ProductCategoryListQueryRequest extends ERPRequestBase {
|
||||
public ProductCategoryListQueryRequest(ERPAccount erpAccount) {
|
||||
public ProductCategoryListQueryRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/category/list", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class ProductCreateRequest extends ERPRequestBase {
|
||||
private final JSONArray publishShop = new JSONArray();
|
||||
private final JSONArray skuItems = new JSONArray();
|
||||
|
||||
public ProductCreateRequest(ERPAccount erpAccount) {
|
||||
public ProductCreateRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/create", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* 对应接口:POST /api/open/product/delete
|
||||
*/
|
||||
public class ProductDeleteRequest extends ERPRequestBase {
|
||||
public ProductDeleteRequest(ERPAccount erpAccount) {
|
||||
public ProductDeleteRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/delete", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* - product_id(必填):管家商品ID
|
||||
*/
|
||||
public class ProductDetailQueryRequest extends ERPRequestBase {
|
||||
public ProductDetailQueryRequest(ERPAccount erpAccount) {
|
||||
public ProductDetailQueryRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/detail", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* 对应接口:POST /api/open/product/downShelf
|
||||
*/
|
||||
public class ProductDownShelfRequest extends ERPRequestBase {
|
||||
public ProductDownShelfRequest(ERPAccount erpAccount) {
|
||||
public ProductDownShelfRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/downShelf", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class ProductEditRequest extends ERPRequestBase {
|
||||
private final JSONArray publishShop = new JSONArray();
|
||||
private final JSONArray skuItems = new JSONArray();
|
||||
|
||||
public ProductEditRequest(ERPAccount erpAccount) {
|
||||
public ProductEditRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/edit", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* 对应接口:POST /api/open/product/edit/stock
|
||||
*/
|
||||
public class ProductEditStockRequest extends ERPRequestBase {
|
||||
public ProductEditStockRequest(ERPAccount erpAccount) {
|
||||
public ProductEditStockRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/edit/stock", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.ruoyi.erp.request;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
|
||||
public class ProductListQueryRequest extends ERPRequestBase {
|
||||
public ProductListQueryRequest(ERPAccount erpAccount) {
|
||||
public ProductListQueryRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/list", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* - sub_property_id(选填):属性值ID(用于二级属性查询)
|
||||
*/
|
||||
public class ProductPropertyListQueryRequest extends ERPRequestBase {
|
||||
public ProductPropertyListQueryRequest(ERPAccount erpAccount) {
|
||||
public ProductPropertyListQueryRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/pv/list", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
* 对应接口:POST /api/open/product/publish
|
||||
*/
|
||||
public class ProductPublishRequest extends ERPRequestBase {
|
||||
public ProductPublishRequest(ERPAccount erpAccount) {
|
||||
public ProductPublishRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/publish", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.Collection;
|
||||
* - product_id(必填):管家商品ID数组,最多100个
|
||||
*/
|
||||
public class ProductSkuListQueryRequest extends ERPRequestBase {
|
||||
public ProductSkuListQueryRequest(ERPAccount erpAccount) {
|
||||
public ProductSkuListQueryRequest(IERPAccount erpAccount) {
|
||||
super("https://open.goofish.pro/api/open/product/sku/list", erpAccount);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user