Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

Joburgess před 5 roky
rodič
revize
6713fcb41f

+ 4 - 3
edu-im/edu-im-server/src/main/java/com/keao/edu/im/controller/RoomController.java

@@ -58,9 +58,9 @@ public class RoomController{
     public Object statusSync(@RequestBody String body) throws Exception {
         ChannelStateNotify notify = JSONObject.parseObject(body, ChannelStateNotify.class);
         log.info("statusSyncParam: {}",JSONObject.toJSON(notify));
-        boolean result = false;
+//        boolean result = false;
         if(notify.getEvent() == 12 || notify.getEvent() == 3){
-            result = roomService.statusSync(notify.getChannelId(), notify.getUserId());
+//            result = roomService.statusSync(notify.getChannelId(), notify.getUserId());
         }else if(notify.getEvent() == 11){
 //            Teacher teacher = teacherDao.get(Integer.parseInt(notify.getUserId()));
 //            Long roomId = Long.parseLong(notify.getChannelId().substring(1));
@@ -71,7 +71,8 @@ public class RoomController{
 //                roomService.joinRoom(teacher.getUsername(),roomId.toString(),false,false);
 //            }
         }
-        return new BaseResponse<>(result);
+        roomService.onChannelNotify(notify);
+        return new BaseResponse<>();
     }
 
     @RequestMapping(value = "/downgrade", method = RequestMethod.POST)

+ 25 - 0
edu-im/edu-im-server/src/main/java/com/keao/edu/im/pojo/EventType.java

@@ -0,0 +1,25 @@
+package com.keao.edu.im.pojo;
+
+public class EventType {
+
+	//整个会场状态同步
+	public static final int CHANNEL_SYNC = 1;
+	//会场创建
+	public static final int CHANNEL_CREATED = 2;
+	//会场销毁
+	public static final int CHANNEL_DESTROYED = 3;
+	//人员加入会场
+	public static final int MEMBER_JOINED = 11;
+	//人员离开会场
+	public static final int MEMBER_LEFT = 12;
+	//人员被踢出会场(暂时不支持)
+	public static final int MEMBER_KICKED = 13;
+	//人员改变角色(暂时不支持)
+	public static final int MEMBER_TYPE_UPDATED = 14;
+	//人员发布资源
+	public static final int PUBLISH_RESOURCE = 20;
+	//人员取消发布资源
+	public static final int UNPUBLISH_RESOURCE = 21;
+	//资源状态发生改变
+	public static final int RESOURCE_STATE_CHANGED = 22;
+}

+ 6 - 0
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java

@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.io.IOException;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -1323,6 +1324,11 @@ public class RoomServiceImpl implements RoomService {
         return true;
     }
 
+    @Override
+    public void onChannelNotify(ChannelStateNotify notify) throws IOException {
+
+    }
+
     /*@Override
     public void sendImPlayMidiMessage(PlayMidiMessageData playMidiMessageData) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();

+ 4 - 6
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/RoomService.java

@@ -1,14 +1,10 @@
 package com.keao.edu.im.service;
 
+import java.io.IOException;
 import java.util.List;
 
 import com.keao.edu.im.common.ApiException;
-import com.keao.edu.im.pojo.DeviceTypeEnum;
-import com.keao.edu.im.pojo.PlayMidiMessageData;
-import com.keao.edu.im.pojo.ReqChangeUserRoleData;
-import com.keao.edu.im.pojo.ReqDeviceControlData;
-import com.keao.edu.im.pojo.ReqMemberOnlineStatus;
-import com.keao.edu.im.pojo.RoomResult;
+import com.keao.edu.im.pojo.*;
 
 /**
  * Created by super_zou on 2019/11/28.
@@ -84,4 +80,6 @@ public interface RoomService {
      * 发送节拍器自定义消息
      */
 //    void sendImPlayMidiMessage(PlayMidiMessageData playMidiMessageData);
+
+    void onChannelNotify(ChannelStateNotify notify) throws IOException;
 }

+ 3 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -30,7 +30,9 @@
 
     <!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="Employee" >
-		SELECT * FROM employee WHERE user_id_ = #{userId} 
+		SELECT * FROM employee e
+		LEFT JOIN sys_user su ON e.user_id_ = su.id_
+		WHERE e.user_id_ = #{userId}
 	</select>
 	
 	<!-- 全查询 -->