抢购货品同步
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user