|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import com.fdkankan.tk.common.util.RoomUtil;
|
|
|
+import com.fdkankan.tk.entity.Room;
|
|
|
import com.fdkankan.tk.entity.RoomLive;
|
|
|
import com.fdkankan.tk.httpClient.client.LiveClient;
|
|
|
import com.fdkankan.tk.mapper.IRoomLiveMapper;
|
|
@@ -46,10 +47,10 @@ public class RoomLiveServiceImpl extends ServiceImpl<IRoomLiveMapper, RoomLive>
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void stopByLiveId(String liveId) {
|
|
|
+ public void stopByLiveId(String liveId,Date overTime) {
|
|
|
LambdaUpdateWrapper<RoomLive> wrapper = new LambdaUpdateWrapper<>();
|
|
|
wrapper.eq(RoomLive::getLiveId,liveId);
|
|
|
- wrapper.set(RoomLive::getOverTime,new Date());
|
|
|
+ wrapper.set(RoomLive::getOverTime,overTime);
|
|
|
wrapper.set(RoomLive::getStatus,2);
|
|
|
this.update(wrapper);
|
|
|
|
|
@@ -58,10 +59,10 @@ public class RoomLiveServiceImpl extends ServiceImpl<IRoomLiveMapper, RoomLive>
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void stopByRoomId(String roomId) {
|
|
|
- List<RoomLive> list = this.getByRoomId(roomId);
|
|
|
+ public void stopByRoomId(Room room) {
|
|
|
+ List<RoomLive> list = this.getByRoomId(room.getRoomId());
|
|
|
for (RoomLive roomLive : list) {
|
|
|
- this.stopByLiveId(roomLive.getLiveId().toString());
|
|
|
+ this.stopByLiveId(roomLive.getLiveId().toString(),room.getUseEndTime());
|
|
|
}
|
|
|
}
|
|
|
|