|
@@ -1,29 +1,38 @@
|
|
package shop.alien.second.controller;
|
|
package shop.alien.second.controller;
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
+import io.swagger.annotations.ApiSort;
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import shop.alien.entity.result.R;
|
|
import shop.alien.entity.result.R;
|
|
import shop.alien.entity.second.SecondGoods;
|
|
import shop.alien.entity.second.SecondGoods;
|
|
import shop.alien.entity.second.vo.SecondGoodsVo;
|
|
import shop.alien.entity.second.vo.SecondGoodsVo;
|
|
import shop.alien.second.service.SecondGoodsService;
|
|
import shop.alien.second.service.SecondGoodsService;
|
|
|
|
+import shop.alien.util.common.JwtUtil;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 二手商品控制器
|
|
* 二手商品控制器
|
|
*/
|
|
*/
|
|
|
|
+@Slf4j
|
|
|
|
+@Api(tags = {"二手平台-商品管理"})
|
|
|
|
+@ApiSort(1)
|
|
|
|
+@CrossOrigin
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/secondGoods")
|
|
@RequestMapping("/secondGoods")
|
|
-@Api(tags = "二手商品管理")
|
|
|
|
|
|
+@RequiredArgsConstructor
|
|
public class SecondGoodsController {
|
|
public class SecondGoodsController {
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private SecondGoodsService secondGoodsService;
|
|
|
|
|
|
+ private final SecondGoodsService secondGoodsService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取所有二手商品
|
|
* 获取所有二手商品
|
|
@@ -72,6 +81,20 @@ public class SecondGoodsController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 获取用户屏蔽的商品列表(分页)
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/shielded-list")
|
|
|
|
+ @ApiOperation("获取用户屏蔽的商品列表(分页)")
|
|
|
|
+ public R<IPage<SecondGoods>> getShieldedGoodsList(
|
|
|
|
+ @ApiParam("当前页码") @RequestParam Integer pageNum,
|
|
|
|
+ @ApiParam("每页数量") @RequestParam Integer pageSize,
|
|
|
|
+ @ApiParam("用户ID") @RequestParam Integer userId,
|
|
|
|
+ @ApiParam("屏蔽类型 1:商品 2:卖家") @RequestParam Integer shieldType) {
|
|
|
|
+ IPage<SecondGoods> page = new Page<>(pageNum, pageSize);
|
|
|
|
+ return R.data(secondGoodsService.getShieldedGoodsListByType(page, userId, shieldType), "获取成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 添加二手商品
|
|
* 添加二手商品
|
|
*/
|
|
*/
|
|
@PostMapping("/save")
|
|
@PostMapping("/save")
|