|
@@ -0,0 +1,65 @@
|
|
|
+package com.ym.mec.web.controller.education;
|
|
|
+
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.service.ClassGroupService;
|
|
|
+import com.ym.mec.biz.service.TeacherService;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+@Api(tags = "即时通讯相关服务")
|
|
|
+@RequestMapping("im")
|
|
|
+@RestController
|
|
|
+public class ImController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private ClassGroupService classGroupService;
|
|
|
+ @Autowired
|
|
|
+ private TeacherService teacherService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取教务所有聊天群组")
|
|
|
+ @GetMapping("/queryEmployeeGroups")
|
|
|
+ public Object queryEmployeeGroups(String search){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(sysUser == null){
|
|
|
+ return failed("获取用户信息失败");
|
|
|
+ }
|
|
|
+ return succeed(teacherService.queryTeacherGroups(sysUser.getId(),search));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取当前教务通讯录列表")
|
|
|
+ @GetMapping("/queryGroupStudents")
|
|
|
+ public Object queryGroupStudents(String search){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if(sysUser == null){
|
|
|
+ return failed("获取用户信息失败");
|
|
|
+ }
|
|
|
+ return succeed(teacherService.queryGroupStudents(sysUser.getId(),search));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据群编号,获取群组基本信息")
|
|
|
+ @GetMapping("/findGroupById")
|
|
|
+ public Object findGroupById(Integer groupId){
|
|
|
+ if(null == groupId){
|
|
|
+ return failed("参数校验错误");
|
|
|
+ }
|
|
|
+ return succeed(classGroupService.findGroupById(groupId));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据群编号,获取群组所有成员基本信息")
|
|
|
+ @GetMapping("/findGroupUsers")
|
|
|
+ public Object findGroupUsers(Integer groupId) {
|
|
|
+ if (groupId == null) {
|
|
|
+ return failed("参数校验错误");
|
|
|
+ }
|
|
|
+ return succeed(classGroupService.findGroupUsers(groupId));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|