Browse Source

Merge branch 'saas' of http://git.dayaedu.com/yonge/mec into saas

yonge 3 years ago
parent
commit
6318e16933

+ 2 - 12
mec-im/src/main/java/com/ym/controller/HereWhiteController.java

@@ -37,12 +37,7 @@ public class HereWhiteController  extends BaseController {
         if(StringUtils.isEmpty(name) || userNum == null || courseScheduleId == null){
         if(StringUtils.isEmpty(name) || userNum == null || courseScheduleId == null){
             return failed("参数校验失败");
             return failed("参数校验失败");
         }
         }
-        HereWhite hereWhite = hereWhiteService.create(name, userNum, courseScheduleId);
-        String joinSuccessKey = "createHereWhite:" + courseScheduleId;
-        String randomNumeric = RandomStringUtils.randomNumeric(22);
-        redisTemplate.opsForValue().set(joinSuccessKey,randomNumeric,2, TimeUnit.HOURS);
-        hereWhite.setRandomNumeric(randomNumeric);
-        return succeed(hereWhite);
+        return succeed(hereWhiteService.create(name, userNum, courseScheduleId));
     }
     }
 
 
     /**
     /**
@@ -53,12 +48,7 @@ public class HereWhiteController  extends BaseController {
      */
      */
     @RequestMapping(value = "get", method = RequestMethod.GET)
     @RequestMapping(value = "get", method = RequestMethod.GET)
     public Object join(Integer courseScheduleId){
     public Object join(Integer courseScheduleId){
-        HereWhite hereWhite = hereWhiteService.getByClassId(courseScheduleId);
-        if(Objects.nonNull(hereWhite)){
-            String joinSuccessKey = "createHereWhite:" + courseScheduleId;
-            hereWhite.setRandomNumeric(redisTemplate.opsForValue().get(joinSuccessKey));
-        }
-        return succeed(hereWhite);
+        return succeed(hereWhiteService.getByClassId(courseScheduleId));
     }
     }
 
 
 }
 }

+ 1 - 1
mec-im/src/main/java/com/ym/pojo/HereWhite.java

@@ -44,7 +44,7 @@ public class HereWhite implements Serializable {
     private @Getter @Setter Date updatedAt;
     private @Getter @Setter Date updatedAt;
     @Column(name = "created_at_")
     @Column(name = "created_at_")
     private @Getter @Setter Date createdAt;
     private @Getter @Setter Date createdAt;
-
+    @Column(name = "random_numeric_")
     private @Getter @Setter String randomNumeric;
     private @Getter @Setter String randomNumeric;
 
 
 }
 }

+ 1 - 0
mec-im/src/main/java/com/ym/pojo/RoomResult.java

@@ -33,6 +33,7 @@ public class RoomResult {
     private @Getter @Setter String display;
     private @Getter @Setter String display;
     private @Getter @Setter List<WhiteboardResult> whiteboards = new ArrayList<>();
     private @Getter @Setter List<WhiteboardResult> whiteboards = new ArrayList<>();
     private @Getter @Setter MemberResult userInfo;
     private @Getter @Setter MemberResult userInfo;
+    private @Getter @Setter String randomNumeric;
 
 
     @Data
     @Data
     public static class MemberResult {
     public static class MemberResult {

+ 2 - 0
mec-im/src/main/java/com/ym/service/Impl/HereWhiteServiceImpl.java

@@ -7,6 +7,7 @@ import com.ym.mec.util.http.HttpUtil;
 import com.ym.pojo.HereWhite;
 import com.ym.pojo.HereWhite;
 import com.ym.service.HereWhiteService;
 import com.ym.service.HereWhiteService;
 import com.ym.service.RoomService;
 import com.ym.service.RoomService;
+import org.apache.commons.lang3.RandomStringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -57,6 +58,7 @@ public class HereWhiteServiceImpl implements HereWhiteService {
                 hereWhite.setRoomToken(jsonObject.getJSONObject("msg").getString("roomToken"));
                 hereWhite.setRoomToken(jsonObject.getJSONObject("msg").getString("roomToken"));
                 hereWhite.setUpdatedAt(date);
                 hereWhite.setUpdatedAt(date);
                 hereWhite.setCreatedAt(date);
                 hereWhite.setCreatedAt(date);
+                hereWhite.setRandomNumeric(RandomStringUtils.randomNumeric(22));
                 hereWhiteDao.save(hereWhite);
                 hereWhiteDao.save(hereWhite);
             }
             }
             return hereWhite;
             return hereWhite;

+ 4 - 0
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -100,6 +100,8 @@ public class RoomServiceImpl implements RoomService {
     @Autowired
     @Autowired
     private SysTenantConfigService sysTenantConfigService;
     private SysTenantConfigService sysTenantConfigService;
     @Autowired
     @Autowired
+    private SysConfigDao sysConfigDao;
+    @Autowired
     private TenantAssetsInfoService tenantAssetsInfoService;
     private TenantAssetsInfoService tenantAssetsInfoService;
     @Autowired
     @Autowired
     private RedisTemplate<String, String> redisTemplate;
     private RedisTemplate<String, String> redisTemplate;
@@ -303,6 +305,8 @@ public class RoomServiceImpl implements RoomService {
         if (room != null) {
         if (room != null) {
             roomResult.setSoundVolume(room.getSoundVolume());
             roomResult.setSoundVolume(room.getSoundVolume());
         }
         }
+        //是否使用自定义白板
+        roomResult.setRandomNumeric(sysConfigDao.findConfigValue("rongyun_here_white_flag"));
         log.info("join room: roomId = {}, userId = {}, userName={}, role = {}", roomId, userId, userName, roleEnum);
         log.info("join room: roomId = {}, userId = {}, userName={}, role = {}", roomId, userId, userName, roleEnum);
         return new BaseResponse(roomResult);
         return new BaseResponse(roomResult);
     }
     }