Kaynağa Gözat

本区没有商家,然后扩大到市级的范围查询

liude 11 ay önce
ebeveyn
işleme
a4ba102ae6

+ 2 - 0
src/main/java/com/chelvc/cloud/maintain/controller/FavoriteController.java

@@ -56,6 +56,8 @@ public class FavoriteController {
      */
     @GetMapping("/favorites")
     public List<FavoriteVO> listUserFavorites(@Valid FavoriteQueryParam param) {
+        param.setCode((param.getRegion()/100)*100);
+        param.setBoundary((param.getRegion()/100)*100+99);
         // 查询收藏的店铺
         if (FavoriteType.MERCHANT.equals(param.getType())) {
             List<FavoriteDTO> favoriteMerchants = this.favoriteClient.listFavoriteMerchants(param);

+ 4 - 0
src/main/java/com/chelvc/cloud/maintain/controller/HotMerchantController.java

@@ -48,6 +48,8 @@ public class HotMerchantController {
      */
     @PostMapping("/listHotMerchant/")
     public List<MerchantDTO> listHotMerchant(@Valid @RequestBody LocationQueryParam param) {
+        param.setCode((param.getRegion()/100)*100);
+        param.setBoundary((param.getRegion()/100)*100+99);
         return this.hotMerchantClient.listHotMerchant(param);
     }
 
@@ -58,6 +60,8 @@ public class HotMerchantController {
      */
     @PostMapping("/likeMerchant/")
     public List<MerchantDTO> likeMerchant(@Valid @RequestBody LocationQueryParam param) {
+        param.setCode((param.getRegion()/100)*100);
+        param.setBoundary((param.getRegion()/100)*100+99);
         return this.hotMerchantClient.likeMerchant(param);
     }
 

+ 4 - 0
src/main/java/com/chelvc/cloud/maintain/controller/IndexController.java

@@ -81,6 +81,8 @@ public class IndexController {
     @Authorize(enabled = false)
     @GetMapping("/customer/index")
     public CustomerIndexVO getCustomerIndex(@Valid LocationQueryParam param) {
+        param.setCode((param.getRegion()/100)*100);
+        param.setBoundary((param.getRegion()/100)*100+99);
         CustomerIndexVO index = CustomerIndexVO.builder().build();
 
         // 加载推荐分类列表
@@ -120,6 +122,8 @@ public class IndexController {
      */
     @GetMapping("/merchant/indexMerchantPaging")
     public Pagination<MerchantDTO> indexMerchantPaging(@Valid LocationQueryPagingParam param) {
+        param.setCode((param.getRegion()/100)*100);
+        param.setBoundary((param.getRegion()/100)*100+99);
         return merchantClient.indexMerchantPaging(param);
     }
 }

+ 4 - 0
src/main/java/com/chelvc/cloud/maintain/controller/MerchantController.java

@@ -57,6 +57,8 @@ public class MerchantController {
      */
     @GetMapping("/merchantSort")
     public List<SimpleMerchantVO> listSimpleMerchants(@Valid MerchantQueryParam param) {
+        param.setCode((param.getRegion()/100)*100);
+        param.setBoundary((param.getRegion()/100)*100+99);
         return MerchantCopier.INSTANCE.copying(this.merchantClient.listSimpleMerchants(param));
     }
 
@@ -81,6 +83,8 @@ public class MerchantController {
     @GetMapping("/merchant/{id}")
     public MerchantDetailDTO getMerchantDetail(@PathVariable("id") @Min(value = 1, message = "商家ID不能小于1") Long id,
                                                @Valid LocationQueryParam param) {
+        param.setCode((param.getRegion()/100)*100);
+        param.setBoundary((param.getRegion()/100)*100+99);
         return this.merchantClient.queryMerchantDetail(id, param);
     }