Browse Source

vip定制课

zouxuan 8 tháng trước cách đây
mục cha
commit
75a680bde7

+ 3 - 19
cooleshow-app/src/main/java/com/yonge/cooleshow/classroom/controller/RoomController.java

@@ -2,17 +2,7 @@ package com.yonge.cooleshow.classroom.controller;
 
 
 import com.alibaba.fastjson.JSONObject;
-import com.yonge.cooleshow.biz.dal.dto.BasicUserInfoDto;
-import com.yonge.cooleshow.biz.dal.dto.ETencentTRTCCallbackCommand;
-import com.yonge.cooleshow.biz.dal.dto.ImChannelStateNotify;
-import com.yonge.cooleshow.biz.dal.dto.ImNetworkBaseDto;
-import com.yonge.cooleshow.biz.dal.dto.ImNetworkCustomMessage;
-import com.yonge.cooleshow.biz.dal.dto.ImNetworkDeviceControlDto;
-import com.yonge.cooleshow.biz.dal.dto.ImNetworkDisplayDataDto;
-import com.yonge.cooleshow.biz.dal.dto.ImNetworkMusicSheetDto;
-import com.yonge.cooleshow.biz.dal.dto.ImNetworkRoomResult;
-import com.yonge.cooleshow.biz.dal.dto.RoomStatusNotify;
-import com.yonge.cooleshow.biz.dal.dto.TencentData;
+import com.yonge.cooleshow.biz.dal.dto.*;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
 import com.yonge.cooleshow.biz.dal.enums.RoleEnum;
 import com.yonge.cooleshow.biz.dal.service.ImGroupService;
@@ -25,13 +15,7 @@ import io.swagger.annotations.ApiOperation;
 import org.joda.time.DateTime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -56,7 +40,7 @@ public class RoomController extends BaseController {
     private ImNetworkRoomService imNetworkRoomService;
     @Resource
     private SysUserService sysUserService;
-    @Autowired
+    @Resource
     private ImGroupService imGroupService;
 
     @ApiOperation("加入网络教室")

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

@@ -111,7 +111,12 @@ public class ImNetworkRoomServiceImpl extends ServiceImpl<ImNetworkRoomDao, ImNe
         //获取老师基本信息
         BasicUserInfo basicUserInfo = teacherDao.getBasicUserInfo(courseSchedule.getTeacherId());
         //XX分钟关闭房间
-        String configValue = sysConfigDao.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_PRACTICE_ROOM_MINUTE);
+        String configValue;
+        if(StringUtils.equals(courseSchedule.getType(),"VIP")){
+            configValue = sysConfigDao.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_VIP_ROOM_MINUTE);
+        }else {
+            configValue = sysConfigDao.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_PRACTICE_ROOM_MINUTE);
+        }
 
         ImNetworkRoomResult joinRoomResult = new ImNetworkRoomResult();
         String imUserId = imGroupService.getImUserId(sysUser.getUserId(), userRole);
@@ -281,7 +286,13 @@ public class ImNetworkRoomServiceImpl extends ServiceImpl<ImNetworkRoomDao, ImNe
         }
         joinRoomResult.setMembers(members);
         //课程结束后关闭教室的时间
-        joinRoomResult.setAutoCloseNetworkRoomTime(sysConfigDao.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_PRACTICE_ROOM_MINUTE));
+        String configValue;
+        if(StringUtils.equals(courseSchedule.getType(),"VIP")){
+            configValue = sysConfigDao.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_VIP_ROOM_MINUTE);
+        }else {
+            configValue = sysConfigDao.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_PRACTICE_ROOM_MINUTE);
+        }
+        joinRoomResult.setAutoCloseNetworkRoomTime(configValue);
         //获取腾讯所需基本信息配置
         joinRoomResult.setRtcRoomConfig(roomService.getRtcRoomConfig(courseSchedule.getServiceProvider(),roomMember));
         joinRoomResult.setGroupId(roomId);
@@ -711,7 +722,12 @@ public class ImNetworkRoomServiceImpl extends ServiceImpl<ImNetworkRoomDao, ImNe
     //校验用户是否提前进入教室
     private boolean roomNotStart(CourseSchedule courseSchedule){
         //是否提前进入教室
-        String courseBeforeBufferTime = sysConfigDao.findConfigValue(SysConfigConstant.PRE_CREATE_PRACTICE_ROOM_MINUTE);
+        String courseBeforeBufferTime;
+        if(StringUtils.equals(courseSchedule.getType(),"VIP")){
+            courseBeforeBufferTime = sysConfigDao.findConfigValue(SysConfigConstant.PRE_CREATE_VIP_ROOM_MINUTE);
+        }else {
+            courseBeforeBufferTime = sysConfigDao.findConfigValue(SysConfigConstant.PRE_CREATE_PRACTICE_ROOM_MINUTE);
+        }
         if (StringUtils.isEmpty(courseBeforeBufferTime)) {
             courseBeforeBufferTime = "5";
         }