This commit is contained in:
2026-08-15 11:14:50 +08:00
parent fdea2a6f31
commit dfa3e8cc53
@@ -23,7 +23,7 @@ import java.util.Locale;
public class PlatformPartnerQueryService {
private static final long PUBLIC_TENANT_ID = 0L;
private static final Set<String> ALLOWED_QUERY_TYPES = Set.of(
"CUSTOMER", "CARRIER", "SHIPPER", "CONSIGNEE");
"CARRIER", "SHIPPER", "CONSIGNEE");
@Resource
private PartnerRepository repository;
@@ -148,7 +148,7 @@ public class PlatformPartnerQueryService {
}
if (normalized.isEmpty()) throw new BizException(ResultCode.BAD_REQUEST, "请至少选择一个单位类型");
if (normalized.stream().anyMatch(type -> !ALLOWED_QUERY_TYPES.contains(type))) {
throw new BizException(ResultCode.VALIDATION_FAILED, "往来单位仅支持 CUSTOMER、CARRIER、SHIPPER、CONSIGNEE");
throw new BizException(ResultCode.VALIDATION_FAILED, "往来单位仅支持 CARRIER、SHIPPER、CONSIGNEE");
}
return List.copyOf(normalized);
}