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, "内部服务凭证无效");