diff --git a/build.cmd b/build.cmd new file mode 100644 index 000000000..0e5c18ef2 --- /dev/null +++ b/build.cmd @@ -0,0 +1,11 @@ +go build -o api.exe ./cmd/openim-api/main.go +go build -o auth.exe ./cmd/openim-rpc/openim-rpc-auth/main.go +go build -o conversation.exe ./cmd/openim-rpc/openim-rpc-conversation/main.go +go build -o friend.exe ./cmd/openim-rpc/openim-rpc-friend/main.go +go build -o group.exe ./cmd/openim-rpc/openim-rpc-group/main.go +go build -o msg.exe ./cmd/openim-rpc/openim-rpc-msg/main.go +go build -o third.exe ./cmd/openim-rpc/openim-rpc-third/main.go +go build -o user.exe ./cmd/openim-rpc/openim-rpc-user/main.go +go build -o push.exe ./cmd/openim-push/main.go +go build -o msgtransfer.exe ./cmd/openim-msgtransfer/main.go +go build -o msggateway.exe ./cmd/openim-msggateway/main.go \ No newline at end of file diff --git a/pkg/common/db/unrelation/msg.go b/pkg/common/db/unrelation/msg.go index f0fa9d25a..d63cf050e 100644 --- a/pkg/common/db/unrelation/msg.go +++ b/pkg/common/db/unrelation/msg.go @@ -1197,6 +1197,11 @@ func (m *MsgMongoDriver) searchMessage(ctx context.Context, req *msg.SearchMessa } } start := (req.Pagination.PageNumber - 1) * req.Pagination.ShowNumber - msgs = msgs[start : start+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 } diff --git a/start.bat b/start.bat new file mode 100644 index 000000000..d7a922665 --- /dev/null +++ b/start.bat @@ -0,0 +1,12 @@ +cd /d %~dp0 +start api.exe -p 10002 +start user.exe -p 10010 +start friend.exe -p 10020 +start group.exe -p 10050 +start msg.exe -p 10030 +start third.exe -p 10090 +start conversation.exe -p 10080 +start push.exe -p 10070 +start auth.exe -p 10060 +start msgtransfer.exe +start msggateway.exe -p 10040 -w 10001 \ No newline at end of file