|
|
@@ -183,18 +183,18 @@ public class SecondGoodsController {
|
|
|
if (goodsId == null) {
|
|
|
return R.fail("商品ID不能为空");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
SecondGoods goods = secondGoodsService.getById(goodsId);
|
|
|
if (goods == null) {
|
|
|
return R.fail("商品不存在");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 热度数量加1(使用likeCount字段表示热度)
|
|
|
SecondGoods updateGoods = new SecondGoods();
|
|
|
updateGoods.setId(goodsId);
|
|
|
updateGoods.setLikeCount(goods.getLikeCount() == null ? 1 : goods.getLikeCount() + 1);
|
|
|
boolean result = secondGoodsService.updateById(updateGoods);
|
|
|
-
|
|
|
+
|
|
|
if (result) {
|
|
|
return R.success("热度添加成功");
|
|
|
} else {
|