|
|
@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -37,6 +38,8 @@ public class ProductController extends AppBaseController {
|
|
|
private IFsStoreCartService cartService;
|
|
|
@Autowired
|
|
|
private IFsStoreProductRelationService productRelationService;
|
|
|
+ @Autowired
|
|
|
+ private IFsCoursePlaySourceConfigService coursePlaySourceConfigService;
|
|
|
|
|
|
/**
|
|
|
* 获取用户信息
|
|
|
@@ -73,6 +76,12 @@ public class ProductController extends AppBaseController {
|
|
|
@ApiOperation("获取商品列表")
|
|
|
@GetMapping("/getProducts")
|
|
|
public R getProducts(FsStoreProductQueryParam param){
|
|
|
+ if (param.getAppId()!=null){
|
|
|
+ FsCoursePlaySourceConfig config = coursePlaySourceConfigService.selectFsCoursePlaySourceConfigByAppId(param.getAppId());
|
|
|
+ if (config!=null && config.getSpecialMini()==1){
|
|
|
+ param.setSpecialProducts(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
PageHelper.startPage(param.getPage(), param.getPageSize());
|
|
|
param.setIsDisplay(1);
|
|
|
List<FsStoreProductListQueryVO> productList=productService.selectFsStoreProductListQuery(param);
|
|
|
@@ -168,17 +177,41 @@ public class ProductController extends AppBaseController {
|
|
|
}
|
|
|
@ApiOperation("获取推荐商品数据")
|
|
|
@GetMapping("/getTuiProducts")
|
|
|
- public R getTuiProducts(BaseQueryParam param){
|
|
|
+ public R getTuiProducts(BaseQueryParam param,String appId){
|
|
|
+ boolean flag=false;
|
|
|
+ if (appId!=null){
|
|
|
+ FsCoursePlaySourceConfig config = coursePlaySourceConfigService.selectFsCoursePlaySourceConfigByAppId(appId);
|
|
|
+ if (config!=null && config.getSpecialMini()==1){
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
PageHelper.startPage(param.getPage(), param.getPageSize());
|
|
|
- List<FsStoreProductListQueryVO> list=productService.selectFsStoreProductTuiListQuery();
|
|
|
+ List<FsStoreProductListQueryVO> list = new ArrayList<>();
|
|
|
+ if (flag){
|
|
|
+ list=productService.selectFsStoreProductTuiListQuerySp();
|
|
|
+ }else {
|
|
|
+ list=productService.selectFsStoreProductTuiListQuery();
|
|
|
+ }
|
|
|
PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(list);
|
|
|
return R.ok().put("data",listPageInfo);
|
|
|
}
|
|
|
@ApiOperation("获取喜欢商品数据")
|
|
|
@GetMapping("/getGoodsProducts")
|
|
|
- public R getGoodsProducts(BaseQueryParam param){
|
|
|
+ public R getGoodsProducts(BaseQueryParam param,String appId){
|
|
|
+ boolean flag=false;
|
|
|
+ if (appId!=null){
|
|
|
+ FsCoursePlaySourceConfig config = coursePlaySourceConfigService.selectFsCoursePlaySourceConfigByAppId(appId);
|
|
|
+ if (config!=null && config.getSpecialMini()==1){
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
PageHelper.startPage(param.getPage(), param.getPageSize());
|
|
|
- List<FsStoreProductListQueryVO> list=productService.selectFsStoreProductGoodListQuery();
|
|
|
+ List<FsStoreProductListQueryVO> list = new ArrayList<>();
|
|
|
+ if (flag){
|
|
|
+ list=productService.selectFsStoreProductGoodListQuerySp();
|
|
|
+ }else {
|
|
|
+ list=productService.selectFsStoreProductGoodListQuery();
|
|
|
+ }
|
|
|
PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(list);
|
|
|
return R.ok().put("data",listPageInfo);
|
|
|
|