|
|
@@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import shop.alien.entity.SecondVideoTask;
|
|
|
import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.second.SecondGoods;
|
|
|
+import shop.alien.entity.second.enums.SecondGoodsStatusEnum;
|
|
|
+import shop.alien.entity.second.vo.SecondGoodsStatusVo;
|
|
|
import shop.alien.entity.second.vo.SecondGoodsVo;
|
|
|
import shop.alien.mapper.second.SecondGoodsAuditMapper;
|
|
|
import shop.alien.second.service.SecondGoodsAuditService;
|
|
|
@@ -71,6 +73,29 @@ public class SecondGoodsController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 根据商品ID查询商品状态
|
|
|
+ */
|
|
|
+ @GetMapping("/getGoodsStatusById")
|
|
|
+ @ApiOperation("根据商品ID查询商品状态(0草稿 1审核中 2审核失败 3已上架 4已下架 5已售出)")
|
|
|
+ public R<SecondGoodsStatusVo> getGoodsStatusById(@ApiParam("商品ID") @RequestParam Integer id) {
|
|
|
+ log.info("SecondGoodsController.getGoodsStatusById?id={}", id);
|
|
|
+ if (id == null) {
|
|
|
+ return R.fail("商品ID不能为空");
|
|
|
+ }
|
|
|
+ SecondGoods goods = secondGoodsService.getById(id);
|
|
|
+ if (goods == null) {
|
|
|
+ return R.fail("商品不存在");
|
|
|
+ }
|
|
|
+ SecondGoodsStatusVo vo = new SecondGoodsStatusVo();
|
|
|
+ vo.setId(goods.getId());
|
|
|
+ vo.setGoodsStatus(goods.getGoodsStatus());
|
|
|
+ SecondGoodsStatusEnum statusEnum = SecondGoodsStatusEnum.fromCode(goods.getGoodsStatus());
|
|
|
+ vo.setGoodsStatusName(statusEnum != null ? statusEnum.getDescription() : null);
|
|
|
+ vo.setFailedReason(goods.getFailedReason());
|
|
|
+ return R.data(vo, "查询成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 添加二手商品
|
|
|
*/
|
|
|
@PostMapping("/save")
|