This commit is contained in:
van
2026-04-09 00:09:09 +08:00
parent c9876df3de
commit e94f17973c
50 changed files with 1637 additions and 72 deletions

View File

@@ -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);
}

View File

@@ -9,7 +9,7 @@ import lombok.Getter;
* @descriptionERP账户枚举类
*/
@Getter
public enum ERPAccount {
public enum ERPAccount implements IERPAccount {
// 胡歌1016208368633221
ACCOUNT_HUGE("1016208368633221", "waLiRMgFcixLbcLjUSSwo370Hp1nBcBu","余生请多关照66","海尔胡歌"),
// 刘强东anotherApiKey

View File

@@ -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;
}

View File

@@ -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);
}
}

View File

@@ -0,0 +1,14 @@
package com.ruoyi.erp.request;
/**
* 闲管家开放平台凭证({@link ERPAccount} 或库表配置行均可实现本接口)
*/
public interface IERPAccount {
String getApiKey();
String getApiKeySecret();
/** 闲鱼会员名(授权维度展示用,可为空) */
String getXyName();
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}