mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
style: add format and lint (#773)
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
863c52c7bb
commit
af00960ad1
14
.github/dependabot.yml
vendored
14
.github/dependabot.yml
vendored
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# To get started with Dependabot version updates, you'll need to specify which
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
# package ecosystems to update and where the package manifests are located.
|
# package ecosystems to update and where the package manifests are located.
|
||||||
# Please see the documentation for all configuration options:
|
# Please see the documentation for all configuration options:
|
||||||
|
14
.github/workflows/auto-tag.yml
vendored
14
.github/workflows/auto-tag.yml
vendored
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
name: Create Tag
|
name: Create Tag
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
14
.github/workflows/create_branch_on_tag.yml
vendored
14
.github/workflows/create_branch_on_tag.yml
vendored
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
name: Create Branch on Tag
|
name: Create Branch on Tag
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
14
.github/workflows/milestone.yml
vendored
14
.github/workflows/milestone.yml
vendored
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# shamelessly copied from https://github.com/sigstore/cosign/blob/main/.github/workflows/milestone.yaml
|
# shamelessly copied from https://github.com/sigstore/cosign/blob/main/.github/workflows/milestone.yaml
|
||||||
|
|
||||||
name: milestone
|
name: milestone
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
|
||||||
|
|
||||||
# Set go mod installation source and proxy
|
# Set go mod installation source and proxy
|
||||||
|
@ -26,14 +26,15 @@ import (
|
|||||||
|
|
||||||
_ "net/http/pprof"
|
_ "net/http/pprof"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/api"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
openKeeper "github.com/OpenIMSDK/tools/discoveryregistry/zookeeper"
|
openKeeper "github.com/OpenIMSDK/tools/discoveryregistry/zookeeper"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/internal/api"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -17,9 +17,10 @@ package api
|
|||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/auth"
|
"github.com/OpenIMSDK/protocol/auth"
|
||||||
"github.com/OpenIMSDK/tools/a2r"
|
"github.com/OpenIMSDK/tools/a2r"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AuthApi rpcclient.Auth
|
type AuthApi rpcclient.Auth
|
||||||
|
@ -17,9 +17,10 @@ package api
|
|||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/conversation"
|
"github.com/OpenIMSDK/protocol/conversation"
|
||||||
"github.com/OpenIMSDK/tools/a2r"
|
"github.com/OpenIMSDK/tools/a2r"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConversationApi rpcclient.Conversation
|
type ConversationApi rpcclient.Conversation
|
||||||
|
@ -15,10 +15,11 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/friend"
|
"github.com/OpenIMSDK/protocol/friend"
|
||||||
"github.com/OpenIMSDK/tools/a2r"
|
"github.com/OpenIMSDK/tools/a2r"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,10 +15,11 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/group"
|
"github.com/OpenIMSDK/protocol/group"
|
||||||
"github.com/OpenIMSDK/tools/a2r"
|
"github.com/OpenIMSDK/tools/a2r"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,16 +15,15 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/msg"
|
"github.com/OpenIMSDK/protocol/msg"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
@ -33,6 +32,9 @@ import (
|
|||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MessageApi struct {
|
type MessageApi struct {
|
||||||
|
@ -16,14 +16,16 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
"net/http"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/tools/apiresp"
|
"github.com/OpenIMSDK/tools/apiresp"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/tokenverify"
|
"github.com/OpenIMSDK/tools/tokenverify"
|
||||||
"net/http"
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gin-gonic/gin/binding"
|
"github.com/gin-gonic/gin/binding"
|
||||||
@ -32,12 +34,13 @@ import (
|
|||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/mw"
|
"github.com/OpenIMSDK/tools/mw"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.UniversalClient) *gin.Engine {
|
func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.UniversalClient) *gin.Engine {
|
||||||
@ -82,7 +85,6 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive
|
|||||||
userRouterGroup.POST("/subscribe_users_status", ParseToken, u.UnSubscriberStatus)
|
userRouterGroup.POST("/subscribe_users_status", ParseToken, u.UnSubscriberStatus)
|
||||||
userRouterGroup.POST("/unsubscribe_users_status", ParseToken, u.UnSubscriberStatus)
|
userRouterGroup.POST("/unsubscribe_users_status", ParseToken, u.UnSubscriberStatus)
|
||||||
userRouterGroup.POST("/get_users_status", ParseToken, u.GetUserStatus)
|
userRouterGroup.POST("/get_users_status", ParseToken, u.GetUserStatus)
|
||||||
|
|
||||||
}
|
}
|
||||||
// friend routing group
|
// friend routing group
|
||||||
friendRouterGroup := r.Group("/friend", ParseToken)
|
friendRouterGroup := r.Group("/friend", ParseToken)
|
||||||
|
@ -17,9 +17,10 @@ package api
|
|||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/user"
|
"github.com/OpenIMSDK/protocol/user"
|
||||||
"github.com/OpenIMSDK/tools/a2r"
|
"github.com/OpenIMSDK/tools/a2r"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StatisticsApi rpcclient.User
|
type StatisticsApi rpcclient.User
|
||||||
|
@ -15,16 +15,18 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/protocol/third"
|
"github.com/OpenIMSDK/protocol/third"
|
||||||
"github.com/OpenIMSDK/tools/a2r"
|
"github.com/OpenIMSDK/tools/a2r"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ThirdApi rpcclient.Third
|
type ThirdApi rpcclient.Third
|
||||||
|
@ -17,8 +17,6 @@ package api
|
|||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/msggateway"
|
"github.com/OpenIMSDK/protocol/msggateway"
|
||||||
"github.com/OpenIMSDK/protocol/user"
|
"github.com/OpenIMSDK/protocol/user"
|
||||||
@ -26,6 +24,9 @@ import (
|
|||||||
"github.com/OpenIMSDK/tools/apiresp"
|
"github.com/OpenIMSDK/tools/apiresp"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserApi rpcclient.User
|
type UserApi rpcclient.User
|
||||||
|
@ -18,11 +18,12 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
|
|
||||||
cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func url() string {
|
func url() string {
|
||||||
|
@ -18,10 +18,11 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
@ -16,20 +16,23 @@ package msggateway
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/startrpc"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/msggateway"
|
"github.com/OpenIMSDK/protocol/msggateway"
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/startrpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Server) InitServer(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
func (s *Server) InitServer(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
||||||
|
@ -23,10 +23,11 @@ import (
|
|||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/msg"
|
"github.com/OpenIMSDK/protocol/msg"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Req struct {
|
type Req struct {
|
||||||
|
@ -17,17 +17,19 @@ package msggateway
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
|
||||||
|
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
|
|
||||||
@ -91,6 +93,7 @@ func (ws *WsServer) SetDiscoveryRegistry(client discoveryregistry.SvcDiscoveryRe
|
|||||||
u := rpcclient.NewUserRpcClient(client)
|
u := rpcclient.NewUserRpcClient(client)
|
||||||
ws.userClient = &u
|
ws.userClient = &u
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ws *WsServer) SetUserOnlineStatus(ctx context.Context, client *Client, status int32) {
|
func (ws *WsServer) SetUserOnlineStatus(ctx context.Context, client *Client, status int32) {
|
||||||
err := ws.userClient.SetUserStatus(ctx, client.UserID, status, client.PlatformID)
|
err := ws.userClient.SetUserStatus(ctx, client.UserID, status, client.PlatformID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -107,9 +110,7 @@ func (ws *WsServer) SetUserOnlineStatus(ctx context.Context, client *Client, sta
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.ZWarn(ctx, "CallbackUserOffline err", err)
|
log.ZWarn(ctx, "CallbackUserOffline err", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ws *WsServer) SetCacheHandler(cache cache.MsgModel) {
|
func (ws *WsServer) SetCacheHandler(cache cache.MsgModel) {
|
||||||
|
@ -22,6 +22,10 @@ import (
|
|||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
|
|
||||||
|
openKeeper "github.com/OpenIMSDK/tools/discoveryregistry/zookeeper"
|
||||||
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
"github.com/OpenIMSDK/tools/mw"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
@ -30,9 +34,6 @@ import (
|
|||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
openKeeper "github.com/OpenIMSDK/tools/discoveryregistry/zookeeper"
|
|
||||||
"github.com/OpenIMSDK/tools/log"
|
|
||||||
"github.com/OpenIMSDK/tools/mw"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type MsgTransfer struct {
|
type MsgTransfer struct {
|
||||||
|
@ -16,27 +16,29 @@ package msgtransfer
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
|
|
||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
"github.com/go-redis/redis"
|
"github.com/go-redis/redis"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -20,11 +20,12 @@ import (
|
|||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
|
pbMsg "github.com/OpenIMSDK/protocol/msg"
|
||||||
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
kfk "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka"
|
kfk "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka"
|
||||||
pbMsg "github.com/OpenIMSDK/protocol/msg"
|
|
||||||
"github.com/OpenIMSDK/tools/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type OnlineHistoryMongoConsumerHandler struct {
|
type OnlineHistoryMongoConsumerHandler struct {
|
||||||
|
@ -17,14 +17,15 @@ package msgtransfer
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
|
||||||
kfk "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
pbMsg "github.com/OpenIMSDK/protocol/msg"
|
pbMsg "github.com/OpenIMSDK/protocol/msg"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
|
kfk "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka"
|
||||||
|
|
||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
@ -17,14 +17,15 @@ package push
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
func url() string {
|
func url() string {
|
||||||
|
@ -16,18 +16,20 @@ package fcm
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
config2 "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
config2 "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
|
||||||
firebase "firebase.google.com/go"
|
firebase "firebase.google.com/go"
|
||||||
"firebase.google.com/go/messaging"
|
"firebase.google.com/go/messaging"
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
"google.golang.org/api/option"
|
"google.golang.org/api/option"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush"
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const SinglePushCountLimit = 400
|
const SinglePushCountLimit = 400
|
||||||
|
@ -25,15 +25,16 @@ import (
|
|||||||
|
|
||||||
"github.com/go-redis/redis"
|
"github.com/go-redis/redis"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
http2 "github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/utils/splitter"
|
"github.com/OpenIMSDK/tools/utils/splitter"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
http2 "github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,13 +20,14 @@ import (
|
|||||||
"github.com/Shopify/sarama"
|
"github.com/Shopify/sarama"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
kfk "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
pbChat "github.com/OpenIMSDK/protocol/msg"
|
pbChat "github.com/OpenIMSDK/protocol/msg"
|
||||||
pbPush "github.com/OpenIMSDK/protocol/push"
|
pbPush "github.com/OpenIMSDK/protocol/push"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
kfk "github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConsumerHandler struct {
|
type ConsumerHandler struct {
|
||||||
|
@ -20,14 +20,15 @@ import (
|
|||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/localcache"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
pbPush "github.com/OpenIMSDK/protocol/push"
|
pbPush "github.com/OpenIMSDK/protocol/push"
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/localcache"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type pushServer struct {
|
type pushServer struct {
|
||||||
|
@ -18,8 +18,17 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
"github.com/OpenIMSDK/protocol/msggateway"
|
||||||
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
|
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush"
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/fcm"
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/fcm"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/getui"
|
"github.com/OpenIMSDK/Open-IM-Server/internal/push/offlinepush/getui"
|
||||||
@ -30,13 +39,6 @@ import (
|
|||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/localcache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/localcache"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
|
||||||
"github.com/OpenIMSDK/protocol/msggateway"
|
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
|
||||||
"github.com/OpenIMSDK/tools/log"
|
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Pusher struct {
|
type Pusher struct {
|
||||||
|
@ -1,3 +1,17 @@
|
|||||||
|
// Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package push
|
package push
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -16,14 +16,11 @@ package auth
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
pbAuth "github.com/OpenIMSDK/protocol/auth"
|
pbAuth "github.com/OpenIMSDK/protocol/auth"
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/msggateway"
|
"github.com/OpenIMSDK/protocol/msggateway"
|
||||||
@ -33,6 +30,11 @@ import (
|
|||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/tokenverify"
|
"github.com/OpenIMSDK/tools/tokenverify"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type authServer struct {
|
type authServer struct {
|
||||||
|
@ -16,10 +16,19 @@ package conversation
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
pbConversation "github.com/OpenIMSDK/protocol/conversation"
|
||||||
|
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
"github.com/OpenIMSDK/tools/tx"
|
||||||
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
@ -27,13 +36,6 @@ import (
|
|||||||
tableRelation "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
tableRelation "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
|
||||||
pbConversation "github.com/OpenIMSDK/protocol/conversation"
|
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
|
||||||
"github.com/OpenIMSDK/tools/log"
|
|
||||||
"github.com/OpenIMSDK/tools/tx"
|
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type conversationServer struct {
|
type conversationServer struct {
|
||||||
|
@ -16,13 +16,15 @@ package friend
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
|
||||||
|
pbFriend "github.com/OpenIMSDK/protocol/friend"
|
||||||
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
pbFriend "github.com/OpenIMSDK/protocol/friend"
|
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *friendServer) GetPaginationBlacks(
|
func (s *friendServer) GetPaginationBlacks(
|
||||||
|
@ -17,13 +17,14 @@ package friend
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
pbfriend "github.com/OpenIMSDK/protocol/friend"
|
pbfriend "github.com/OpenIMSDK/protocol/friend"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
|
|
||||||
|
cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CallbackBeforeAddFriend(ctx context.Context, req *pbfriend.ApplyToAddFriendReq) error {
|
func CallbackBeforeAddFriend(ctx context.Context, req *pbfriend.ApplyToAddFriendReq) error {
|
||||||
|
@ -16,25 +16,28 @@ package friend
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
|
||||||
tablerelation "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
pbfriend "github.com/OpenIMSDK/protocol/friend"
|
pbfriend "github.com/OpenIMSDK/protocol/friend"
|
||||||
registry "github.com/OpenIMSDK/tools/discoveryregistry"
|
registry "github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/tx"
|
"github.com/OpenIMSDK/tools/tx"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
||||||
|
tablerelation "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
||||||
)
|
)
|
||||||
|
|
||||||
type friendServer struct {
|
type friendServer struct {
|
||||||
|
@ -17,8 +17,9 @@ package group
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
|
||||||
pbGroup "github.com/OpenIMSDK/protocol/group"
|
pbGroup "github.com/OpenIMSDK/protocol/group"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *groupServer) GetGroupInfoCache(
|
func (s *groupServer) GetGroupInfoCache(
|
||||||
|
@ -18,17 +18,18 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/group"
|
"github.com/OpenIMSDK/protocol/group"
|
||||||
"github.com/OpenIMSDK/protocol/wrapperspb"
|
"github.com/OpenIMSDK/protocol/wrapperspb"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CallbackBeforeCreateGroup(ctx context.Context, req *group.CreateGroupReq) (err error) {
|
func CallbackBeforeCreateGroup(ctx context.Context, req *group.CreateGroupReq) (err error) {
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
package group
|
package group
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *groupServer) groupDB2PB(group *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo {
|
func (s *groupServer) groupDB2PB(group *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo {
|
||||||
|
@ -17,8 +17,9 @@ package group
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *groupServer) FindGroupMember(
|
func (s *groupServer) FindGroupMember(
|
||||||
|
@ -31,17 +31,13 @@ import (
|
|||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/tools/mw/specialerror"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
"github.com/OpenIMSDK/tools/mw/specialerror"
|
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
|
||||||
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
pbGroup "github.com/OpenIMSDK/protocol/group"
|
pbGroup "github.com/OpenIMSDK/protocol/group"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
@ -50,6 +46,12 @@ import (
|
|||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
||||||
|
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
||||||
|
@ -19,14 +19,15 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
pbGroup "github.com/OpenIMSDK/protocol/group"
|
pbGroup "github.com/OpenIMSDK/protocol/group"
|
||||||
sdkws "github.com/OpenIMSDK/protocol/sdkws"
|
sdkws "github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *groupServer) GetJoinedSuperGroupList(
|
func (s *groupServer) GetJoinedSuperGroupList(
|
||||||
|
@ -16,18 +16,20 @@ package msg
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
pbChat "github.com/OpenIMSDK/protocol/msg"
|
pbChat "github.com/OpenIMSDK/protocol/msg"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
cbapi "github.com/OpenIMSDK/Open-IM-Server/pkg/callbackstruct"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
func cbURL() string {
|
func cbURL() string {
|
||||||
|
@ -16,6 +16,7 @@ package msg
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
@ -17,11 +17,12 @@ package msg
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/msg"
|
"github.com/OpenIMSDK/protocol/msg"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MessageInterceptorFunc func(ctx context.Context, req *msg.SendMsgReq) (*sdkws.MsgData, error)
|
type MessageInterceptorFunc func(ctx context.Context, req *msg.SendMsgReq) (*sdkws.MsgData, error)
|
||||||
|
@ -17,16 +17,18 @@ package msg
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/msg"
|
"github.com/OpenIMSDK/protocol/msg"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (m *msgServer) RevokeMsg(ctx context.Context, req *msg.RevokeMsgReq) (*msg.RevokeMsgResp, error) {
|
func (m *msgServer) RevokeMsg(ctx context.Context, req *msg.RevokeMsgReq) (*msg.RevokeMsgResp, error) {
|
||||||
|
@ -16,9 +16,9 @@ package msg
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
||||||
|
|
||||||
promePkg "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
pbConversation "github.com/OpenIMSDK/protocol/conversation"
|
pbConversation "github.com/OpenIMSDK/protocol/conversation"
|
||||||
pbMsg "github.com/OpenIMSDK/protocol/msg"
|
pbMsg "github.com/OpenIMSDK/protocol/msg"
|
||||||
@ -28,6 +28,8 @@ import (
|
|||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
promePkg "github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (m *msgServer) SendMsg(ctx context.Context, req *pbMsg.SendMsgReq) (resp *pbMsg.SendMsgResp, error error) {
|
func (m *msgServer) SendMsg(ctx context.Context, req *pbMsg.SendMsgReq) (resp *pbMsg.SendMsgResp, error error) {
|
||||||
@ -149,7 +151,7 @@ func (m *msgServer) sendMsgSingleChat(ctx context.Context, req *pbMsg.SendMsgReq
|
|||||||
if err := m.messageVerification(ctx, req); err != nil {
|
if err := m.messageVerification(ctx, req); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var isSend = true
|
isSend := true
|
||||||
isNotification := msgprocessor.IsNotificationByMsg(req.MsgData)
|
isNotification := msgprocessor.IsNotificationByMsg(req.MsgData)
|
||||||
if !isNotification {
|
if !isNotification {
|
||||||
isSend, err = m.modifyMessageByUserMessageReceiveOpt(
|
isSend, err = m.modifyMessageByUserMessageReceiveOpt(
|
||||||
|
@ -19,16 +19,17 @@ import (
|
|||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
"github.com/OpenIMSDK/protocol/conversation"
|
||||||
|
"github.com/OpenIMSDK/protocol/msg"
|
||||||
|
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/localcache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/localcache"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
|
||||||
"github.com/OpenIMSDK/protocol/conversation"
|
|
||||||
"github.com/OpenIMSDK/protocol/msg"
|
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
@ -18,10 +18,11 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
|
||||||
"github.com/OpenIMSDK/protocol/msg"
|
"github.com/OpenIMSDK/protocol/msg"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (m *msgServer) GetActiveUser(ctx context.Context, req *msg.GetActiveUserReq) (*msg.GetActiveUserResp, error) {
|
func (m *msgServer) GetActiveUser(ctx context.Context, req *msg.GetActiveUserReq) (*msg.GetActiveUserResp, error) {
|
||||||
|
@ -16,6 +16,7 @@ package msg
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
||||||
|
|
||||||
|
@ -18,10 +18,11 @@ import (
|
|||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func isMessageHasReadEnabled(msgData *sdkws.MsgData) bool {
|
func isMessageHasReadEnabled(msgData *sdkws.MsgData) bool {
|
||||||
|
@ -20,12 +20,13 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/msg"
|
"github.com/OpenIMSDK/protocol/msg"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ExcludeContentType = []int{constant.HasReadReceipt}
|
var ExcludeContentType = []int{constant.HasReadReceipt}
|
||||||
|
@ -18,13 +18,14 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/cont"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/protocol/third"
|
"github.com/OpenIMSDK/protocol/third"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/s3/cont"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (t *thirdServer) PartLimit(ctx context.Context, req *third.PartLimitReq) (*third.PartLimitResp, error) {
|
func (t *thirdServer) PartLimit(ctx context.Context, req *third.PartLimitReq) (*third.PartLimitResp, error) {
|
||||||
|
@ -27,14 +27,15 @@ import (
|
|||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/protocol/third"
|
||||||
|
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
||||||
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
"github.com/OpenIMSDK/protocol/third"
|
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
||||||
|
@ -18,10 +18,11 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
|
||||||
"strings"
|
"strings"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/protocol/third"
|
"github.com/OpenIMSDK/protocol/third"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
|
@ -17,12 +17,21 @@ package user
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
|
||||||
"github.com/OpenIMSDK/tools/log"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
|
pbuser "github.com/OpenIMSDK/protocol/user"
|
||||||
|
registry "github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
|
"github.com/OpenIMSDK/tools/tx"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
@ -31,12 +40,6 @@ import (
|
|||||||
tablerelation "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
tablerelation "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
|
||||||
pbuser "github.com/OpenIMSDK/protocol/user"
|
|
||||||
registry "github.com/OpenIMSDK/tools/discoveryregistry"
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
|
||||||
"github.com/OpenIMSDK/tools/tx"
|
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
@ -21,8 +21,9 @@ import (
|
|||||||
|
|
||||||
"github.com/robfig/cron/v3"
|
"github.com/robfig/cron/v3"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func StartCronTask() error {
|
func StartCronTask() error {
|
||||||
|
@ -24,13 +24,6 @@ import (
|
|||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry/zookeeper"
|
"github.com/OpenIMSDK/tools/discoveryregistry/zookeeper"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
@ -38,6 +31,14 @@ import (
|
|||||||
"github.com/OpenIMSDK/tools/mw"
|
"github.com/OpenIMSDK/tools/mw"
|
||||||
"github.com/OpenIMSDK/tools/tx"
|
"github.com/OpenIMSDK/tools/tx"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MsgTool struct {
|
type MsgTool struct {
|
||||||
|
@ -1,14 +1,30 @@
|
|||||||
|
// Copyright © 2023 OpenIM. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
package authverify
|
package authverify
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/tokenverify"
|
"github.com/OpenIMSDK/tools/tokenverify"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
"github.com/golang-jwt/jwt/v4"
|
"github.com/golang-jwt/jwt/v4"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Secret() jwt.Keyfunc {
|
func Secret() jwt.Keyfunc {
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
package callbackstruct
|
package callbackstruct
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
|
||||||
common "github.com/OpenIMSDK/protocol/sdkws"
|
common "github.com/OpenIMSDK/protocol/sdkws"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CallbackCommand string
|
type CallbackCommand string
|
||||||
|
@ -16,6 +16,7 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
config2 "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
config2 "github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -20,8 +20,9 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/startrpc"
|
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/startrpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RpcCmd struct {
|
type RpcCmd struct {
|
||||||
|
@ -16,6 +16,7 @@ package config
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/tools/discoveryregistry"
|
"github.com/OpenIMSDK/tools/discoveryregistry"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
@ -17,11 +17,12 @@ package config
|
|||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
||||||
|
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
@ -17,9 +17,10 @@ package convert
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
sdk "github.com/OpenIMSDK/protocol/sdkws"
|
sdk "github.com/OpenIMSDK/protocol/sdkws"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BlackDB2Pb(
|
func BlackDB2Pb(
|
||||||
|
@ -15,9 +15,10 @@
|
|||||||
package convert
|
package convert
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/protocol/conversation"
|
"github.com/OpenIMSDK/protocol/conversation"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ConversationDB2Pb(conversationDB *relation.ConversationModel) *conversation.Conversation {
|
func ConversationDB2Pb(conversationDB *relation.ConversationModel) *conversation.Conversation {
|
||||||
|
@ -17,9 +17,10 @@ package convert
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func FriendPb2DB(friend *sdkws.FriendInfo) *relation.FriendModel {
|
func FriendPb2DB(friend *sdkws.FriendInfo) *relation.FriendModel {
|
||||||
|
@ -17,9 +17,10 @@ package convert
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
pbGroup "github.com/OpenIMSDK/protocol/group"
|
pbGroup "github.com/OpenIMSDK/protocol/group"
|
||||||
sdkws "github.com/OpenIMSDK/protocol/sdkws"
|
sdkws "github.com/OpenIMSDK/protocol/sdkws"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Db2PbGroupInfo(m *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo {
|
func Db2PbGroupInfo(m *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo {
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
package convert
|
package convert
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MsgPb2DB(msg *sdkws.MsgData) *unrelation.MsgDataModel {
|
func MsgPb2DB(msg *sdkws.MsgData) *unrelation.MsgDataModel {
|
||||||
|
@ -17,8 +17,9 @@ package convert
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
|
|
||||||
|
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UsersDB2Pb(users []*relationTb.UserModel) (result []*sdkws.UserInfo) {
|
func UsersDB2Pb(users []*relationTb.UserModel) (result []*sdkws.UserInfo) {
|
||||||
|
3
pkg/common/db/cache/conversation.go
vendored
3
pkg/common/db/cache/conversation.go
vendored
@ -24,9 +24,10 @@ import (
|
|||||||
"github.com/dtm-labs/rockscache"
|
"github.com/dtm-labs/rockscache"
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
||||||
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
3
pkg/common/db/cache/friend.go
vendored
3
pkg/common/db/cache/friend.go
vendored
@ -21,8 +21,9 @@ import (
|
|||||||
"github.com/dtm-labs/rockscache"
|
"github.com/dtm-labs/rockscache"
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
|
|
||||||
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
3
pkg/common/db/cache/group.go
vendored
3
pkg/common/db/cache/group.go
vendored
@ -23,9 +23,10 @@ import (
|
|||||||
"github.com/dtm-labs/rockscache"
|
"github.com/dtm-labs/rockscache"
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
unrelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
unrelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
3
pkg/common/db/cache/init_redis.go
vendored
3
pkg/common/db/cache/init_redis.go
vendored
@ -22,9 +22,10 @@ import (
|
|||||||
|
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/mw/specialerror"
|
"github.com/OpenIMSDK/tools/mw/specialerror"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
8
pkg/common/db/cache/msg.go
vendored
8
pkg/common/db/cache/msg.go
vendored
@ -16,23 +16,25 @@ package cache
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
||||||
|
|
||||||
"github.com/dtm-labs/rockscache"
|
"github.com/dtm-labs/rockscache"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
|
|
||||||
"github.com/gogo/protobuf/jsonpb"
|
"github.com/gogo/protobuf/jsonpb"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
|
||||||
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/protocol/sdkws"
|
"github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
|
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
||||||
|
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
13
pkg/common/db/cache/user.go
vendored
13
pkg/common/db/cache/user.go
vendored
@ -17,12 +17,13 @@ package cache
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/OpenIMSDK/protocol/user"
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
|
||||||
"hash/crc32"
|
"hash/crc32"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/protocol/user"
|
||||||
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
|
|
||||||
"github.com/dtm-labs/rockscache"
|
"github.com/dtm-labs/rockscache"
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
|
|
||||||
@ -163,12 +164,12 @@ func (u *UserCacheRedis) getOnlineStatusKey(userID string) string {
|
|||||||
return olineStatusKey + userID
|
return olineStatusKey + userID
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUserStatus get user status
|
// GetUserStatus get user status.
|
||||||
func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) {
|
func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) {
|
||||||
var res []*user.OnlineStatus
|
var res []*user.OnlineStatus
|
||||||
for _, userID := range userIDs {
|
for _, userID := range userIDs {
|
||||||
UserIDNum := crc32.ChecksumIEEE([]byte(userID))
|
UserIDNum := crc32.ChecksumIEEE([]byte(userID))
|
||||||
var modKey = strconv.Itoa(int(UserIDNum % statusMod))
|
modKey := strconv.Itoa(int(UserIDNum % statusMod))
|
||||||
var onlineStatus user.OnlineStatus
|
var onlineStatus user.OnlineStatus
|
||||||
key := olineStatusKey + modKey
|
key := olineStatusKey + modKey
|
||||||
result, err := u.rdb.HGet(ctx, key, userID).Result()
|
result, err := u.rdb.HGet(ctx, key, userID).Result()
|
||||||
@ -195,12 +196,12 @@ func (u *UserCacheRedis) GetUserStatus(ctx context.Context, userIDs []string) ([
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetUserStatus Set the user status and save it in redis
|
// SetUserStatus Set the user status and save it in redis.
|
||||||
func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
|
func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
|
||||||
for _, status := range list {
|
for _, status := range list {
|
||||||
var isNewKey int64
|
var isNewKey int64
|
||||||
UserIDNum := crc32.ChecksumIEEE([]byte(status.UserID))
|
UserIDNum := crc32.ChecksumIEEE([]byte(status.UserID))
|
||||||
var modKey = strconv.Itoa(int(UserIDNum % statusMod))
|
modKey := strconv.Itoa(int(UserIDNum % statusMod))
|
||||||
key := olineStatusKey + modKey
|
key := olineStatusKey + modKey
|
||||||
jsonData, err := json.Marshal(status)
|
jsonData, err := json.Marshal(status)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -16,14 +16,16 @@ package controller
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
|
||||||
|
|
||||||
"github.com/golang-jwt/jwt/v4"
|
"github.com/golang-jwt/jwt/v4"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/tools/tokenverify"
|
"github.com/OpenIMSDK/tools/tokenverify"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AuthDatabase interface {
|
type AuthDatabase interface {
|
||||||
|
@ -17,10 +17,11 @@ package controller
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BlackDatabase interface {
|
type BlackDatabase interface {
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
package controller
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
pbMsg "github.com/OpenIMSDK/protocol/msg"
|
pbMsg "github.com/OpenIMSDK/protocol/msg"
|
||||||
|
|
||||||
|
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ChatLogDatabase interface {
|
type ChatLogDatabase interface {
|
||||||
|
@ -16,15 +16,17 @@ package controller
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/msgprocessor"
|
||||||
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/tx"
|
"github.com/OpenIMSDK/tools/tx"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConversationDatabase interface {
|
type ConversationDatabase interface {
|
||||||
|
@ -20,14 +20,15 @@ import (
|
|||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/log"
|
"github.com/OpenIMSDK/tools/log"
|
||||||
"github.com/OpenIMSDK/tools/mcontext"
|
"github.com/OpenIMSDK/tools/mcontext"
|
||||||
"github.com/OpenIMSDK/tools/tx"
|
"github.com/OpenIMSDK/tools/tx"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FriendDatabase interface {
|
type FriendDatabase interface {
|
||||||
|
@ -24,14 +24,15 @@ import (
|
|||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
|
"github.com/OpenIMSDK/tools/tx"
|
||||||
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation"
|
||||||
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
|
||||||
"github.com/OpenIMSDK/tools/tx"
|
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type GroupDatabase interface {
|
type GroupDatabase interface {
|
||||||
|
@ -21,6 +21,9 @@ import (
|
|||||||
|
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
|
"github.com/OpenIMSDK/tools/log"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
@ -28,8 +31,6 @@ import (
|
|||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/kafka"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/prome"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
|
||||||
"github.com/OpenIMSDK/tools/log"
|
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
|
||||||
|
@ -18,13 +18,15 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
||||||
"github.com/OpenIMSDK/protocol/user"
|
"github.com/OpenIMSDK/protocol/user"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
unRelationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
"github.com/OpenIMSDK/tools/tx"
|
"github.com/OpenIMSDK/tools/tx"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserDatabase interface {
|
type UserDatabase interface {
|
||||||
@ -162,17 +164,17 @@ func (u *userDatabase) IsExist(ctx context.Context, userIDs []string) (exist boo
|
|||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAllUserID Get all user IDs
|
// GetAllUserID Get all user IDs.
|
||||||
func (u *userDatabase) GetAllUserID(ctx context.Context, pageNumber, showNumber int32) (userIDs []string, err error) {
|
func (u *userDatabase) GetAllUserID(ctx context.Context, pageNumber, showNumber int32) (userIDs []string, err error) {
|
||||||
return u.userDB.GetAllUserID(ctx, pageNumber, showNumber)
|
return u.userDB.GetAllUserID(ctx, pageNumber, showNumber)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CountTotal Get the total number of users
|
// CountTotal Get the total number of users.
|
||||||
func (u *userDatabase) CountTotal(ctx context.Context, before *time.Time) (count int64, err error) {
|
func (u *userDatabase) CountTotal(ctx context.Context, before *time.Time) (count int64, err error) {
|
||||||
return u.userDB.CountTotal(ctx, before)
|
return u.userDB.CountTotal(ctx, before)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CountRangeEverydayTotal Get the user increment in the range
|
// CountRangeEverydayTotal Get the user increment in the range.
|
||||||
func (u *userDatabase) CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) {
|
func (u *userDatabase) CountRangeEverydayTotal(ctx context.Context, start time.Time, end time.Time) (map[string]int64, error) {
|
||||||
return u.userDB.CountRangeEverydayTotal(ctx, start, end)
|
return u.userDB.CountRangeEverydayTotal(ctx, start, end)
|
||||||
}
|
}
|
||||||
@ -198,7 +200,7 @@ func (u *userDatabase) GetAllSubscribeList(ctx context.Context, userID string) (
|
|||||||
return list, nil
|
return list, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSubscribedList Get all subscribed lists
|
// GetSubscribedList Get all subscribed lists.
|
||||||
func (u *userDatabase) GetSubscribedList(ctx context.Context, userID string) ([]string, error) {
|
func (u *userDatabase) GetSubscribedList(ctx context.Context, userID string) ([]string, error) {
|
||||||
list, err := u.mongoDB.GetSubscribedList(ctx, userID)
|
list, err := u.mongoDB.GetSubscribedList(ctx, userID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -207,13 +209,13 @@ func (u *userDatabase) GetSubscribedList(ctx context.Context, userID string) ([]
|
|||||||
return list, nil
|
return list, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUserStatus get user status
|
// GetUserStatus get user status.
|
||||||
func (u *userDatabase) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) {
|
func (u *userDatabase) GetUserStatus(ctx context.Context, userIDs []string) ([]*user.OnlineStatus, error) {
|
||||||
onlineStatusList, err := u.cache.GetUserStatus(ctx, userIDs)
|
onlineStatusList, err := u.cache.GetUserStatus(ctx, userIDs)
|
||||||
return onlineStatusList, err
|
return onlineStatusList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetUserStatus Set the user status and save it in redis
|
// SetUserStatus Set the user status and save it in redis.
|
||||||
func (u *userDatabase) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
|
func (u *userDatabase) SetUserStatus(ctx context.Context, list []*user.OnlineStatus) error {
|
||||||
return u.cache.SetUserStatus(ctx, list)
|
return u.cache.SetUserStatus(ctx, list)
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/conversation"
|
"github.com/OpenIMSDK/protocol/conversation"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConversationLocalCache struct {
|
type ConversationLocalCache struct {
|
||||||
|
@ -18,9 +18,10 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
|
||||||
"github.com/OpenIMSDK/protocol/group"
|
"github.com/OpenIMSDK/protocol/group"
|
||||||
"github.com/OpenIMSDK/tools/errs"
|
"github.com/OpenIMSDK/tools/errs"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GroupLocalCache struct {
|
type GroupLocalCache struct {
|
||||||
|
@ -21,8 +21,9 @@ import (
|
|||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BlackGorm struct {
|
type BlackGorm struct {
|
||||||
|
@ -20,11 +20,12 @@ import (
|
|||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
|
||||||
"github.com/OpenIMSDK/protocol/constant"
|
"github.com/OpenIMSDK/protocol/constant"
|
||||||
pbMsg "github.com/OpenIMSDK/protocol/msg"
|
pbMsg "github.com/OpenIMSDK/protocol/msg"
|
||||||
sdkws "github.com/OpenIMSDK/protocol/sdkws"
|
sdkws "github.com/OpenIMSDK/protocol/sdkws"
|
||||||
"github.com/OpenIMSDK/tools/utils"
|
"github.com/OpenIMSDK/tools/utils"
|
||||||
|
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ChatLogGorm struct {
|
type ChatLogGorm struct {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user