|
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.jwt.JWTUtil;
|
|
|
import com.auth0.jwt.JWT;
|
|
@@ -62,8 +63,6 @@ public class RoomServiceImpl extends ServiceImpl<IRoomMapper, Room> implements I
|
|
|
|
|
|
@Override
|
|
|
public PageInfo pageList(RoomListParam param, String token) {
|
|
|
-
|
|
|
-
|
|
|
LambdaQueryWrapper<Room> wrapper = new LambdaQueryWrapper<>();
|
|
|
if(StringUtils.isNotBlank(token)){
|
|
|
String fdToken = String.format(RedisKey.TOKEN_V3,token);
|
|
@@ -181,4 +180,29 @@ public class RoomServiceImpl extends ServiceImpl<IRoomMapper, Room> implements I
|
|
|
FileUtil.del(localPath);
|
|
|
return queryPath + ossPath;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void inOrOutRoom(Integer roomId, String role, Integer type) {
|
|
|
+ if(roomId == null || StringUtils.isBlank(role)
|
|
|
+ || ( !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);
|
|
|
+ }
|
|
|
+ if(type == 1 ){
|
|
|
+ room.setLastLookTime(DateUtil.formatDateTime(new Date()));
|
|
|
+ room.setRoomStatus(2);
|
|
|
+ }
|
|
|
+ room.setUpdateTime(null);
|
|
|
+ this.updateById(room);
|
|
|
+ }
|
|
|
}
|