zouxuan 2 years ago
parent
commit
764c95a860

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/ImNetworkCustomMessage.java

@@ -10,7 +10,7 @@ public class ImNetworkCustomMessage{
     private String userId;
 
     @ApiModelProperty(value = "当前用户")
-    private Long currentUserId;
+    private String currentUserId;
 
     @ApiModelProperty(value = "房间号",required = true)
     private String roomId;

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

@@ -322,7 +322,11 @@ public class ImNetworkRoomServiceImpl extends ServiceImpl<ImNetworkRoomDao, ImNe
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void sendImPlayMidiMessage(ImNetworkCustomMessage customMessage) throws Exception {
-        customMessage.setCurrentUserId(sysUserService.getUserId());
+        RoleEnum roleEnum = RoleEnum.RoleTeacher;
+        if(ClientEnum.STUDENT == customMessage.getClientType()) {
+            roleEnum = RoleEnum.RoleStudent;
+        }
+        customMessage.setCurrentUserId(imGroupService.getImUserId(sysUserService.getUserId(),roleEnum));
         CourseSchedule courseSchedule = courseScheduleService.getById(customMessage.getRoomId());
         customMessage.setServiceProvider(courseSchedule.getServiceProvider());
         //发送节拍器消息