From b66b48036d8d92765d207ec49c00983a8c8157a6 Mon Sep 17 00:00:00 2001 From: ah-max150 Date: Thu, 6 Aug 2026 15:36:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=8B=86=E5=88=86=E6=8B=BC?= =?UTF-8?q?=E5=A4=9A=E5=A4=9A=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 52 ++---------------- .../src/main/resources/config/channel-pdd.yml | 54 +++++++++++++++++++ 2 files changed, 58 insertions(+), 48 deletions(-) create mode 100644 ecom-dmb-backend/src/main/resources/config/channel-pdd.yml diff --git a/ecom-dmb-backend/src/main/resources/application.yml b/ecom-dmb-backend/src/main/resources/application.yml index aa1904dd..70f745ad 100644 --- a/ecom-dmb-backend/src/main/resources/application.yml +++ b/ecom-dmb-backend/src/main/resources/application.yml @@ -4,6 +4,9 @@ spring: profiles: active: dev + config: + import: + - optional:classpath:config/channel-pdd.yml jackson: time-zone: Asia/Shanghai # 配置404错误处理 - 注释掉,避免影响Swagger文档访问 @@ -129,54 +132,7 @@ oss: endpoint: https://oss-cn-guangzhou.aliyuncs.com bucket-name: xyquan -# 拼多多开放平台 OAuth -pdd: - oauth: - client-id: 9b71d887c8dc4b46998dedfdeca9b866 - client-secret: c626f640a6fd5f56b2c8c009a5eb2d5683e6b955 - redirect-uri: https://ecbi.newloop.top/api-dev/channel/pdd/auth/callback - authorize-url: https://fuwu.pinduoduo.com/service-market/auth - state-ttl-seconds: 600 - # POP 出站公共配置(限流、默认分页);业务同步配置见 order-sync - pop: - default-page-size: 100 - rate-limit: - enabled: true - acquire-wait-ms: 5000 - # 平台频控被动退避:2s → 5s → 15s - backoff-ms: [2000, 5000, 15000] - # 保守默认(约官方上限 60% 店铺余量 + 本 ISV 短窗);可按接口覆盖 - default-rule: - shop-limit: 6000 - shop-window-seconds: 60 - app-burst-limit: 800 - app-burst-window-seconds: 10 - apis: - pdd.order.list.get: - shop-limit: 6000 - shop-window-seconds: 60 - app-burst-limit: 800 - app-burst-window-seconds: 10 - pdd.order.number.list.increment.get: - shop-limit: 6000 - shop-window-seconds: 60 - app-burst-limit: 800 - app-burst-window-seconds: 10 - pdd.order.information.get: - shop-limit: 6000 - shop-window-seconds: 60 - app-burst-limit: 800 - app-burst-window-seconds: 10 - pdd.mall.info.get: - shop-limit: 6000 - shop-window-seconds: 60 - app-burst-limit: 800 - app-burst-window-seconds: 10 - order-sync: - overlap-seconds: 120 - lock-ttl-seconds: 600 - incremental-job-enabled: true - incremental-cron: "0 */5 * * * ?" +# 拼多多渠道配置见 config/channel-pdd.yml # License 授权(开关与公钥见 LicenseEnforcement 源码硬编码) ecom: diff --git a/ecom-dmb-backend/src/main/resources/config/channel-pdd.yml b/ecom-dmb-backend/src/main/resources/config/channel-pdd.yml new file mode 100644 index 00000000..46782aa8 --- /dev/null +++ b/ecom-dmb-backend/src/main/resources/config/channel-pdd.yml @@ -0,0 +1,54 @@ +# 拼多多渠道配置(OAuth / POP 出站 / 订单同步) +# 由 application.yml 通过 spring.config.import 引入 + +pdd: + oauth: + client-id: 9b71d887c8dc4b46998dedfdeca9b866 + client-secret: c626f640a6fd5f56b2c8c009a5eb2d5683e6b955 + # 须与开放平台应用回调一致;经网关时注意 /api-dev 与后端 /api 前缀 + redirect-uri: https://ecbi.newloop.top/api-dev/api/channel/pdd/auth/callback + authorize-url: https://fuwu.pinduoduo.com/service-market/auth + state-ttl-seconds: 600 + + # POP 出站:分页、限流;未在 apis 中声明的接口走 default-rule / 代码默认 + pop: + default-page-size: 100 + rate-limit: + enabled: true + acquire-wait-ms: 5000 + # 平台频控被动退避:2s → 5s → 15s + backoff-ms: [2000, 5000, 15000] + # 约官方上限 60% 单店余量 + 本 ISV 短窗 + default-rule: + shop-limit: 6000 + shop-window-seconds: 60 + app-burst-limit: 800 + app-burst-window-seconds: 10 + # 按 API type 覆盖(key 与 PddPopApiTypes 一致) + apis: + pdd.order.list.get: + shop-limit: 6000 + shop-window-seconds: 60 + app-burst-limit: 800 + app-burst-window-seconds: 10 + pdd.order.number.list.increment.get: + shop-limit: 6000 + shop-window-seconds: 60 + app-burst-limit: 800 + app-burst-window-seconds: 10 + pdd.order.information.get: + shop-limit: 6000 + shop-window-seconds: 60 + app-burst-limit: 800 + app-burst-window-seconds: 10 + pdd.mall.info.get: + shop-limit: 6000 + shop-window-seconds: 60 + app-burst-limit: 800 + app-burst-window-seconds: 10 + + order-sync: + overlap-seconds: 120 + lock-ttl-seconds: 600 + incremental-job-enabled: true + incremental-cron: "0 */5 * * * ?"