|
@@ -1,12 +1,10 @@
|
|
|
package com.caimei.module.product.service.impl;
|
|
|
|
|
|
-import com.caimei.module.base.entity.bo.JsonModel;
|
|
|
import com.caimei.module.base.entity.bo.PageVo;
|
|
|
-import com.caimei.module.product.dao.ProductModuleDao;
|
|
|
import com.caimei.module.base.entity.vo.*;
|
|
|
+import com.caimei.module.product.dao.ProductModuleDao;
|
|
|
import com.caimei.module.product.service.ProductModuleService;
|
|
|
import com.caimei.module.product.util.ProductUtils;
|
|
|
-import com.github.pagehelper.Page;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -132,21 +130,18 @@ public class ProductModuleServiceImpl implements ProductModuleService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public PageVo<ProductVo> getRecommended(Integer productID, Integer pageNum, Integer pageSize) {
|
|
|
+ public List<ProductVo> getRecommended(Integer productID) {
|
|
|
ProductVo product = productModuleDao.findProductById(productID);
|
|
|
- pageNum = null != pageNum ? pageNum : 1;
|
|
|
- pageSize = null != pageSize ? pageSize : 7;
|
|
|
List<ProductVo> productList = null;
|
|
|
if ("1".equals(product.getRecommendType())) {
|
|
|
List<Integer> productIDs = productModuleDao.getRecommendIds(productID);
|
|
|
if (productIDs != null && productIDs.size() > 0) {
|
|
|
- PageHelper.startPage(pageNum, pageSize);
|
|
|
productList = productModuleDao.getRecommendByIds(productIDs);
|
|
|
}
|
|
|
} else {
|
|
|
productList = productModuleDao.getDeFaultRecommend(product.getTinyTypeID());
|
|
|
}
|
|
|
- return new PageVo<>(productList);
|
|
|
+ return productList;
|
|
|
}
|
|
|
|
|
|
/**
|