turms icon indicating copy to clipboard operation
turms copied to clipboard

MessageService.queryMessagesWithTotal批量获取消息总数时,只返回了一个

Open lovemianhuatang opened this issue 8 months ago • 3 comments

开启 turms.service.message.use-conversation-id=true 当前登录用户Id=10,我想获取与用户['11', '12', '13']每个会话的未读消息数量。但现在只返回了第一条消息的记录;

MessageService.queryMessagesWithTotal({
                fromIds: ['11', '12', '13'],
                areGroupMessages: false,
                maxCount: 1,
                descending: true,
});

实际响应:

[
	{
		"total": 24,
		"isGroupMessage": false,
		"fromId": "11",
		"messages": [
			{
				"id": "4071732935080833024",
				"text": "Hello Turms, My userId is 998",
				.........
			}
		]
	}
]

预期响应:

[
	{
		"total": 24,
		"isGroupMessage": false,
		"fromId": "11",
		"messages": [
			{
				"id": "4071732935080833021",
				"text": "xxx",
				.........
			}
		]
	},
	{
		"total": 10,
		"isGroupMessage": false,
		"fromId": "12",
		"messages": [
			{
				"id": "4071732935080833022",
				"text": "xxx",
				.........
			}
		]
	},
	{
		"total": 6,
		"isGroupMessage": false,
		"fromId": "13",
		"messages": [
			{
				"id": "4071732935080833023",
				"text": "xxx",
				.........
			}
		]
	}
]

lovemianhuatang avatar Jun 27 '24 03:06 lovemianhuatang