lyhzzz 2 rokov pred
rodič
commit
d3af1e3af3

+ 10 - 7
src/main/java/com/fdkankan/tk/service/impl/RoomServiceImpl.java

@@ -217,20 +217,23 @@ public class RoomServiceImpl extends ServiceImpl<IRoomMapper, Room> implements I
                 || ( !role.equals("leader") && !role.equals("follower"))){
             throw new BusinessException(ResultCode.PARAM_MISS);
         }
-        if(role.equals("follower")){
-            return;
-        }
         Room room = this.getById(roomId);
         if(room == null){
             throw new BusinessException(ResultCode.ROOM_MISS);
         }
+
         if(type == 0 ){
-            room.setLastLookTime(DateUtil.formatDateTime(new Date()));
-            room.setRoomStatus(1);
+            room.setRoomViewCount(room.getRoomViewCount() +1);
+            if(!role.equals("follower")){
+                room.setLastLookTime(DateUtil.formatDateTime(new Date()));
+                room.setRoomStatus(1);
+            }
         }
         if(type == 1 ){
-            room.setLastLookTime(DateUtil.formatDateTime(new Date()));
-            room.setRoomStatus(2);
+            if(!role.equals("follower")){
+                room.setLastLookTime(DateUtil.formatDateTime(new Date()));
+                room.setRoomStatus(2);
+            }
         }
         room.setUpdateTime(null);
         this.updateById(room);