28 lines
1.3 KiB
Java
28 lines
1.3 KiB
Java
package com.baiyue.firstleg.client;
|
|
|
|
import com.baiyue.common.core.api.ApiResponse;
|
|
import org.springframework.cloud.openfeign.FeignClient;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.RequestHeader;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import java.util.List;
|
|
|
|
@FeignClient(name = "warehouse-service", contextId = "firstlegWarehouseSupplierClient",
|
|
url = "${baiyue.clients.warehouse.url:}", path = "/internal/warehouse/v1/suppliers")
|
|
public interface WarehouseSupplierClient {
|
|
@GetMapping("/{supplierId}")
|
|
ApiResponse<Snapshot> get(@RequestHeader("X-Internal-Service-Token") String token,
|
|
@PathVariable long supplierId,
|
|
@RequestParam(defaultValue = "true") boolean requireActive,
|
|
@RequestParam(required = false) String category);
|
|
|
|
@GetMapping
|
|
ApiResponse<List<Snapshot>> candidates(@RequestHeader("X-Internal-Service-Token") String token,
|
|
@RequestParam String category,
|
|
@RequestParam String carrierCode);
|
|
|
|
record Snapshot(long supplierId, String name, String category, String status,
|
|
List<String> carrierCodes) {}
|
|
}
|