This commit is contained in:
2026-08-20 15:25:40 +08:00
parent b55b049e77
commit cd34cd426e
14 changed files with 170 additions and 49 deletions
@@ -13,15 +13,15 @@ import java.util.Map;
* 尾程预留服务状态接口,用于验证尾程服务边界及基础可用性。
*/
@Tag(
name = "Last-leg service status / 尾程服务状态",
description = "Last-leg reserved service availability API. / 尾程预留服务的可用性接口。"
name = "尾程服务状态",
description = "尾程服务可用性接口"
)
@RestController
@RequestMapping("/api/platform/v1/last-leg")
public class LastlegHealthController {
@Operation(
summary = "Get service status / 查询服务状态",
description = "Returns the logical status of the reserved lastleg-service boundary. / 返回预留 lastleg-service 边界的逻辑运行状态。"
summary = "查询服务状态",
description = "返回尾程服务边界的逻辑运行状态"
)
@io.swagger.v3.oas.annotations.responses.ApiResponse(
responseCode = "200",
@@ -32,14 +32,15 @@ import org.springframework.web.server.ResponseStatusException;
import java.nio.charset.StandardCharsets;
@RestController
@Tag(name = "Tail-leg orders")
@Tag(name = "尾程订单")
public class LastlegOrderController {
@Resource private LoadingCompletedConsumer consumer;
@Resource private LastlegOrderService orderService;
@Resource private InternalServiceTokenGuard tokenGuard;
@PostMapping("/internal/lastleg/events")
@Operation(summary = "Receive a first-leg loading-completed event")
/** 接收头程装柜完成事件并创建尾程订单。 */
@Operation(summary = "接收头程装柜完成事件")
public ApiResponse<Integer> receive(
@RequestHeader(value = "X-Internal-Service-Token", required = false) String token,
@RequestBody EventEnvelope event) {
@@ -48,7 +49,8 @@ public class LastlegOrderController {
}
@GetMapping("/api/platform/v1/last-leg/orders")
@Operation(summary = "Page tail-leg order rows")
/** 分页查询尾程订单列表。 */
@Operation(summary = "分页查询尾程订单")
public ApiResponse<PageResult<LastlegOrderSummary>> list(
@AuthenticationPrincipal AuthenticatedUser user,
@RequestParam(required = false) String customerId,
@@ -57,7 +59,8 @@ public class LastlegOrderController {
}
@GetMapping("/api/platform/v1/last-leg/orders/{id}")
@Operation(summary = "Get one inbound-code-level tail-leg order")
/** 查询指定入仓单维度的尾程订单详情。 */
@Operation(summary = "查询尾程订单详情")
public ApiResponse<LastlegOrderDetailResponse> detail(
@AuthenticationPrincipal AuthenticatedUser user,
@RequestParam(required = false) String customerId,
@@ -66,7 +69,8 @@ public class LastlegOrderController {
}
@GetMapping(value = "/api/platform/v1/last-leg/orders/export", produces = "text/csv")
@Operation(summary = "Export filtered tail-leg orders as UTF-8 CSV")
/** 按筛选条件导出尾程订单 CSV 文件。 */
@Operation(summary = "导出尾程订单")
public ResponseEntity<byte[]> export(
@AuthenticationPrincipal AuthenticatedUser user,
@RequestParam(required = false) String customerId,
@@ -79,7 +83,8 @@ public class LastlegOrderController {
}
@PutMapping("/api/platform/v1/last-leg/orders/{id}/destination")
@Operation(summary = "Transfer one order to a destination warehouse")
/** 将单个尾程订单转移到目标仓库。 */
@Operation(summary = "单个订单转移仓库")
public ApiResponse<Integer> transferOne(
@AuthenticationPrincipal AuthenticatedUser user,
@RequestParam(required = false) String customerId,
@@ -89,7 +94,8 @@ public class LastlegOrderController {
}
@PutMapping("/api/platform/v1/last-leg/orders/destination")
@Operation(summary = "Transfer multiple orders to a destination warehouse")
/** 将多个尾程订单批量转移到目标仓库。 */
@Operation(summary = "批量订单转移仓库")
public ApiResponse<Integer> transferBatch(
@AuthenticationPrincipal AuthenticatedUser user,
@RequestParam(required = false) String customerId,