fix get groups bug (#562)

* fix get group bug

Signed-off-by: ‘hanzhixiao’ <‘709674996@qq.com’>

* bug

* api

Signed-off-by: ‘hanzhixiao’ <‘709674996@qq.com’>

* Delete start.bat

* Delete build.cmd

---------

Signed-off-by: ‘hanzhixiao’ <‘709674996@qq.com’>
Co-authored-by: ‘hanzhixiao’ <‘709674996@qq.com’>
This commit is contained in:
Alan
2023-07-14 18:54:56 +08:00
committed by GitHub
parent b85c5ad84e
commit 3aa8d2fa69
15 changed files with 347 additions and 265 deletions
+7
View File
@@ -1202,5 +1202,12 @@ func (m *MsgMongoDriver) searchMessage(ctx context.Context, req *msg.SearchMessa
msgs = append(msgs, msg)
}
}
start := (req.Pagination.PageNumber - 1) * req.Pagination.ShowNumber
n := int32(len(msgs))
if start+req.Pagination.ShowNumber < n {
msgs = msgs[start : start+req.Pagination.ShowNumber]
} else {
msgs = msgs[start:]
}
return msgs, nil
}