소스 검색

展厅热力值,扫码预览

licailing 4 년 전
부모
커밋
df5ba23bda

+ 5 - 2
src/main/java/com/izouma/nineth/service/NewsLikeService.java

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

+ 2 - 1
src/main/vue/src/views/ShowroomList.vue

@@ -317,7 +317,8 @@ export default {
                 });
                 });
         },
         },
         showCode(row) {
         showCode(row) {
-            this.codeValue = this.$baseUrl + '9th/hall?id=' + row.id;
+            // console.log(document.location.origin);
+            this.codeValue = document.location.origin + '/9th/hall?id=' + row.id;
             // this.codeValue = 'https://nfttest.raex.vip/9th/hall?id=' + row.id;
             // this.codeValue = 'https://nfttest.raex.vip/9th/hall?id=' + row.id;
             this.showCodeDialog = true;
             this.showCodeDialog = true;
             console.log(this.codeValue);
             console.log(this.codeValue);

+ 1 - 1
src/main/vue/src/views/company/CompanyRoomList.vue

@@ -206,7 +206,7 @@ export default {
                 });
                 });
         },
         },
         showCode(row) {
         showCode(row) {
-            this.codeValue = this.$baseUrl + '/9th/hall?id=' + row.id;
+            this.codeValue = document.location.origin + '/9th/hall?id=' + row.id;
             // this.codeValue = 'https://nfttest.raex.vip/9th/hall?id=' + row.id;
             // this.codeValue = 'https://nfttest.raex.vip/9th/hall?id=' + row.id;
             this.showCodeDialog = true;
             this.showCodeDialog = true;
             console.log(this.codeValue);
             console.log(this.codeValue);