同步接口增加 token参数

This commit is contained in:
2026-05-28 21:00:51 +08:00
parent 608e5a7adc
commit 246c5a7080
4 changed files with 32 additions and 12 deletions

View File

@@ -117,10 +117,14 @@ public class LbGoodsController {
summary = "从 hxrd 第三方同步货品",
description =
"分页调用 GET /api/order/goods每页 limit=20自动计算 S/T/N 签名),"
+ "解析 data.list 后 upsert 到 lb_goods需配置 hxr.admin.goods-api-token、goods-api-app-str")
+ "解析 data.list 后 upsert 到 lb_goods需配置 hxr.admin.goods-api-token、goods-api-app-str"
+ "token 可选,传入时替代配置中的 goods-api-token")
public ResponseEntity<Map<String, Object>> syncFromHxr(
@Parameter(description = "租户 id", required = true) @RequestParam String tenantId) {
Map<String, Object> result = lbGoodsService.syncFromHxrGoods(tenantId);
@Parameter(description = "租户 id", required = true) @RequestParam String tenantId,
@Parameter(description = "hxrd 接口请求头 token未传时使用 hxr.admin.goods-api-token")
@RequestParam(required = false)
String token) {
Map<String, Object> result = lbGoodsService.syncFromHxrGoods(tenantId, token);
Boolean success = (Boolean) result.get("success");
if (success != null && success) {
return ResponseEntity.ok(result);