|
@@ -405,7 +405,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
Long teacherId = sysUser.getId();
|
|
Long teacherId = sysUser.getId();
|
|
List<LiveRoom> liveRoomList = this.list(Wrappers.<LiveRoom>lambdaQuery()
|
|
List<LiveRoom> liveRoomList = this.list(Wrappers.<LiveRoom>lambdaQuery()
|
|
.eq(LiveRoom::getSpeakerId, teacherId)
|
|
.eq(LiveRoom::getSpeakerId, teacherId)
|
|
- .eq(LiveRoom::getType, RoomTypeEnum.TEMP.getCode())
|
|
|
|
|
|
+ .eq(LiveRoom::getType, RoomTypeEnum.LIVE_TEMP.getCode())
|
|
.eq(LiveRoom::getLiveState, 1)
|
|
.eq(LiveRoom::getLiveState, 1)
|
|
.eq(LiveRoom::getRoomState, 0)
|
|
.eq(LiveRoom::getRoomState, 0)
|
|
);
|
|
);
|
|
@@ -427,7 +427,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
//如果当前时间和课程时间有交集则不能开启临时直播
|
|
//如果当前时间和课程时间有交集则不能开启临时直播
|
|
throw new BizException("当前选择的时间段有课无法开启直播");
|
|
throw new BizException("当前选择的时间段有课无法开启直播");
|
|
}
|
|
}
|
|
- RoomTypeEnum en = RoomTypeEnum.TEMP;
|
|
|
|
|
|
+ RoomTypeEnum en = RoomTypeEnum.LIVE_TEMP;
|
|
String roomUid = GenRoomUid.apply(teacherId, en);
|
|
String roomUid = GenRoomUid.apply(teacherId, en);
|
|
LiveRoom room = new LiveRoom();
|
|
LiveRoom room = new LiveRoom();
|
|
room.setRoomUid(roomUid);
|
|
room.setRoomUid(roomUid);
|
|
@@ -480,7 +480,8 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
DateTime now = DateTime.now();
|
|
DateTime now = DateTime.now();
|
|
|
|
|
|
RTCRequest.RecordStart recordStart = RTCRequest.RecordStart.builder()
|
|
RTCRequest.RecordStart recordStart = RTCRequest.RecordStart.builder()
|
|
- .streamName(MessageFormat.format("{0}_{1}", room.getRoomUid(), room.getSpeakerId().toString()))
|
|
|
|
|
|
+ .streamName(MessageFormat.format("{0}_{1}", room.getRoomUid(),
|
|
|
|
+ imGroupService.getImUserId(room.getSpeakerId().toString(),ClientEnum.TEACHER.getCode())))
|
|
.extra("")
|
|
.extra("")
|
|
.startTime(now.toDateTime().getMillis())
|
|
.startTime(now.toDateTime().getMillis())
|
|
.endTime(now.plusDays(1).toDateTime().getMillis())
|
|
.endTime(now.plusDays(1).toDateTime().getMillis())
|
|
@@ -1071,7 +1072,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
|
|
|
CourseSchedule schedule = getCourseScheduleByRoomUid(roomUid);
|
|
CourseSchedule schedule = getCourseScheduleByRoomUid(roomUid);
|
|
//校验观看者是否买过课,如果是非临时直播间,则校验是否已经买过课
|
|
//校验观看者是否买过课,如果是非临时直播间,则校验是否已经买过课
|
|
- if (!roomInfo.getRoomType().equals(RoomTypeEnum.TEMP.getCode())) {
|
|
|
|
|
|
+ if (!roomInfo.getRoomType().equals(RoomTypeEnum.LIVE_TEMP.getCode())) {
|
|
// 查询该学员成功购买课程
|
|
// 查询该学员成功购买课程
|
|
CourseScheduleStudentPayment studentPayment = courseScheduleStudentPaymentService.getOne(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
|
|
CourseScheduleStudentPayment studentPayment = courseScheduleStudentPaymentService.getOne(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
|
|
.eq(CourseScheduleStudentPayment::getUserId, sysUser.getId())
|
|
.eq(CourseScheduleStudentPayment::getUserId, sysUser.getId())
|
|
@@ -2277,7 +2278,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
}
|
|
}
|
|
RoomSpeakerInfo roomSpeakerInfo = speakerCache.get();
|
|
RoomSpeakerInfo roomSpeakerInfo = speakerCache.get();
|
|
//已是直播状态则直接返回
|
|
//已是直播状态则直接返回
|
|
- if (roomSpeakerInfo.getState() == 0) {
|
|
|
|
|
|
+ if (roomSpeakerInfo !=null && roomSpeakerInfo.getState() == 0) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|