|
@@ -5,6 +5,7 @@ import com.caimei365.user.model.dto.BaikeProductDto;
|
|
import com.caimei365.user.model.dto.ShopArticleDto;
|
|
import com.caimei365.user.model.dto.ShopArticleDto;
|
|
import com.caimei365.user.model.dto.ShopBannerDto;
|
|
import com.caimei365.user.model.dto.ShopBannerDto;
|
|
import com.caimei365.user.model.dto.ShopUpdateDto;
|
|
import com.caimei365.user.model.dto.ShopUpdateDto;
|
|
|
|
+import com.caimei365.user.model.po.BaikeProductPo;
|
|
import com.caimei365.user.model.vo.*;
|
|
import com.caimei365.user.model.vo.*;
|
|
import com.caimei365.user.service.ShopService;
|
|
import com.caimei365.user.service.ShopService;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
@@ -236,12 +237,14 @@ public class ShopApi {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation("百科商品分类列表")
|
|
@ApiOperation("百科商品分类列表")
|
|
|
|
+ @ApiImplicitParam(required = true, name = "commodityType",value = "百科分类:1产品,2仪器")
|
|
@GetMapping("/baike/product/type/list")
|
|
@GetMapping("/baike/product/type/list")
|
|
public ResponseJson<List<BaikeProductTypeVo>> getBaikeProductTypeList(Integer commodityType){
|
|
public ResponseJson<List<BaikeProductTypeVo>> getBaikeProductTypeList(Integer commodityType){
|
|
return shopService.getBaikeProductTypeList(commodityType);
|
|
return shopService.getBaikeProductTypeList(commodityType);
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation("删除百科商品")
|
|
@ApiOperation("删除百科商品")
|
|
|
|
+ @ApiImplicitParam(required = true, name = "productId",value = "百科商品id")
|
|
@PostMapping("/baike/product/delete")
|
|
@PostMapping("/baike/product/delete")
|
|
public ResponseJson<Void> deleteBaikeProduct(Integer productId){
|
|
public ResponseJson<Void> deleteBaikeProduct(Integer productId){
|
|
return shopService.deleteBaikeProduct(productId);
|
|
return shopService.deleteBaikeProduct(productId);
|
|
@@ -257,5 +260,74 @@ public class ShopApi {
|
|
return shopService.getSensitiveWords(checkPoint);
|
|
return shopService.getSensitiveWords(checkPoint);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation("百科相关推荐表单")
|
|
|
|
+ @ApiImplicitParam(required = true, name = "productId", value = "百科产品id")
|
|
|
|
+ @GetMapping("/baike/recommend/form")
|
|
|
|
+ public ResponseJson<Map<String,Object>> baikeRecommendForm(Integer productId){
|
|
|
|
+ return shopService.getBaikeRecommendForm(productId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("百科相关推荐添加产品列表")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(required = true, name = "productId", value = "百科产品id"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "typeId", value = "分类id"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "name", value = "名称"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
|
|
|
|
+ @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
|
|
|
|
+ })
|
|
|
|
+ @GetMapping("/baike/recommend/add/list")
|
|
|
|
+ public ResponseJson<PageInfo<BaikeProductListVo>> addRecommendList(Integer productId, Integer typeId, String name,
|
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
|
|
|
|
+ if (null == productId) {
|
|
|
|
+ return ResponseJson.error("百科产品id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (null == typeId) {
|
|
|
|
+ return ResponseJson.error("分类id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ return shopService.getAddRecommendList(productId, typeId, name, pageNum, pageSize);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("百科相关推荐添加产品")
|
|
|
|
+ @PostMapping("/baike/recommend/add")
|
|
|
|
+ public ResponseJson<Void> addBaikeRecommend(BaikeProductDto baikeProduct){
|
|
|
|
+ if (null == baikeProduct.getProductId()) {
|
|
|
|
+ return ResponseJson.error("商品id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ return shopService.addBaikeRecommend(baikeProduct);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ @ApiOperation("百科相关推荐删除产品")
|
|
|
|
+ @ApiImplicitParam(required = true, name = "recommendId", value = "相关推荐id")
|
|
|
|
+ @PostMapping("/baike/recommend/delete")
|
|
|
|
+ public ResponseJson<Void> deleteBaikeRecommend(Integer recommendId){
|
|
|
|
+ if (null == recommendId) {
|
|
|
|
+ return ResponseJson.error("相关推荐id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ return shopService.deleBaikeRecommend(recommendId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("百科相关推荐更改排序")
|
|
|
|
+ @PostMapping("/baike/recommend/sort/save")
|
|
|
|
+ public ResponseJson<Void> saveRecommendSort(BaikeRecommendVo baikeRecommend){
|
|
|
|
+ if (null == baikeRecommend.getRecommendId()) {
|
|
|
|
+ return ResponseJson.error("相关推荐id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (null == baikeRecommend.getSort()) {
|
|
|
|
+ return ResponseJson.error("排序值不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ return shopService.saveRecommendSort(baikeRecommend);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("百科相关推荐更改推荐方式")
|
|
|
|
+ @PostMapping("/baike/recommend/type/save")
|
|
|
|
+ public ResponseJson<Void> saveRecommendType(BaikeProductDto baikeProduct){
|
|
|
|
+ if (null == baikeProduct.getProductId()) {
|
|
|
|
+ return ResponseJson.error("商品id不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ if (null == baikeProduct.getRecommendType()) {
|
|
|
|
+ return ResponseJson.error("推荐类型不能为空", null);
|
|
|
|
+ }
|
|
|
|
+ return shopService.saveRecommendType(baikeProduct);
|
|
|
|
+ }
|
|
}
|
|
}
|