Pārlūkot izejas kodu

Merge branch 'master' of http://git.dayaedu.com/yonge/cooleshow

liujunchi 3 gadi atpakaļ
vecāks
revīzija
875d9c2cac

+ 1 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/LiveRoomService.java

@@ -26,6 +26,7 @@ public interface LiveRoomService extends IService<LiveRoom> {
      *
      * @param param 参数
      *              <p>roomType 房间类型  LIVE-直播课  TEMP-临时直播间
+     *              <p>liveState 直播状态 0未开始 1已开始 2已结束
      *              <p>page 页数
      *              <p>rows 每页数量
      */

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java

@@ -261,6 +261,9 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         Integer month = WrapperUtil.toInt(param, "month", "日历的时间月份不能为空!");
         Integer singleCourseMinutes = WrapperUtil.toInt(param, "singleCourseMinutes", "单课时时长不能为空!");
         Integer freeCourseMinutes = WrapperUtil.toInt(param, "freeCourseMinutes");
+        if (Objects.isNull(freeCourseMinutes)) {
+            freeCourseMinutes = 0;
+        }
         if (singleCourseMinutes < 25) {
             throw new BizException("单课时时长不能小于25分钟!");
         }

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/LiveRoomServiceImpl.java

@@ -95,16 +95,20 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
      *
      * @param param 参数
      *              <p>roomType 房间类型  LIVE-直播课  TEMP-临时直播间
+     *              <p>liveState 直播状态 0未开始 1已开始 2已结束
      *              <p>page 页数
      *              <p>rows 每页数量
      */
     @Override
     public PageInfo<LiveRoom> queryPageRoom(Map<String, Object> param) {
         String roomType = WrapperUtil.toStr(param, "roomType");
+        Integer liveState = WrapperUtil.toInt(param, "liveState");
         Long userId = getSysUser().getId();
         Page<LiveRoom> pageInfo = PageUtil.getPageInfo(param);
         IPage<LiveRoom> page = this.page(pageInfo, Wrappers.<LiveRoom>lambdaQuery()
                 .eq(WrapperUtil.StrPredicate.test(roomType), LiveRoom::getType, roomType)
+                .eq(WrapperUtil.ObjPredicate.test(liveState), LiveRoom::getLiveState, liveState)
+                .eq(LiveRoom::getRoomState, 0)
                 .eq(LiveRoom::getSpeakerId, userId)
         );
         return PageUtil.pageInfo(page);

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/support/WrapperUtil.java

@@ -38,7 +38,7 @@ public class WrapperUtil {
         Optional<O> o = Optional.ofNullable(map)
                 .map(m -> m.get(str));
         return intOptional(o)
-                .orElse(0);
+                .orElse(null);
     }
 
     public static <S, O> Long toLong(Map<S, O> map, S str) {

+ 1 - 1
cooleshow-user/user-classroom/pom.xml

@@ -3,7 +3,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
-        <artifactId>cooleshow</artifactId>
+        <artifactId>cooleshow-user</artifactId>
         <groupId>com.yonge.cooleshow</groupId>
         <version>1.0</version>
     </parent>

+ 1 - 0
cooleshow-user/user-teacher/src/main/java/com/yonge/cooleshow/teacher/controller/TeacherLiveRoomController.java

@@ -36,6 +36,7 @@ public class TeacherLiveRoomController extends BaseController {
 
     @ApiImplicitParams({
             @ApiImplicitParam(name = "roomType", dataType = "String", value = "房间类型  LIVE-直播课  TEMP-临时直播间"),
+            @ApiImplicitParam(name = "liveState", dataType = "String", value = "直播状态 0未开始 1已开始 2已结束"),
             @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
             @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
     })