| 
					
				 | 
			
			
				@@ -1,23 +1,21 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package com.ym.mec.teacher.controller; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.ym.mec.auth.api.client.SysUserFeignService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.auth.api.entity.SysUser; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.dto.ImUserFriendDto; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.page.ImGroupNoticeQueryInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.service.ImGroupNoticeService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.service.ImGroupService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.service.ImUserFriendService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ym.mec.biz.service.UserLoginService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.common.controller.BaseController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.apache.commons.lang3.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import org.springframework.http.HttpStatus; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.web.bind.annotation.GetMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.web.bind.annotation.RequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.springframework.web.bind.annotation.RestController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import java.util.Objects; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.stream.Collectors; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 @RequestMapping("imGroup") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -35,17 +33,12 @@ public class ImGroupController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	private ImGroupNoticeService imGroupNoticeService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	private SysUserFeignService sysUserFeignService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	private UserLoginService userLoginService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@ApiOperation("查询群列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@GetMapping(value = "/queryGroupList") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	public Object queryGroupList(String search,String groupType) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		SysUser sysUser = sysUserFeignService.queryUserInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		if (Objects.isNull(sysUser)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			return failed(HttpStatus.FORBIDDEN, "请登录"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		return succeed(imGroupService.queryByUserId(sysUser.getId(), search,groupType)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		return succeed(imGroupService.queryByUserId(userLoginService.getUserId(), search,groupType)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@ApiOperation("查询群详情") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -66,28 +59,22 @@ public class ImGroupController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@ApiOperation("查询群学生列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@GetMapping(value = "/queryGroupStudentList") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	public Object queryGroupStudentList(String imGroupId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		return succeed(imGroupService.queryMemberById(imGroupId).stream().filter(e -> StringUtils.isBlank(e.getRoleType())).collect(Collectors.toList())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@ApiOperation("查询群成员详情") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@GetMapping(value = "/queryGroupMemberDetail") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	public Object queryGroupMemberDetail(String imGroupId, Integer userId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		return succeed(imGroupService.queryMember(imGroupId, userId)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@ApiOperation("查询好友详情") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@GetMapping(value = "/queryFriendDetail") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	public Object queryFriendDetail(Integer userId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		SysUser sysUser = sysUserFeignService.queryUserInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		if (Objects.isNull(sysUser)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			return failed(HttpStatus.FORBIDDEN, "请登录"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		ImUserFriendDto dto = imUserFriendService.queryFriendDetail(sysUser.getId(), userId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		ImUserFriendDto dto = imUserFriendService.queryFriendDetail(userLoginService.getUserId(), userId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if (dto == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			dto = new ImUserFriendDto(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			SysUser user = sysUserFeignService.queryUserById(userId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			SysUser user = userLoginService.queryUserById(userId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			dto.setFriend(user); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			if (user.getUserType().contains("STUDENT")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				dto.setFriendNickname(user.getUsername()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -102,23 +89,13 @@ public class ImGroupController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@ApiOperation("查询好友列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@GetMapping(value = "/queryFriendList") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	public Object queryFriendList(String search) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		SysUser sysUser = sysUserFeignService.queryUserInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		if (Objects.isNull(sysUser)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			return failed(HttpStatus.FORBIDDEN, "请登录"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		return succeed(imUserFriendService.queryFriendListByUserId(sysUser.getId(), search)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		return succeed(imUserFriendService.queryFriendListByUserId(userLoginService.getUserId(), search)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@ApiOperation("查询好友中的学生列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@GetMapping(value = "/queryFriendStudentList") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	public Object queryFriendStudentList(String search) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		SysUser sysUser = sysUserFeignService.queryUserInfo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		if (Objects.isNull(sysUser)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			return failed(HttpStatus.FORBIDDEN, "请登录"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		return succeed(imUserFriendService.queryFriendListByUserId(sysUser.getId(), search).stream().filter(e -> StringUtils.isBlank(e.getTags())) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		return succeed(imUserFriendService.queryFriendListByUserId(userLoginService.getUserId(), search).stream().filter(e -> StringUtils.isBlank(e.getTags())) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				.collect(Collectors.toList())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |