mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-14 06:03:42 +08:00
fix:解决会话列表UnsupportedOperationException的问题
This commit is contained in:
@@ -47,6 +47,13 @@ public class AssertUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//如果不是非空对象,则抛异常
|
||||||
|
public static void isNotEmpty(Object obj, ErrorEnum errorEnum, Object... args) {
|
||||||
|
if (isEmpty(obj)) {
|
||||||
|
throwException(errorEnum, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//如果不是非空对象,则抛异常
|
//如果不是非空对象,则抛异常
|
||||||
public static void isEmpty(Object obj, String msg) {
|
public static void isEmpty(Object obj, String msg) {
|
||||||
if (!isEmpty(obj)) {
|
if (!isEmpty(obj)) {
|
||||||
|
|||||||
@@ -152,12 +152,13 @@ public class ChatServiceImpl implements ChatService {
|
|||||||
@Override
|
@Override
|
||||||
public CursorPageBaseResp<ChatRoomResp> getRoomPage(CursorPageBaseReq request, Long uid) {
|
public CursorPageBaseResp<ChatRoomResp> getRoomPage(CursorPageBaseReq request, Long uid) {
|
||||||
CursorPageBaseResp<Room> cursorPage = roomDao.getCursorPage(request);
|
CursorPageBaseResp<Room> cursorPage = roomDao.getCursorPage(request);
|
||||||
|
ArrayList<Room> rooms = new ArrayList<>(cursorPage.getList());
|
||||||
if (request.isFirstPage()) {
|
if (request.isFirstPage()) {
|
||||||
//第一页插入置顶的大群聊
|
//第一页插入置顶的大群聊
|
||||||
Room group = roomDao.getById(ROOM_GROUP_ID);
|
Room group = roomDao.getById(ROOM_GROUP_ID);
|
||||||
cursorPage.getList().add(0, group);
|
rooms.add(0, group);
|
||||||
}
|
}
|
||||||
return CursorPageBaseResp.init(cursorPage, RoomAdapter.buildResp(cursorPage.getList()));
|
return CursorPageBaseResp.init(cursorPage, RoomAdapter.buildResp(rooms));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user