Pārlūkot izejas kodu

设计优化,修改BUG

liude 1 gadu atpakaļ
vecāks
revīzija
83f114eec3

+ 3 - 2
vehicle-client/src/main/java/com/chelvc/cloud/vehicle/client/AssetClient.java

@@ -4,10 +4,11 @@ import com.chelvc.cloud.vehicle.client.dto.MerchantAssetDTO;
 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.RequestParam;
 
 @FeignClient("vehicle")
 public interface AssetClient {
 
-    @GetMapping("/asset/merchant/{merchantId}")
-    public MerchantAssetDTO getMerchantAsset(@PathVariable("merchantId") Long merchantId);
+    @GetMapping("/asset/merchant")
+    public MerchantAssetDTO getMerchantAsset(@RequestParam("merchantId") Long merchantId);
 }

+ 3 - 2
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/controller/AssetController.java

@@ -6,6 +6,7 @@ import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 @RestController
@@ -14,8 +15,8 @@ public class AssetController {
 
     private final AssetService assetService;
 
-    @GetMapping("/asset/merchant/{merchantId}")
-    public MerchantAssetDTO getMerchantAsset(@PathVariable("merchantId") Long merchantId) {
+    @GetMapping("/asset/merchant")
+    public MerchantAssetDTO getMerchantAsset(@RequestParam("merchantId") Long merchantId) {
         return this.assetService.getMerchantAsset(merchantId);
     }
 }