Merge pull request #9 from xmcy0011/dev

change project layout
pull/33/head
skiffer-git 3 years ago committed by GitHub
commit f16cd5b8db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
.gitignore vendored

@ -0,0 +1,2 @@
bin
logs

4
.gitmodules vendored

@ -0,0 +1,4 @@
[submodule "cmd/Open-IM-SDK-Core"]
path = cmd/Open-IM-SDK-Core
url = https://github.com/OpenIMSDK/Open-IM-SDK-Core.git

@ -42,7 +42,7 @@ By deployment of the Open-IM-Server on the customer's server, developers can int
2. Clone the Open-IM project to your server.
```
git clone https://github.com/OpenIMSDK/Open-IM-Server.git
git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive
```
3. Build and start Service.
@ -86,7 +86,7 @@ All images are available at https://hub.docker.com/r/lyt1123/open_im_server
3. Clone the Open-IM project to your server.
```
git clone https://github.com/OpenIMSDK/Open-IM-Server.git
git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive
```
4. Start docker-compose with one click(Docker automatically pulls all images)

@ -2,13 +2,11 @@
BINARY_NAME=open_im_api
BIN_DIR=../../bin/
LAN_FILE=.go
GO_FILE:=${BINARY_NAME}${LAN_FILE}
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} ${GO_FILE}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
run:
@go run ./

@ -1,14 +1,15 @@
package main
import (
apiAuth "Open_IM/src/api/auth"
apiChat "Open_IM/src/api/chat"
"Open_IM/src/api/friend"
"Open_IM/src/api/group"
"Open_IM/src/api/manage"
apiThird "Open_IM/src/api/third"
"Open_IM/src/api/user"
"Open_IM/src/utils"
apiAuth "Open_IM/internal/api/auth"
apiChat "Open_IM/internal/api/chat"
"Open_IM/internal/api/friend"
"Open_IM/internal/api/group"
"Open_IM/internal/api/manage"
apiThird "Open_IM/internal/api/third"
"Open_IM/internal/api/user"
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
"flag"
"github.com/gin-gonic/gin"
"strconv"
@ -93,7 +94,7 @@ func main() {
managementGroup.POST("/send_msg", manage.ManagementSendMsg)
managementGroup.POST("/get_all_users_uid", manage.GetAllUsersUid)
}
log.NewPrivateLog("api")
ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port")
flag.Parse()
r.Run(utils.ServerIP + ":" + strconv.Itoa(*ginPort))

@ -2,13 +2,11 @@
BINARY_NAME=open_im_msg_gateway
BIN_DIR=../../bin/
LAN_FILE=.go
GO_FILE:=${BINARY_NAME}${LAN_FILE}
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o ${BINARY_NAME} ${GO_FILE}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s"
run:
@go run ./

@ -1,7 +1,7 @@
package main
import (
"Open_IM/src/msg_gateway/gate"
"Open_IM/internal/msg_gateway/gate"
"flag"
"sync"
)

@ -2,13 +2,11 @@
BINARY_NAME=open_im_msg_transfer
BIN_DIR=../../bin/
LAN_FILE=.go
GO_FILE:=${BINARY_NAME}${LAN_FILE}
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o ${BINARY_NAME} ${GO_FILE}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s"
run:
@go run ./

@ -1,7 +1,7 @@
package main
import (
"Open_IM/src/msg_transfer/logic"
"Open_IM/internal/msg_transfer/logic"
"sync"
)

@ -2,13 +2,11 @@
BINARY_NAME=open_im_push
BIN_DIR=../../bin/
LAN_FILE=.go
GO_FILE:=${BINARY_NAME}${LAN_FILE}
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o ${BINARY_NAME} ${GO_FILE}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s"
run:
@go run ./

@ -1,7 +1,7 @@
package main
import (
"Open_IM/src/push/logic"
"Open_IM/internal/push/logic"
"flag"
"sync"
)

@ -1,8 +1,8 @@
package main
import (
"Open_IM/src/common/config"
"Open_IM/src/common/db"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/db"
"fmt"
"time"
)

@ -2,13 +2,11 @@
BINARY_NAME=open_im_auth
BIN_DIR=../../../bin/
LAN_FILE=.go
GO_FILE:=${BINARY_NAME}${LAN_FILE}
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} ${GO_FILE}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
run:
@go run ./

@ -1,7 +1,7 @@
package main
import (
rpcAuth "Open_IM/src/rpc/auth/auth"
rpcAuth "Open_IM/internal/rpc/auth"
"flag"
)

@ -2,13 +2,11 @@
BINARY_NAME=open_im_friend
BIN_DIR=../../../bin/
LAN_FILE=.go
GO_FILE:=${BINARY_NAME}${LAN_FILE}
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} ${GO_FILE}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
run:
@go run ./

@ -1,7 +1,7 @@
package main
import (
"Open_IM/src/rpc/friend/friend"
"Open_IM/internal/rpc/friend"
"flag"
)

@ -2,13 +2,11 @@
BINARY_NAME=open_im_group
BIN_DIR=../../../bin/
LAN_FILE=.go
GO_FILE:=${BINARY_NAME}${LAN_FILE}
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} ${GO_FILE}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
run:
@go run ./

@ -1,7 +1,7 @@
package main
import (
"Open_IM/src/rpc/group/group"
"Open_IM/internal/rpc/group"
"flag"
)

@ -2,13 +2,11 @@
BINARY_NAME=open_im_msg
BIN_DIR=../../../bin/
LAN_FILE=.go
GO_FILE:=${BINARY_NAME}${LAN_FILE}
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o ${BINARY_NAME} ${GO_FILE}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s"
run:
@go run ./

@ -1,8 +1,8 @@
package main
import (
rpcChat "Open_IM/src/rpc/chat/chat"
"Open_IM/src/utils"
rpcChat "Open_IM/internal/rpc/chat"
"Open_IM/pkg/utils"
"flag"
)

@ -2,13 +2,11 @@
BINARY_NAME=open_im_user
BIN_DIR=../../../bin/
LAN_FILE=.go
GO_FILE:=${BINARY_NAME}${LAN_FILE}
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${BINARY_NAME} ${GO_FILE}
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
run:
@go run ./

@ -1,7 +1,7 @@
package main
import (
"Open_IM/src/rpc/user/user"
"Open_IM/internal/rpc/user"
"flag"
)

@ -5,12 +5,12 @@
#---------------Infrastructure configuration---------------------#
etcd:
etcdSchema: openIM
etcdAddr: [ 127.0.0.1:2379 ]
etcdAddr: [ 81.68.126.69:2379 ]
mysql:
dbMysqlAddress: [ 127.0.0.1:3306 ]
dbMysqlUserName: root
dbMysqlPassword: openIM
dbMysqlAddress: [ 81.68.126.69:13306 ]
dbMysqlUserName: openIM
dbMysqlPassword: 12345
dbMysqlDatabaseName: openIM
dbTableName: eMsg
dbMsgTableNum: 1
@ -19,18 +19,18 @@ mysql:
dbMaxLifeTime: 120
mongo:
dbAddress: [ 127.0.0.1:27017 ]
dbAddress: [ 81.68.126.69:27017 ]
dbDirect: false
dbTimeout: 10
dbDatabase: openIM
dbSource: admin
dbUserName:
dbPassword:
dbSource: openIM
dbUserName: openIM
dbPassword: 12345
dbMaxPoolSize: 20
dbRetainChatRecords: 7
redis:
dbAddress: 127.0.0.1:6379
dbAddress: 81.68.126.69:16379
dbMaxIdle: 128
dbMaxActive: 0
dbIdleTimeout: 120
@ -38,10 +38,10 @@ redis:
kafka:
ws2mschat:
addr: [ 127.0.0.1:9092 ]
addr: [ 81.68.126.69:9092 ]
topic: "ws2ms_chat"
ms2pschat:
addr: [ 127.0.0.1:9092 ]
addr: [ 81.68.126.69:9092 ]
topic: "ms2ps_chat"
consumergroupid:
msgToMongo: mongo
@ -59,6 +59,8 @@ serverip:
api:
openImApiPort: [ 10000 ]
sdk:
openImSdkWsPort: [ 30000 ]
credential:
tencent:
@ -86,12 +88,13 @@ rpcregistername:
openImPushName: Push
openImOnlineMessageRelayName: OnlineMessageRelay
openImGroupName: Group
rpcGetTokenName: Auth
openImAuthName: Auth
log:
storageLocation: ../logs/
rotationTime: 12
remainRotationCount: 10
rotationTime: 24
remainRotationCount: 5
remainLogLevel: 6
elasticSearchSwitch: false
elasticSearchAddr: [ 127.0.0.1:9201 ]
elasticSearchUser: ""
@ -103,7 +106,7 @@ modulename:
pushName: push
longconnsvr:
websocketPort: [ 17778 ]
openImWsPort: [ 17778 ]
websocketMaxConnNum: 10000
websocketMaxMsgLen: 4096
websocketTimeOut: 10

@ -28,7 +28,7 @@ RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure
#set directory to map logs,config file,script file.
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"]
#Copy scripts files and binary files to the blank image
COPY --from=build /Open-IM-Server/script /Open-IM-Server/script
@ -36,4 +36,4 @@ COPY --from=build /Open-IM-Server/bin /Open-IM-Server/bin
WORKDIR /Open-IM-Server/script
CMD ["./docker_start_all.sh"]
CMD ["./docker_start_all.sh"]

@ -84,25 +84,28 @@ services:
#fixme-----build from dockerfile---------
# open-im-server:
# image: open_im_server
# ports:
# - 10000:10000
# - 17778:17778
# container_name: open-im-server
# volumes:
# - ./logs:/Open-IM-Server/logs
# - ./config/config.yaml:/Open-IM-Server/config/config.yaml
# restart: always
# build:
# context: .
# dockerfile: deploy.Dockerfile
# depends_on:
# - mysql
# - mongodb
# - redis
# - kafka
# - etcd
# open-im-server:
# image: open_im_server
# container_name: open-im-server
# volumes:
# - ./logs:/Open-IM-Server/logs
# - ./config/config.yaml:/Open-IM-Server/config/config.yaml
# restart: always
# build:
# context: .
# dockerfile: deploy.Dockerfile
# depends_on:
# - mysql
# - mongodb
# - redis
# - kafka
# - etcd
# network_mode: "host"
# logging:
# driver: json-file
# options:
# max-size: "1g"
# max-file: "2"
#fixme----build from docker hub------
open-im-server:

@ -1,10 +1,10 @@
package apiAuth
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbAuth "Open_IM/src/proto/auth"
pbAuth "Open_IM/pkg/proto/auth"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"
@ -40,7 +40,7 @@ func newUserRegisterReq(params *paramsUserRegister) *pbAuth.UserRegisterReq {
func UserRegister(c *gin.Context) {
log.Info("", "", "api user_register init ....")
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.RpcGetTokenName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName)
client := pbAuth.NewAuthClient(etcdConn)
//defer etcdConn.Close()

@ -1,10 +1,10 @@
package apiAuth
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbAuth "Open_IM/src/proto/auth"
pbAuth "Open_IM/pkg/proto/auth"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"
@ -13,7 +13,7 @@ import (
type paramsUserToken struct {
Secret string `json:"secret" binding:"required,max=32"`
Platform int32 `json:"platform" binding:"required,min=1,max=7"`
Platform int32 `json:"platform" binding:"required,min=1,max=8"`
UID string `json:"uid" binding:"required,min=1,max=64"`
}
@ -27,7 +27,7 @@ func newUserTokenReq(params *paramsUserToken) *pbAuth.UserTokenReq {
func UserToken(c *gin.Context) {
log.Info("", "", "api user_token init ....")
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.RpcGetTokenName)
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName)
client := pbAuth.NewAuthClient(etcdConn)
//defer etcdConn.Close()

@ -1,11 +1,11 @@
package apiChat
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbMsg "Open_IM/src/proto/chat"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbMsg "Open_IM/pkg/proto/chat"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,11 +1,11 @@
package apiChat
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
"Open_IM/src/proto/chat"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"Open_IM/pkg/proto/chat"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,13 +1,13 @@
package apiChat
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
pbChat "Open_IM/src/proto/chat"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
pbChat "Open_IM/pkg/proto/chat"
"Open_IM/pkg/utils"
"context"
"Open_IM/src/grpc-etcdv3/getcdv3"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"github.com/gin-gonic/gin"
"net/http"
"strings"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"fmt"
"github.com/gin-gonic/gin"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"fmt"
"github.com/gin-gonic/gin"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"fmt"
"github.com/gin-gonic/gin"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"fmt"
"github.com/gin-gonic/gin"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"fmt"
"github.com/gin-gonic/gin"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pb "Open_IM/src/proto/group"
pb "Open_IM/pkg/proto/group"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"
@ -40,7 +40,7 @@ func CreateGroup(c *gin.Context) {
Notification: params.Notification,
FaceUrl: params.FaceUrl,
OperationID: params.OperationID,
Ex: params.Ex,
Ex: params.Ex,
Token: c.Request.Header.Get("token"),
}
log.Info(req.Token, req.OperationID, "api create group is server,params=%s", req.String())

@ -1,11 +1,11 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
"Open_IM/src/proto/group"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"Open_IM/pkg/proto/group"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pb "Open_IM/src/proto/group"
pb "Open_IM/pkg/proto/group"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pb "Open_IM/src/proto/group"
pb "Open_IM/pkg/proto/group"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"fmt"
"github.com/gin-gonic/gin"

@ -1,11 +1,11 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
"Open_IM/src/proto/group"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"Open_IM/pkg/proto/group"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pb "Open_IM/src/proto/group"
pb "Open_IM/pkg/proto/group"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pb "Open_IM/src/proto/group"
pb "Open_IM/pkg/proto/group"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pb "Open_IM/src/proto/group"
pb "Open_IM/pkg/proto/group"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,11 +1,11 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
"Open_IM/src/proto/group"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"Open_IM/pkg/proto/group"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -7,12 +7,12 @@
package manage
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbChat "Open_IM/src/proto/chat"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbChat "Open_IM/pkg/proto/chat"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"github.com/go-playground/validator/v10"

@ -7,10 +7,10 @@
package manage
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbUser "Open_IM/src/proto/user"
pbUser "Open_IM/pkg/proto/user"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,8 +1,8 @@
package apiThird
import (
"Open_IM/src/common/config"
log2 "Open_IM/src/common/log"
"Open_IM/pkg/common/config"
log2 "Open_IM/pkg/common/log"
"github.com/gin-gonic/gin"
sts "github.com/tencentyun/qcloud-cos-sts-sdk/go"
"net/http"

@ -1,10 +1,10 @@
package user
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbUser "Open_IM/src/proto/user"
pbUser "Open_IM/pkg/proto/user"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,10 +1,10 @@
package user
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbUser "Open_IM/src/proto/user"
pbUser "Open_IM/pkg/proto/user"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"github.com/gin-gonic/gin"
"net/http"

@ -1,8 +1,8 @@
package gate
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"github.com/go-playground/validator/v10"
"sync"
)

@ -1,12 +1,12 @@
package gate
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbChat "Open_IM/src/proto/chat"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbChat "Open_IM/pkg/proto/chat"
"Open_IM/pkg/utils"
"context"
"encoding/json"
"github.com/gorilla/websocket"

@ -1,12 +1,12 @@
package gate
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbRelay "Open_IM/src/proto/relay"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbRelay "Open_IM/pkg/proto/relay"
"Open_IM/pkg/utils"
"context"
"encoding/json"
"fmt"

@ -7,8 +7,8 @@
package gate
import (
"Open_IM/src/common/constant"
"Open_IM/src/common/log"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"github.com/mitchellh/mapstructure"
)

@ -1,9 +1,9 @@
package gate
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
"github.com/gorilla/websocket"
"net/http"
"time"

@ -1,9 +1,9 @@
package logic
import (
"Open_IM/src/common/db"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
pbMsg "Open_IM/src/proto/chat"
pbMsg "Open_IM/pkg/proto/chat"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
)
func saveUserChat(uid string, pbMsg *pbMsg.MsgSvrToPushSvrChatMsg) error {

@ -1,14 +1,14 @@
package logic
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
kfk "Open_IM/src/common/kafka"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbMsg "Open_IM/src/proto/chat"
pbPush "Open_IM/src/proto/push"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
kfk "Open_IM/pkg/common/kafka"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbMsg "Open_IM/pkg/proto/chat"
pbPush "Open_IM/pkg/proto/push"
"Open_IM/pkg/utils"
"context"
"github.com/Shopify/sarama"
"github.com/golang/protobuf/proto"

@ -1,9 +1,9 @@
package logic
import (
"Open_IM/src/common/config"
"Open_IM/src/common/kafka"
"Open_IM/src/common/log"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/kafka"
"Open_IM/pkg/common/log"
)
var (

@ -7,13 +7,13 @@
package logic
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/db/mysql_model/im_mysql_msg_model"
kfk "Open_IM/src/common/kafka"
"Open_IM/src/common/log"
pbMsg "Open_IM/src/proto/chat"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db/mysql_model/im_mysql_msg_model"
kfk "Open_IM/pkg/common/kafka"
"Open_IM/pkg/common/log"
pbMsg "Open_IM/pkg/proto/chat"
"Open_IM/pkg/utils"
"github.com/Shopify/sarama"
"github.com/golang/protobuf/proto"
"strings"

@ -7,10 +7,10 @@
package logic
import (
"Open_IM/src/common/config"
"Open_IM/src/common/kafka"
"Open_IM/src/common/log"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/kafka"
"Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
)
var (

@ -7,11 +7,11 @@
package logic
import (
"Open_IM/src/common/config"
kfk "Open_IM/src/common/kafka"
"Open_IM/src/common/log"
pbChat "Open_IM/src/proto/chat"
pbRelay "Open_IM/src/proto/relay"
"Open_IM/pkg/common/config"
kfk "Open_IM/pkg/common/kafka"
"Open_IM/pkg/common/log"
pbChat "Open_IM/pkg/proto/chat"
pbRelay "Open_IM/pkg/proto/relay"
"github.com/Shopify/sarama"
"github.com/golang/protobuf/proto"
)

@ -1,12 +1,12 @@
package logic
import (
"Open_IM/src/common/config"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
"Open_IM/src/proto/push"
pbRelay "Open_IM/src/proto/relay"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"Open_IM/pkg/proto/push"
pbRelay "Open_IM/pkg/proto/relay"
"Open_IM/pkg/utils"
"context"
"google.golang.org/grpc"
"net"

@ -7,17 +7,17 @@
package logic
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbChat "Open_IM/src/proto/chat"
pbGroup "Open_IM/src/proto/group"
pbRelay "Open_IM/src/proto/relay"
pbGetInfo "Open_IM/src/proto/user"
rpcChat "Open_IM/src/rpc/chat/chat"
"Open_IM/src/rpc/user/internal_service"
"Open_IM/src/utils"
rpcChat "Open_IM/internal/rpc/chat"
"Open_IM/internal/rpc/user/internal_service"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
pbChat "Open_IM/pkg/proto/chat"
pbGroup "Open_IM/pkg/proto/group"
pbRelay "Open_IM/pkg/proto/relay"
pbGetInfo "Open_IM/pkg/proto/user"
"Open_IM/pkg/utils"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
"context"
"encoding/json"
"fmt"

@ -1,11 +1,11 @@
package logic
import (
"Open_IM/src/common/config"
tpns "Open_IM/src/push/sdk/tpns-server-sdk-go/go"
"Open_IM/src/push/sdk/tpns-server-sdk-go/go/auth"
"Open_IM/src/push/sdk/tpns-server-sdk-go/go/common"
"Open_IM/src/push/sdk/tpns-server-sdk-go/go/req"
tpns "Open_IM/internal/push/sdk/tpns-server-sdk-go/go"
"Open_IM/internal/push/sdk/tpns-server-sdk-go/go/auth"
"Open_IM/internal/push/sdk/tpns-server-sdk-go/go/common"
"Open_IM/internal/push/sdk/tpns-server-sdk-go/go/req"
"Open_IM/pkg/common/config"
)
var badgeType = -2

@ -1,7 +1,7 @@
package common
import (
tpns "Open_IM/src/push/sdk/tpns-server-sdk-go/go"
tpns "Open_IM/internal/push/sdk/tpns-server-sdk-go/go"
"encoding/json"
"fmt"
"io/ioutil"

@ -1,7 +1,7 @@
package req
import (
tpns "Open_IM/src/push/sdk/tpns-server-sdk-go/go"
tpns "Open_IM/internal/push/sdk/tpns-server-sdk-go/go"
"bytes"
"encoding/json"
"io"

@ -1,11 +1,11 @@
package rpcAuth
package auth
import (
"Open_IM/src/common/config"
log2 "Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbAuth "Open_IM/src/proto/auth"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbAuth "Open_IM/pkg/proto/auth"
"Open_IM/pkg/utils"
"google.golang.org/grpc"
"net"
"strconv"
@ -20,24 +20,25 @@ type rpcAuth struct {
}
func NewRpcAuthServer(port int) *rpcAuth {
log.NewPrivateLog("auth")
return &rpcAuth{
rpcPort: port,
rpcRegisterName: config.Config.RpcRegisterName.RpcGetTokenName,
rpcRegisterName: config.Config.RpcRegisterName.OpenImAuthName,
etcdSchema: config.Config.Etcd.EtcdSchema,
etcdAddr: config.Config.Etcd.EtcdAddr,
}
}
func (rpc *rpcAuth) Run() {
log2.Info("", "", "rpc get_token init...")
log.Info("", "", "rpc get_token init...")
address := utils.ServerIP + ":" + strconv.Itoa(rpc.rpcPort)
listener, err := net.Listen("tcp", address)
if err != nil {
log2.Error("", "", "listen network failed, err = %s, address = %s", err.Error(), address)
log.Error("", "", "listen network failed, err = %s, address = %s", err.Error(), address)
return
}
log2.Info("", "", "listen network success, address = %s", address)
log.Info("", "", "listen network success, address = %s", address)
//grpc server
srv := grpc.NewServer()
@ -48,14 +49,14 @@ func (rpc *rpcAuth) Run() {
pbAuth.RegisterAuthServer(srv, rpc)
err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName, 10)
if err != nil {
log2.Error("", "", "register rpc get_token to etcd failed, err = %s", err.Error())
log.Error("", "", "register rpc get_token to etcd failed, err = %s", err.Error())
return
}
err = srv.Serve(listener)
if err != nil {
log2.Info("", "", "rpc get_token fail, err = %s", err.Error())
log.Info("", "", "rpc get_token fail, err = %s", err.Error())
return
}
log2.Info("", "", "rpc get_token init success")
log.Info("", "", "rpc get_token init success")
}

@ -1,9 +1,9 @@
package rpcAuth
package auth
import (
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbAuth "Open_IM/src/proto/auth"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbAuth "Open_IM/pkg/proto/auth"
"context"
)

@ -1,10 +1,10 @@
package rpcAuth
package auth
import (
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbAuth "Open_IM/src/proto/auth"
"Open_IM/src/utils"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbAuth "Open_IM/pkg/proto/auth"
"Open_IM/pkg/utils"
"context"
)

@ -1,16 +1,16 @@
package rpcChat
package chat
import (
"context"
"github.com/garyburd/redigo/redis"
commonDB "Open_IM/src/common/db"
"Open_IM/src/common/log"
commonDB "Open_IM/pkg/common/db"
"Open_IM/pkg/common/log"
"sort"
"strings"
pbMsg "Open_IM/src/proto/chat"
pbMsg "Open_IM/pkg/proto/chat"
)
func (rpc *rpcChat) GetNewSeq(_ context.Context, in *pbMsg.GetNewSeqReq) (*pbMsg.GetNewSeqResp, error) {

@ -1,12 +1,12 @@
package rpcChat
package chat
import (
"Open_IM/src/common/config"
"Open_IM/src/common/kafka"
log2 "Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbChat "Open_IM/src/proto/chat"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/kafka"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbChat "Open_IM/pkg/proto/chat"
"Open_IM/pkg/utils"
"google.golang.org/grpc"
"net"
"strconv"
@ -22,6 +22,7 @@ type rpcChat struct {
}
func NewRpcChatServer(port int) *rpcChat {
log.NewPrivateLog("msg")
rc := rpcChat{
rpcPort: port,
rpcRegisterName: config.Config.RpcRegisterName.OpenImOfflineMessageName,
@ -33,15 +34,15 @@ func NewRpcChatServer(port int) *rpcChat {
}
func (rpc *rpcChat) Run() {
log2.Info("", "", "rpc get_token init...")
log.Info("", "", "rpc get_token init...")
address := utils.ServerIP + ":" + strconv.Itoa(rpc.rpcPort)
listener, err := net.Listen("tcp", address)
if err != nil {
log2.Error("", "", "listen network failed, err = %s, address = %s", err.Error(), address)
log.Error("", "", "listen network failed, err = %s, address = %s", err.Error(), address)
return
}
log2.Info("", "", "listen network success, address = %s", address)
log.Info("", "", "listen network success, address = %s", address)
//grpc server
srv := grpc.NewServer()
@ -52,14 +53,14 @@ func (rpc *rpcChat) Run() {
pbChat.RegisterChatServer(srv, rpc)
err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName, 10)
if err != nil {
log2.Error("", "", "register rpc get_token to etcd failed, err = %s", err.Error())
log.Error("", "", "register rpc get_token to etcd failed, err = %s", err.Error())
return
}
err = srv.Serve(listener)
if err != nil {
log2.Info("", "", "rpc get_token fail, err = %s", err.Error())
log.Info("", "", "rpc get_token fail, err = %s", err.Error())
return
}
log2.Info("", "", "rpc get_token init success")
log.Info("", "", "rpc get_token init success")
}

@ -1,16 +1,16 @@
package rpcChat
package chat
import (
"Open_IM/src/api/group"
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
http2 "Open_IM/src/common/http"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbChat "Open_IM/src/proto/chat"
pbGroup "Open_IM/src/proto/group"
"Open_IM/src/push/content_struct"
"Open_IM/src/utils"
"Open_IM/internal/api/group"
"Open_IM/internal/push/content_struct"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
http2 "Open_IM/pkg/common/http"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbChat "Open_IM/pkg/proto/chat"
pbGroup "Open_IM/pkg/proto/group"
"Open_IM/pkg/utils"
"context"
"encoding/json"
"math/rand"

@ -1,11 +1,11 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
)

@ -1,15 +1,15 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbChat "Open_IM/src/proto/chat"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/push/content_struct"
"Open_IM/src/push/logic"
"Open_IM/src/utils"
"Open_IM/internal/push/content_struct"
"Open_IM/internal/push/logic"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbChat "Open_IM/pkg/proto/chat"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
)
@ -110,6 +110,10 @@ func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFri
SessionType: constant.SingleChatType,
OperationID: req.OperationID,
})
} else {
resp.CommonResp.ErrorMsg = "some uid establish failed"
resp.CommonResp.ErrorCode = 408
resp.FailedUidList = append(resp.FailedUidList, v)
}
}
}

@ -1,15 +1,15 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbChat "Open_IM/src/proto/chat"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/push/content_struct"
"Open_IM/src/push/logic"
"Open_IM/src/utils"
"Open_IM/internal/push/content_struct"
"Open_IM/internal/push/logic"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbChat "Open_IM/pkg/proto/chat"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
)

@ -1,11 +1,11 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
)

@ -1,11 +1,11 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
)

@ -1,13 +1,13 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
"fmt"
"google.golang.org/grpc"
@ -24,6 +24,7 @@ type friendServer struct {
}
func NewFriendServer(port int) *friendServer {
log.NewPrivateLog("friend")
return &friendServer{
rpcPort: port,
rpcRegisterName: config.Config.RpcRegisterName.OpenImFriendName,

@ -1,11 +1,11 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
"fmt"
"strconv"

@ -1,12 +1,12 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
)

@ -1,12 +1,12 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
"fmt"
)

@ -1,9 +1,9 @@
package friend
import (
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbFriend "Open_IM/pkg/proto/friend"
"context"
"fmt"
)

@ -1,11 +1,11 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
)

@ -1,11 +1,11 @@
package friend
import (
"Open_IM/src/common/config"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbFriend "Open_IM/src/proto/friend"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbFriend "Open_IM/pkg/proto/friend"
"Open_IM/pkg/utils"
"context"
)

@ -1,17 +1,17 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/db"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
"Open_IM/src/grpc-etcdv3/getcdv3"
pbChat "Open_IM/src/proto/chat"
pbGroup "Open_IM/src/proto/group"
"Open_IM/src/push/content_struct"
"Open_IM/src/push/logic"
"Open_IM/src/utils"
"Open_IM/internal/push/content_struct"
"Open_IM/internal/push/logic"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbChat "Open_IM/pkg/proto/chat"
pbGroup "Open_IM/pkg/proto/group"
"Open_IM/pkg/utils"
"context"
"google.golang.org/grpc"
"net"
@ -28,6 +28,7 @@ type groupServer struct {
}
func NewGroupServer(port int) *groupServer {
log.NewPrivateLog("group")
return &groupServer{
rpcPort: port,
rpcRegisterName: config.Config.RpcRegisterName.OpenImGroupName,

@ -1,9 +1,9 @@
package group
import (
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
"Open_IM/src/proto/group"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
"Open_IM/pkg/proto/group"
"context"
)

@ -1,11 +1,11 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbGroup "Open_IM/src/proto/group"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbGroup "Open_IM/pkg/proto/group"
"Open_IM/pkg/utils"
"context"
)

@ -1,18 +1,18 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/constant"
"Open_IM/src/common/db"
pbChat "Open_IM/src/proto/chat"
"Open_IM/src/push/content_struct"
"Open_IM/src/push/logic"
"Open_IM/internal/push/content_struct"
"Open_IM/internal/push/logic"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
pbChat "Open_IM/pkg/proto/chat"
"encoding/json"
imdb "Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbGroup "Open_IM/src/proto/group"
"Open_IM/src/utils"
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbGroup "Open_IM/pkg/proto/group"
"Open_IM/pkg/utils"
"context"
"fmt"
@ -81,7 +81,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
log.Error(claims.UID, req.OperationID, "FindUserByUID failed, err: ", err.Error())
return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrParam.ErrCode, ErrorMsg: config.ErrParam.ErrMsg}, nil
}*/
var nicknameList string
for _, v := range req.UidList {
var resultNode pbGroup.Id2Result
resultNode.UId = v
@ -113,7 +113,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
if err != nil {
log.Error("", "", "add mongo group member failed, db.DB.AddGroupMember fail [err: %s]", err.Error())
}
nicknameList = nicknameList + toUserInfo.Name + " "
resp.Id2Result = append(resp.Id2Result, &resultNode)
}
resp.ErrorCode = 0
@ -121,12 +121,13 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
//if claims.UID == config.Config.AppManagerUid
if utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) {
m, _ := imdb.FindUserByUID(claims.UID)
var iu inviteUserToGroupReq
iu.GroupID = req.GroupID
iu.OperationID = req.OperationID
iu.Reason = req.Reason
iu.UidList = req.UidList
n := content_struct.NotificationContent{1, req.GroupID, iu.ContentToString()}
n := content_struct.NotificationContent{1, nicknameList + " invited into the group chat by " + m.Name, iu.ContentToString()}
logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{
SendID: claims.UID,
RecvID: req.GroupID,

@ -1,10 +1,10 @@
package group
import (
"Open_IM/src/common/db"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
"Open_IM/src/proto/group"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
"Open_IM/pkg/proto/group"
"context"
)

@ -1,11 +1,11 @@
package group
import (
"Open_IM/src/common/config"
"Open_IM/src/common/db/mysql_model/im_mysql_model"
"Open_IM/src/common/log"
pbGroup "Open_IM/src/proto/group"
"Open_IM/src/utils"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
"Open_IM/pkg/common/log"
pbGroup "Open_IM/pkg/proto/group"
"Open_IM/pkg/utils"
"context"
)

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save