This commit is contained in:
2026-09-20 14:22:06 +08:00
parent 493d62e04c
commit b9e0c8ea2f
29 changed files with 1078 additions and 17 deletions
@@ -12,6 +12,8 @@ import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -58,6 +60,15 @@ public class InternalPriceBookController {
request.channelCode(), request.destinationType(), request.requireInboundCodePrefix()));
}
@GetMapping("/channels")
public ApiResponse<java.util.List<com.baiyue.firstleg.dto.PriceBookDtos.CurrentChannel>> channels(
@RequestHeader(value = "X-Internal-Service-Token", required = false) String token,
@RequestParam long tenantId,
@RequestParam long originWarehouseId) {
requireToken(token);
return ApiResponse.success(service.channels(tenantId, originWarehouseId));
}
private void requireToken(String token) {
if (token == null || !MessageDigest.isEqual(expectedToken, token.getBytes(StandardCharsets.UTF_8))) {
throw new BizException(ResultCode.FORBIDDEN, "内部服务凭证无效");
@@ -136,6 +136,17 @@ paths:
requireInboundCodePrefix: {type: boolean}
responses:
'200': {description: 成功时 data 返回 channelCode;requireInboundCodePrefix=true 时同时返回 inboundCodePrefix}
/internal/firstleg/v1/pricing/channels:
get:
summary: 查询指定客户和起运仓当前可用渠道
description: 仅供订单服务的旧系统导入解析使用,不经公网网关暴露。
security:
- internalServiceToken: []
parameters:
- {name: tenantId, in: query, required: true, schema: {type: string, pattern: '^[1-9][0-9]*$'}}
- {name: originWarehouseId, in: query, required: true, schema: {type: string, pattern: '^[1-9][0-9]*$'}}
responses:
'200': {description: 返回当前有效价格簿中的渠道编码和名称}
/internal/firstleg/v1/pricing/order-channel-changes/validate:
post:
summary: Order 提交渠道变更前校验 Firstleg 计价资格与费用可逆性