抢购货品同步

This commit is contained in:
2026-05-26 17:25:55 +08:00
parent 32fce665ea
commit 947bb21c8b
9 changed files with 327 additions and 0 deletions

View File

@@ -110,4 +110,20 @@ public class LbGoodsController {
}
return ResponseEntity.internalServerError().body(result);
}
@PostMapping("/sync-from-hxr")
@Operation(
summary = "从 hxrd 第三方同步货品",
description =
"分页调用 GET /api/order/goods每页 limit=20请求头 token"
+ "解析 data.list 后 upsert 到 lb_goods需配置 hxr.admin.goods-api-token")
public ResponseEntity<Map<String, Object>> syncFromHxr(
@Parameter(description = "租户 id", required = true) @RequestParam String tenantId) {
Map<String, Object> result = lbGoodsService.syncFromHxrGoods(tenantId);
Boolean success = (Boolean) result.get("success");
if (success != null && success) {
return ResponseEntity.ok(result);
}
return ResponseEntity.badRequest().body(result);
}
}