|
@@ -2,12 +2,14 @@ package com.chelvc.cloud.maintain.controller;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
+import com.chelvc.cloud.maintain.copier.CategoryCopier;
|
|
|
import com.chelvc.cloud.maintain.copier.MerchantCopier;
|
|
|
import com.chelvc.cloud.maintain.param.CustomerIndexParam;
|
|
|
import com.chelvc.cloud.maintain.vo.ConfigurationVO;
|
|
|
import com.chelvc.cloud.maintain.vo.CustomerIndexVO;
|
|
|
import com.chelvc.cloud.uc.api.service.UsageService;
|
|
|
import com.chelvc.cloud.vehicle.api.param.NearbyQueryParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.service.CategoryService;
|
|
|
import com.chelvc.cloud.vehicle.api.service.MerchantService;
|
|
|
import com.chelvc.framework.base.annotation.UnifiedResponseBody;
|
|
|
import com.chelvc.framework.base.context.ApplicationContextHolder;
|
|
@@ -32,6 +34,9 @@ public class IndexController {
|
|
|
@DubboReference
|
|
|
private UsageService usageService;
|
|
|
|
|
|
+ @DubboReference
|
|
|
+ private CategoryService categoryService;
|
|
|
+
|
|
|
@DubboReference
|
|
|
private MerchantService merchantService;
|
|
|
|
|
@@ -74,18 +79,25 @@ public class IndexController {
|
|
|
.latitude(param.getLatitude()).distance(this.getNearbyDistance()).build();
|
|
|
CustomerIndexVO index = CustomerIndexVO.builder().build();
|
|
|
|
|
|
+ // 加载推荐分类列表
|
|
|
+ try {
|
|
|
+ index.setCategories(CategoryCopier.INSTANCE.copying(this.categoryService.listRecommendCategories(15)));
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("Load recommend categories failed", e);
|
|
|
+ }
|
|
|
+
|
|
|
// 加载附近商家列表
|
|
|
try {
|
|
|
index.setNears(MerchantCopier.INSTANCE.copying(this.merchantService.listNearbyMerchants(query, 4)));
|
|
|
} catch (Exception e) {
|
|
|
- log.error("Nearby merchants load failed", e);
|
|
|
+ log.error("Load nearby merchants failed", e);
|
|
|
}
|
|
|
|
|
|
// 加载推荐商家列表
|
|
|
try {
|
|
|
index.setRecommends(MerchantCopier.INSTANCE.copying(this.merchantService.listRecommendMerchants(query, 4)));
|
|
|
} catch (Exception e) {
|
|
|
- log.error("Recommend merchants load failed", e);
|
|
|
+ log.error("Load recommend merchants failed", e);
|
|
|
}
|
|
|
return index;
|
|
|
}
|