xiaoyong931011
2022-06-22 6de066700687dc54f680ef60a5285581d4fb44a1
src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java
@@ -473,5 +473,27 @@
        return mallGoodsMapper.getAllGoodsTree();
    }
    @Override
    public FebsResponse goodsHot(Long id) {
        MallGoods mallGoods = mallGoodsMapper.selectById(id);
        if (ObjectUtil.isEmpty(mallGoods)) {
            return new FebsResponse().fail().message("商品不存在,请刷新当前页面");
        }
        mallGoods.setIsHot(MallGoods.ISHOT_STATE_YES);
        mallGoodsMapper.updateById(mallGoods);
        return new FebsResponse().success();
    }
    @Override
    public FebsResponse goodsNotHot(Long id) {
        MallGoods mallGoods = mallGoodsMapper.selectById(id);
        if (ObjectUtil.isEmpty(mallGoods)) {
            return new FebsResponse().fail().message("商品不存在,请刷新当前页面");
        }
        mallGoods.setIsHot(MallGoods.ISHOT_STATE_NO);
        mallGoodsMapper.updateById(mallGoods);
        return new FebsResponse().success();
    }
}