This commit is contained in:
2026-08-08 13:51:28 +08:00
parent 374ceed493
commit f690abbaeb
3 changed files with 6 additions and 6 deletions
@@ -6,7 +6,6 @@ import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
/** Internal Warehouse contract for a customer's default overseas storage fees. */
@FeignClient(name = "warehouse-service", contextId = "overseasStorageFeeClient",
@@ -20,9 +19,9 @@ public interface OverseasStorageFeeClient {
@DeleteMapping("/defaults")
ApiResponse<Void> compensate(@RequestHeader("X-Internal-Service-Token") String token,
@RequestParam long tenantId,
@RequestParam String initializationKey);
@RequestBody CompensationRequest request);
record InitializationRequest(long tenantId, long operatorId, String initializationKey) { }
record InitializationResponse(Long configId, boolean createdByThisInitialization) { }
record CompensationRequest(long tenantId, String initializationKey) { }
}
@@ -72,7 +72,8 @@ public class OverseasStorageFeeInitializationService {
RuntimeException last = null;
for (int attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
try {
ApiResponse<Void> response = client.compensate(internalToken, tenantId, key);
ApiResponse<Void> response = client.compensate(internalToken,
new OverseasStorageFeeClient.CompensationRequest(tenantId, key));
if (response != null && response.successful()) return;
last = unavailable(response);
} catch (RuntimeException ex) { last = ex; }