|
|
@@ -54,15 +54,18 @@ public class NewsLikeService {
|
|
|
.userId(userId)
|
|
|
.showroomId(roomId)
|
|
|
.build());
|
|
|
+ showroomRepo.addLike(roomId, 1);
|
|
|
+
|
|
|
int weight = sysConfigService.getInt("heat_like_weight");
|
|
|
+ List<HeatInfo> heats = heatInfoRepo.findByUserIdAndShowroomIdAndType(userId, roomId, HeatType.LIKE);
|
|
|
+ if (!heats.isEmpty()) return;
|
|
|
heatInfoRepo.save(HeatInfo.builder()
|
|
|
.showroomId(roomId)
|
|
|
.userId(userId)
|
|
|
.type(HeatType.LIKE)
|
|
|
.value(weight)
|
|
|
.build());
|
|
|
- showroomRepo.addHeatAndLike(roomId, weight, 1);
|
|
|
-
|
|
|
+ showroomRepo.addHeat(roomId, weight);
|
|
|
}
|
|
|
|
|
|
public void unlikeRoom(Long userId, Long roomId) {
|