|
@@ -11,6 +11,7 @@ import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.MK;
|
|
|
import com.yonge.cooleshow.biz.dal.service.ImUserFriendService;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.im.ImUserFriendVO;
|
|
|
+import com.yonge.cooleshow.biz.dal.wrapper.im.ImUserWrapper;
|
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
import io.swagger.annotations.*;
|
|
@@ -45,9 +46,18 @@ public class ImUserFriendController extends BaseController {
|
|
|
})
|
|
|
@ApiOperation("获取通讯录成员列表")
|
|
|
@PostMapping(value = "/queryAll")
|
|
|
- public HttpResponseResult<List<ImUserFriend>> queryAll(@RequestBody Map<String,Object> params) throws Exception {
|
|
|
+ public HttpResponseResult<List<ImUserWrapper.ImUserFriend>> queryAll(@RequestBody Map<String,Object> params) throws Exception {
|
|
|
+
|
|
|
+ // 用户ID
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- Object search = params.get("search");
|
|
|
+ if (Objects.isNull(sysUser)) {
|
|
|
+ return failed("请登录");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 学生好友列表
|
|
|
+ List<ImUserWrapper.ImUserFriend> userFriends = imUserFriendService.findUserAllImFriendInfo(ClientEnum.STUDENT, sysUser.getId(), params);
|
|
|
+
|
|
|
+ /*Object search = params.get("search");
|
|
|
List<ImUserFriend> userFriends = imUserFriendService.getBaseMapper().selectList(Wrappers.<ImUserFriend>query().lambda()
|
|
|
.and(Objects.nonNull(search) && StringUtils.isNotEmpty(search.toString()),
|
|
|
e->e.eq(ImUserFriend::getFriendId, search).or()
|
|
@@ -58,7 +68,7 @@ public class ImUserFriendController extends BaseController {
|
|
|
// 学生目前添加好友都为老师
|
|
|
item.clientType(ClientEnum.TEACHER)
|
|
|
.setImFriendId(MessageFormat.format("{0}", String.valueOf(item.getFriendId())));
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
return succeed(userFriends);
|
|
|
}
|
|
@@ -77,6 +87,10 @@ public class ImUserFriendController extends BaseController {
|
|
|
return failed("当前好友不存在");
|
|
|
}
|
|
|
|
|
|
+ if (Objects.isNull(userFriend.getFriendType())) {
|
|
|
+ userFriend.setFriendType(ClientEnum.TEACHER);
|
|
|
+ }
|
|
|
+
|
|
|
return succeed(ImUserFriendVO.ImUserFriend.from(JSON.toJSONString(userFriend)));
|
|
|
}
|
|
|
}
|