|
|
@@ -58,6 +58,20 @@ public class ProductController extends AppBaseController {
|
|
|
return R.error("操作异常");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation("获取分类")
|
|
|
+ @GetMapping("/getProductCateV2")
|
|
|
+ public R getProductCateV2(){
|
|
|
+ try {
|
|
|
+ FsStoreProductCategory param=new FsStoreProductCategory();
|
|
|
+ param.setIsShow(1);
|
|
|
+ param.setIsDel(0);
|
|
|
+ List<FsStoreProductCategory> list=categoryService.selectFsStoreProductCategoryListQuery(param);
|
|
|
+ return R.ok().put("data",list);
|
|
|
+ } catch (Exception e){
|
|
|
+ return R.error("操作异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
@ApiOperation("获取分类")
|
|
|
@GetMapping("/getProductCateByPid")
|
|
|
public R getProductCateByPid(@RequestParam(value="pid") Long pid){
|
|
|
@@ -73,6 +87,21 @@ public class ProductController extends AppBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("获取分类")
|
|
|
+ @GetMapping("/getProductCateByPidV2")
|
|
|
+ public R getProductCateByPidV2(@RequestParam(value="pid") Long pid){
|
|
|
+ try {
|
|
|
+ FsStoreProductCategory param=new FsStoreProductCategory();
|
|
|
+ param.setIsShow(1);
|
|
|
+ param.setIsDel(0);
|
|
|
+ param.setPid(pid);
|
|
|
+ List<FsStoreProductCategory> list=categoryService.selectFsStoreProductCategoryListQuery(param);
|
|
|
+ return R.ok().put("data",list);
|
|
|
+ } catch (Exception e){
|
|
|
+ return R.error("操作异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("获取商品列表")
|
|
|
@GetMapping("/getProducts")
|
|
|
public R getProducts(FsStoreProductQueryParam param){
|
|
|
@@ -88,6 +117,24 @@ public class ProductController extends AppBaseController {
|
|
|
PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(productList);
|
|
|
return R.ok().put("data",listPageInfo);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("获取商品列表")
|
|
|
+ @GetMapping("/getProductsV2")
|
|
|
+ public R getProductsV2(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);
|
|
|
+ PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(productList);
|
|
|
+ return R.ok().put("data",listPageInfo);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("获取商品详情")
|
|
|
@GetMapping("/getProductDetails")
|
|
|
public R getProductDetails(@RequestParam(value="productId") Long productId){
|
|
|
@@ -127,6 +174,46 @@ public class ProductController extends AppBaseController {
|
|
|
return R.ok().put("product",product).put("productAttr",productAttr).put("productValues",productValues);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation("获取商品详情")
|
|
|
+ @GetMapping("/getProductDetailsV2")
|
|
|
+ public R getProductDetailsV2(@RequestParam(value="productId") Long productId){
|
|
|
+ FsStoreProductQueryVO product=productService.selectFsStoreProductByIdQuery(productId);
|
|
|
+ if(product==null){
|
|
|
+ return R.error("商品不存在或已下架");
|
|
|
+ }
|
|
|
+ List<FsStoreProductAttr> productAttr=attrService.selectFsStoreProductAttrByProductId(product.getProductId());
|
|
|
+ List<FsStoreProductAttrValue> productValues=attrValueService.selectFsStoreProductAttrValueByProductId(product.getProductId());
|
|
|
+
|
|
|
+ //获取用户的TOKEN写入足迹
|
|
|
+ String userId=getUserId();
|
|
|
+ if(userId!=null){
|
|
|
+ FsStoreProductRelation productRelation=new FsStoreProductRelation();
|
|
|
+ productRelation.setIsDel(0);
|
|
|
+ productRelation.setUserId(Long.parseLong(userId));
|
|
|
+ productRelation.setProductId(product.getProductId());
|
|
|
+ productRelation.setType("foot");
|
|
|
+ List<FsStoreProductRelation> productRelations=productRelationService.selectFsStoreProductRelationList(productRelation);
|
|
|
+ if(productRelations!=null&&productRelations.size()>0){
|
|
|
+ FsStoreProductRelation relation=productRelations.get(0);
|
|
|
+ relation.setUpdateTime(new Date());
|
|
|
+ productRelationService.updateFsStoreProductRelation(relation);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ FsStoreProductRelation relation=new FsStoreProductRelation();
|
|
|
+ relation.setUserId(Long.parseLong(userId));
|
|
|
+ relation.setIsDel(0);
|
|
|
+ relation.setProductId(product.getProductId());
|
|
|
+ relation.setUpdateTime(new Date());
|
|
|
+ relation.setType("foot");
|
|
|
+ relation.setCreateTime(new Date());
|
|
|
+ relation.setUpdateTime(new Date());
|
|
|
+ productRelationService.insertFsStoreProductRelation(relation);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.ok().put("product",product).put("productAttr",productAttr).put("productValues",productValues);
|
|
|
+ }
|
|
|
+
|
|
|
@Login
|
|
|
@ApiOperation("添加购物车")
|
|
|
@PostMapping("/addCart")
|
|
|
@@ -163,6 +250,15 @@ public class ProductController extends AppBaseController {
|
|
|
return R.ok().put("data", count);
|
|
|
}
|
|
|
|
|
|
+ @Login
|
|
|
+ @ApiOperation("获取商品购物车数量")
|
|
|
+ @GetMapping("/getCartCountV2")
|
|
|
+ public R getCartCountV2(FsStoreCartCountParam param){
|
|
|
+ param.setUserId(Long.parseLong(getUserId()));
|
|
|
+ Integer count=cartService.selectFsStoreCartCount(param);
|
|
|
+ return R.ok().put("data", count);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("获取推荐商品列表")
|
|
|
@GetMapping("/getTuiProduct")
|
|
|
public R getTuiProduct(){
|
|
|
@@ -195,9 +291,52 @@ public class ProductController extends AppBaseController {
|
|
|
PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(list);
|
|
|
return R.ok().put("data",listPageInfo);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation("获取推荐商品数据")
|
|
|
+ @GetMapping("/getTuiProductsV2")
|
|
|
+ public R getTuiProductsV2(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 = 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,String appId){
|
|
|
+ public R getFavoriteProducts(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 = new ArrayList<>();
|
|
|
+ if (flag){
|
|
|
+ list=productService.selectFsStoreProductGoodListQuerySp();
|
|
|
+ }else {
|
|
|
+ list=productService.selectFsStoreProductGoodListQuery();
|
|
|
+ }
|
|
|
+ PageInfo<FsStoreProductListQueryVO> listPageInfo=new PageInfo<>(list);
|
|
|
+ return R.ok().put("data",listPageInfo);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("获取喜欢商品数据")
|
|
|
+ @GetMapping("/getGoodsProductsV2")
|
|
|
+ public R getGoodsProductsV2(BaseQueryParam param,String appId){
|
|
|
boolean flag=false;
|
|
|
if (appId!=null){
|
|
|
FsCoursePlaySourceConfig config = coursePlaySourceConfigService.selectFsCoursePlaySourceConfigByAppId(appId);
|
|
|
@@ -228,4 +367,4 @@ public class ProductController extends AppBaseController {
|
|
|
|
|
|
|
|
|
|
|
|
-}
|
|
|
+}
|