瀏覽代碼

Merge branch 'master' of http://gogs.chelvc.com/wuyongqiang/maintain

woody 1 年之前
父節點
當前提交
16ad1573dc

+ 9 - 14
src/main/java/com/chelvc/cloud/maintain/controller/CurrencyRecordController.java

@@ -1,7 +1,7 @@
 package com.chelvc.cloud.maintain.controller;
-import com.chelvc.cloud.vehicle.api.dto.CarouselImagesDTO;
+
 import com.chelvc.cloud.vehicle.api.dto.CurrencyRecordDTO;
-import com.chelvc.cloud.vehicle.api.service.CarouselImagesService;
+import com.chelvc.cloud.vehicle.api.dto.EarningsDTO;
 import com.chelvc.cloud.vehicle.api.service.CurrencyRecordService;
 import com.chelvc.framework.base.annotation.ResponseWrapping;
 import org.apache.dubbo.config.annotation.DubboReference;
@@ -9,8 +9,8 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.validation.constraints.NotNull;
 import java.util.List;
-import java.util.Map;
 
 /**
  * 收益记录接口
@@ -28,25 +28,20 @@ public class CurrencyRecordController {
     /**
      * 用户收益记录列表查询
      *
-     * @param
+     * @param type 类型:0-平台;1-用户;2-商户
      */
     @GetMapping("/listCurrencyRecord")
-    public List<CurrencyRecordDTO> listCurrencyRecord() {
-        return this.currencyRecordService.listCurrencyRecord();
+    public List<CurrencyRecordDTO> listCurrencyRecord(@NotNull(message = "查询类型不能为空") Integer type) {
+        return this.currencyRecordService.listCurrencyRecord(type);
     }
 
     /**
      * 用户获取用户得总收益、本周收益、本月收益、可提现金额
      *
-     * @param
+     * @param type 类型:0-平台;1-用户;2-商户
      */
     @GetMapping("/getCurrencyRecord")
-    public Map<String,Object> getCurrencyRecord() {
-        return this.currencyRecordService.getCurrencyRecord();
+    public EarningsDTO getCurrencyRecord(@NotNull(message = "查询类型不能为空") Integer type) {
+        return this.currencyRecordService.getCurrencyRecord(type);
     }
-
-
-
-
-
 }

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

@@ -99,7 +99,7 @@ public class IndexController {
 
         // 加载推荐分类列表
         try {
-            List<CategoryDTO> categories = this.categoryService.listRecommendCategories(15);
+            List<CategoryDTO> categories = this.categoryService.listRecommendCategories(param.getPageSize().getCatPageSize());
             index.setCategories(CategoryCopier.INSTANCE.copying(categories));
         } catch (Exception e) {
             log.error("Load recommend categories failed", e);
@@ -107,7 +107,7 @@ public class IndexController {
 
         // 加载附近商家列表
         try {
-            List<MerchantDTO> merchants = this.merchantService.listNearbyMerchants(param, 4);
+            List<MerchantDTO> merchants = this.merchantService.listNearbyMerchants(param, param.getPageSize().getNearPageSize());
             index.setNears(MerchantCopier.INSTANCE.copying(merchants));
         } catch (Exception e) {
             log.error("Load nearby merchants failed", e);
@@ -115,7 +115,7 @@ public class IndexController {
 
         // 加载推荐商家列表
         try {
-            List<MerchantDTO> merchants = this.merchantService.listRecommendMerchants(param, 4);
+            List<MerchantDTO> merchants = this.merchantService.listRecommendMerchants(param, param.getPageSize().getRecPageSize());
             index.setRecommends(MerchantCopier.INSTANCE.copying(merchants));
         } catch (Exception e) {
             log.error("Load recommend merchants failed", e);