Merge branch 'tuoyun' into superGroup

# Conflicts:
#	internal/msg_gateway/gate/callback.go
#	internal/msg_transfer/logic/online_history_msg_handler.go
#	internal/push/logic/callback.go
#	internal/push/logic/push_to_client.go
#	pkg/common/db/model.go
#	pkg/common/db/newRedisModel.go
#	pkg/proto/group/group.pb.go
#	pkg/proto/group/group.proto
pull/236/head
wangchuxiao 3 years ago
commit 5f42748e1b

@ -89,7 +89,7 @@ func main() {
groupRouterGroup.POST("/mute_group", group.MuteGroup) groupRouterGroup.POST("/mute_group", group.MuteGroup)
groupRouterGroup.POST("/cancel_mute_group", group.CancelMuteGroup) groupRouterGroup.POST("/cancel_mute_group", group.CancelMuteGroup)
groupRouterGroup.POST("/set_group_member_nickname", group.SetGroupMemberNickname) groupRouterGroup.POST("/set_group_member_nickname", group.SetGroupMemberNickname)
groupRouterGroup.POST("/set_group_member_info", group.SetGroupMemberInfo)
} }
superGroupRouterGroup := r.Group("/super_group") superGroupRouterGroup := r.Group("/super_group")
{ {
@ -113,6 +113,8 @@ func main() {
thirdGroup.POST("/minio_upload", apiThird.MinioUploadFile) thirdGroup.POST("/minio_upload", apiThird.MinioUploadFile)
thirdGroup.POST("/upload_update_app", apiThird.UploadUpdateApp) thirdGroup.POST("/upload_update_app", apiThird.UploadUpdateApp)
thirdGroup.POST("/get_download_url", apiThird.GetDownloadURL) thirdGroup.POST("/get_download_url", apiThird.GetDownloadURL)
thirdGroup.POST("/get_rtc_invitation_info", apiThird.GetRTCInvitationInfo)
thirdGroup.POST("/get_rtc_invitation_start_app", apiThird.GetRTCInvitationInfoStartApp)
} }
//Message //Message
chatGroup := r.Group("/msg") chatGroup := r.Group("/msg")

@ -1,4 +1,5 @@
# The class cannot be named by Pascal or camel case. # The class cannot be named by Pascal or camel case.
# The class cannot be named by Pascal or camel case.
# If it is not used, the corresponding structure will not be set, # If it is not used, the corresponding structure will not be set,
# and it will not be read naturally. # and it will not be read naturally.
serverversion: 2.0.0 serverversion: 2.0.0
@ -670,7 +671,6 @@ notification:
defaultTips: defaultTips:
tips: "welcome user join department" tips: "welcome user join department"
#---------------demo configuration---------------------# #---------------demo configuration---------------------#
#The following configuration items are applied to openIM Demo configuration #The following configuration items are applied to openIM Demo configuration
#是否启动demo如果自身没有账号体系设置为true #是否启动demo如果自身没有账号体系设置为true
@ -697,5 +697,4 @@ demo:
imAPIURL: http://127.0.0.1:10002 imAPIURL: http://127.0.0.1:10002
rtc: rtc:
port: 11300 signalTimeout: 3000
address: 127.0.0.1

@ -4,15 +4,16 @@ FROM ubuntu
ENV WORKDIR /Open-IM-Server ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_admin_cms $WORKDIR/main ADD ./open_im_admin_cms $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config", "/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: admin-cms - name: admin-cms
image: openim/admin_cms:v2.0.10 image: openim/admin_cms:v2.0.10k
# imagePullPolicy: Always #每次启动都重新拉取镜像
ports: ports:
- containerPort: 10200 - containerPort: 10200
volumeMounts: volumeMounts:

@ -5,14 +5,14 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_api $WORKDIR/main ADD ./open_im_api $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: api - name: api
image: openim/api:v2.0.10 image: openim/api:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10002 - containerPort: 10002
volumeMounts: volumeMounts:

@ -5,14 +5,14 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_auth $WORKDIR/main ADD ./open_im_auth $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: auth - name: auth
image: openim/auth:v2.0.10 image: openim/auth:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10160 - containerPort: 10160
volumeMounts: volumeMounts:

@ -2,8 +2,8 @@
source ./path_info.cfg source ./path_info.cfg
# images version # images version
version=v2.0.10 version=v2.0.10k
git pull
cd ../script/; ./build_all_service.sh cd ../script/; ./build_all_service.sh
cd ../deploy_k8s/ cd ../deploy_k8s/

@ -4,14 +4,15 @@ FROM ubuntu
ENV WORKDIR /Open-IM-Server ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_cache $WORKDIR/main ADD ./open_im_cache $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: cache - name: cache
image: openim/cache:v2.0.10 image: openim/cache:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10240 - containerPort: 10240
volumeMounts: volumeMounts:

@ -5,14 +5,13 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_cms_api $WORKDIR/main ADD ./open_im_cms_api $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"]
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: cms-api - name: cms-api
image: openim/cms_api:v2.0.10 image: openim/cms_api:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10006 - containerPort: 10006
volumeMounts: volumeMounts:

@ -5,14 +5,13 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_conversation $WORKDIR/main ADD ./open_im_conversation $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"]
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: conversation - name: conversation
image: openim/conversation:v2.0.10 image: openim/conversation:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10230 - containerPort: 10230
volumeMounts: volumeMounts:

@ -5,14 +5,14 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_demo $WORKDIR/main ADD ./open_im_demo $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: demo - name: demo
image: openim/demo:v2.0.10 image: openim/demo:v2.0.10k
imagePullPolicy: Always
ports: ports:
- containerPort: 10004 - containerPort: 10004
volumeMounts: volumeMounts:

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: friend - name: friend
image: openim/friend:v2.0.10 image: openim/friend:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10120 - containerPort: 10120
volumeMounts: volumeMounts:

@ -4,15 +4,15 @@ FROM ubuntu
ENV WORKDIR /Open-IM-Server ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_friend $WORKDIR/main ADD ./open_im_friend $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"]
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: group - name: group
image: openim/group:v2.0.10 image: openim/group:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10150 - containerPort: 10150
volumeMounts: volumeMounts:

@ -5,14 +5,14 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_group $WORKDIR/main ADD ./open_im_group $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -7,13 +7,10 @@ metadata:
nginx.ingress.kubernetes.io/proxy-http-version: "1.1" nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
# 使用重写后的路径进行路由
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: "/$1"
name: sdk-server-ingress name: sdk-server-ingress
spec: spec:
rules: rules:
- host: k8s.open-im-test.rentsoft.cn - host: sdk-server.openim.xxx.com
http: http:
paths: paths:
- backend: - backend:
@ -21,7 +18,7 @@ spec:
name: sdk-server name: sdk-server
port: port:
number: 10003 number: 10003
path: /sdk-server/(.*) path: /
pathType: Prefix pathType: Prefix
--- ---
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
@ -32,13 +29,10 @@ metadata:
nginx.ingress.kubernetes.io/proxy-http-version: "1.1" nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
# 使用重写后的路径进行路由
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: "/$1"
name: msg-gateway-ingress name: msg-gateway-ingress
spec: spec:
rules: rules:
- host: k8s.open-im-test.rentsoft.cn - host: msg-gateway.openim.xxx.com
http: http:
paths: paths:
- backend: - backend:
@ -46,7 +40,7 @@ spec:
name: msg-gateway name: msg-gateway
port: port:
number: 10001 number: 10001
path: /msg-gateway/(.*) path: /
pathType: Prefix pathType: Prefix
--- ---
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
@ -54,13 +48,10 @@ kind: Ingress
metadata: metadata:
annotations: annotations:
kubernetes.io/ingress.class: "nginx" kubernetes.io/ingress.class: "nginx"
# 使用重写后的路径进行路由
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: "/$1"
name: api-ingress name: api-ingress
spec: spec:
rules: rules:
- host: k8s.open-im-test.rentsoft.cn - host: api.openim.xxx.com
http: http:
paths: paths:
- backend: - backend:
@ -68,7 +59,7 @@ spec:
name: api name: api
port: port:
number: 10002 number: 10002
path: /api/(.*) path: /
pathType: Prefix pathType: Prefix
--- ---
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
@ -76,13 +67,10 @@ kind: Ingress
metadata: metadata:
annotations: annotations:
kubernetes.io/ingress.class: "nginx" kubernetes.io/ingress.class: "nginx"
# 使用重写后的路径进行路由
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: "/$1"
name: demo-ingress name: demo-ingress
spec: spec:
rules: rules:
- host: k8s.open-im-test.rentsoft.cn - host: demo.openim.xxx.com
http: http:
paths: paths:
- backend: - backend:
@ -90,7 +78,7 @@ spec:
name: demo name: demo
port: port:
number: 10004 number: 10004
path: /demo/(.*) path: /
pathType: Prefix pathType: Prefix
--- ---
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
@ -98,13 +86,10 @@ kind: Ingress
metadata: metadata:
annotations: annotations:
kubernetes.io/ingress.class: "nginx" kubernetes.io/ingress.class: "nginx"
# 使用重写后的路径进行路由
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: "/$1"
name: cms-api-ingress name: cms-api-ingress
spec: spec:
rules: rules:
- host: k8s.open-im-test.rentsoft.cn - host: cms-api.openim.xxx.com
http: http:
paths: paths:
- backend: - backend:
@ -112,5 +97,5 @@ spec:
name: cms-api name: cms-api
port: port:
number: 10006 number: 10006
path: /cms-api/(.*) path: /
pathType: Prefix pathType: Prefix

@ -1,6 +1,7 @@
#### openIM k8s部署文档 #### openIM k8s部署文档
### 1. 修改配置文件 ### 1. 修改配置文件
在Open-IM-SERVER目录下修改config/config.yaml配置文件, 将MySQL, Kafka, MongoDB等配置修改。 在Open-IM-SERVER目录下修改config/config.yaml配置文件, 将MySQL, Kafka, MongoDB等配置修改。
使用demo需要修改demo/imAPIURL地址 让demo能请求到im的api
### 2. 项目根目录创建im configMap到k8s openim namespace ### 2. 项目根目录创建im configMap到k8s openim namespace
kubectl create namespace openim kubectl create namespace openim

@ -2,7 +2,7 @@
source ./path_info.cfg source ./path_info.cfg
mkdir -p /db/sdk #path for jssdk sqlite #mkdir -p /db/sdk #path for jssdk sqlite
for i in ${service[*]} for i in ${service[*]}
do do

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: message-cms - name: message-cms
image: openim/message_cms:v2.0.10 image: openim/message_cms:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10190 - containerPort: 10190
volumeMounts: volumeMounts:

@ -5,14 +5,14 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_message_cms $WORKDIR/main ADD ./open_im_message_cms $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: msg - name: msg
image: openim/msg:v2.0.10 image: openim/msg:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10130 - containerPort: 10130
volumeMounts: volumeMounts:

@ -4,15 +4,16 @@ FROM ubuntu
ENV WORKDIR /Open-IM-Server ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_msg $WORKDIR/main ADD ./open_im_msg $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,10 +15,13 @@ spec:
spec: spec:
containers: containers:
- name: msg-gateway - name: msg-gateway
image: openim/msg_gateway:v2.0.10 image: openim/msg_gateway:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10140 - name: rpc-port
- containerPort: 10001 containerPort: 10140
- name: ws-port
containerPort: 10001
volumeMounts: volumeMounts:
- name: config - name: config
mountPath: /Open-IM-Server/config mountPath: /Open-IM-Server/config
@ -39,7 +42,7 @@ spec:
- name: msg-gateway-port - name: msg-gateway-port
protocol: TCP protocol: TCP
port: 10001 port: 10001
targetPort: 10001 targetPort: ws-port
selector: selector:
app: msg-gateway app: msg-gateway

@ -5,14 +5,14 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_msg_gateway $WORKDIR/main ADD ./open_im_msg_gateway $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: msg-transfer - name: msg-transfer
image: openim/msg_transfer:v2.0.10 image: openim/msg_transfer:v2.0.10k
# imagePullPolicy: Always
volumeMounts: volumeMounts:
- name: config - name: config
mountPath: /Open-IM-Server/config mountPath: /Open-IM-Server/config

@ -5,13 +5,14 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_msg_transfer $WORKDIR/main ADD ./open_im_msg_transfer $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
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"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: office - name: office
image: openim/office:v2.0.10 image: openim/office:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10210 - containerPort: 10210
volumeMounts: volumeMounts:

@ -5,13 +5,14 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_office $WORKDIR/main ADD ./open_im_office $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
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"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: organization - name: organization
image: openim/organization:v2.0.10 image: openim/organization:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10220 - containerPort: 10220
volumeMounts: volumeMounts:

@ -5,13 +5,15 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_organization $WORKDIR/main ADD ./open_im_organization $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
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"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: push - name: push
image: openim/push:v2.0.10 image: openim/push:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10170 - containerPort: 10170
volumeMounts: volumeMounts:

@ -4,14 +4,16 @@ FROM ubuntu
ENV WORKDIR /Open-IM-Server ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_push $WORKDIR/main ADD ./open_im_push $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
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"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: sdk-server - name: sdk-server
image: openim/sdk_server:v2.0.10 image: openim/sdk_server:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10003 - containerPort: 10003
volumeMounts: volumeMounts:

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: statistics - name: statistics
image: openim/statistics:v2.0.10 image: openim/statistics:v2.0.10k
# imagePullPolicy: Always
ports: ports:
- containerPort: 10180 - containerPort: 10180
volumeMounts: volumeMounts:

@ -5,13 +5,14 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_statistics $WORKDIR/main ADD ./open_im_statistics $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
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"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -15,7 +15,8 @@ spec:
spec: spec:
containers: containers:
- name: user - name: user
image: openim/user:v2.0.10 image: openim/user:v2.0.10k
# imagePullPolicy: Always
volumeMounts: volumeMounts:
- name: config - name: config
mountPath: /Open-IM-Server/config mountPath: /Open-IM-Server/config

@ -5,13 +5,14 @@ ENV WORKDIR /Open-IM-Server
ENV CONFIG_NAME $WORKDIR/config/config.yaml ENV CONFIG_NAME $WORKDIR/config/config.yaml
# 将可执行文件复制到目标目录 # 将可执行文件复制到目标目录
ADD ./open_im_user $WORKDIR/main ADD ./open_im_user $WORKDIR/cmd/main
# 创建用于挂载的几个目录,添加可执行权限 # 创建用于挂载的几个目录,添加可执行权限
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
chmod +x $WORKDIR/main chmod +x $WORKDIR/cmd/main
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"]
WORKDIR $WORKDIR WORKDIR $WORKDIR
CMD ./main CMD ./cmd/main

@ -10,6 +10,7 @@ import (
open_im_sdk "Open_IM/pkg/proto/sdk_ws" open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"github.com/golang/protobuf/ptypes/wrappers"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
@ -806,6 +807,56 @@ func SetGroupMemberNickname(c *gin.Context) {
c.JSON(http.StatusOK, resp) c.JSON(http.StatusOK, resp)
} }
func GetGroupMemberIDListFromCache(c *gin.Context) { func SetGroupMemberInfo(c *gin.Context) {
var (
req api.SetGroupMemberInfoReq
resp api.SetGroupMemberInfoResp
)
if err := c.BindJSON(&req); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req)
var opUserID string
ok, opUserID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
reqPb := &rpc.SetGroupMemberInfoReq{
GroupID: req.GroupID,
UserID: req.UserID,
OperationID: req.OperationID,
OpUserID: opUserID,
}
if req.Nickname != nil {
reqPb.Nickname = &wrappers.StringValue{Value: *req.Nickname}
}
if req.FaceURL != nil {
reqPb.FaceURL = &wrappers.StringValue{Value: *req.FaceURL}
}
if req.Ex != nil {
reqPb.Ex = &wrappers.StringValue{Value: *req.Ex}
}
if req.RoleLevel != nil {
reqPb.RoleLevel = &wrappers.Int32Value{Value: *req.RoleLevel}
}
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName)
client := rpc.NewGroupClient(etcdConn)
respPb, err := client.SetGroupMemberInfo(context.Background(), reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
resp.ErrMsg = respPb.CommonResp.ErrMsg
resp.ErrCode = respPb.CommonResp.ErrCode
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", resp)
c.JSON(http.StatusInternalServerError, resp)
} }

@ -0,0 +1,88 @@
package apiThird
import (
api "Open_IM/pkg/base_info"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/utils"
"github.com/gin-gonic/gin"
"net/http"
)
func GetRTCInvitationInfo(c *gin.Context) {
var (
req api.GetRTCInvitationInfoReq
resp api.GetRTCInvitationInfoResp
)
if err := c.Bind(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
ok, _, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
var err error
invitationInfo, err := db.DB.GetSignalInfoFromCacheByClientMsgID(req.ClientMsgID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSignalInfoFromCache", err.Error(), req)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
return
}
resp.Data.OpUserID = invitationInfo.OpUserID
resp.Data.Invitation.RoomID = invitationInfo.Invitation.RoomID
resp.Data.Invitation.SessionType = invitationInfo.Invitation.SessionType
resp.Data.Invitation.GroupID = invitationInfo.Invitation.GroupID
resp.Data.Invitation.InviterUserID = invitationInfo.Invitation.InviterUserID
resp.Data.Invitation.InviteeUserIDList = invitationInfo.Invitation.InviteeUserIDList
resp.Data.Invitation.MediaType = invitationInfo.Invitation.MediaType
resp.Data.Invitation.Timeout = invitationInfo.Invitation.Timeout
c.JSON(http.StatusOK, resp)
}
func GetRTCInvitationInfoStartApp(c *gin.Context) {
var (
req api.GetRTCInvitationInfoStartAppReq
resp api.GetRTCInvitationInfoStartAppResp
)
if err := c.Bind(&req); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
var ok bool
var errInfo string
ok, userID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID)
if !ok {
errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token")
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
invitationInfo, err := db.DB.GetAvailableSignalInvitationInfo(userID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSignalInfoFromCache", err.Error(), req)
c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": err.Error(), "data": struct{}{}})
return
}
resp.Data.OpUserID = invitationInfo.OpUserID
resp.Data.Invitation.RoomID = invitationInfo.Invitation.RoomID
resp.Data.Invitation.SessionType = invitationInfo.Invitation.SessionType
resp.Data.Invitation.GroupID = invitationInfo.Invitation.GroupID
resp.Data.Invitation.InviterUserID = invitationInfo.Invitation.InviterUserID
resp.Data.Invitation.InviteeUserIDList = invitationInfo.Invitation.InviteeUserIDList
resp.Data.Invitation.MediaType = invitationInfo.Invitation.MediaType
resp.Data.Invitation.Timeout = invitationInfo.Invitation.Timeout
c.JSON(http.StatusOK, resp)
}

@ -161,6 +161,7 @@ func onboardingProcessNotification(operationID, userID, groupID string) {
}() }()
var tips commonPb.TipsComm var tips commonPb.TipsComm
tips.DefaultTips = config.Config.Notification.JoinDepartmentNotification.DefaultTips.Tips tips.DefaultTips = config.Config.Notification.JoinDepartmentNotification.DefaultTips.Tips
tips.JsonDetail = ""
content, err := proto.Marshal(&tips) content, err := proto.Marshal(&tips)
if err != nil { if err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), "proto marshal failed") log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), "proto marshal failed")

@ -6,6 +6,7 @@ import (
"Open_IM/pkg/common/constant" "Open_IM/pkg/common/constant"
"Open_IM/pkg/common/http" "Open_IM/pkg/common/http"
http2 "net/http" http2 "net/http"
"time"
) )
func callbackUserOnline(operationID, userID string, platformID int, token string) cbApi.CommonCallbackResp { func callbackUserOnline(operationID, userID string, platformID int, token string) cbApi.CommonCallbackResp {
@ -21,7 +22,9 @@ func callbackUserOnline(operationID, userID string, platformID int, token string
UserID: userID, UserID: userID,
PlatformID: int32(platformID), PlatformID: int32(platformID),
Platform: constant.PlatformIDToName(platformID), Platform: constant.PlatformIDToName(platformID),
}} },
Seq: time.Now().Nanosecond() / 1e6,
}
callbackUserOnlineResp := &cbApi.CallbackUserOnlineResp{CommonCallbackResp: callbackResp} callbackUserOnlineResp := &cbApi.CallbackUserOnlineResp{CommonCallbackResp: callbackResp}
if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackUserOnlineReq, callbackUserOnlineResp, config.Config.Callback.CallbackUserOnline.CallbackTimeOut); err != nil { if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackUserOnlineReq, callbackUserOnlineResp, config.Config.Callback.CallbackUserOnline.CallbackTimeOut); err != nil {
callbackResp.ErrCode = http2.StatusInternalServerError callbackResp.ErrCode = http2.StatusInternalServerError
@ -35,13 +38,16 @@ func callbackUserOffline(operationID, userID string, platformID int) cbApi.Commo
if !config.Config.Callback.CallbackUserOffline.Enable { if !config.Config.Callback.CallbackUserOffline.Enable {
return callbackResp return callbackResp
} }
callbackOfflineReq := cbApi.CallbackUserOfflineReq{UserStatusCallbackReq: cbApi.UserStatusCallbackReq{ callbackOfflineReq := cbApi.CallbackUserOfflineReq{
CallbackCommand: constant.CallbackUserOfflineCommand, UserStatusCallbackReq: cbApi.UserStatusCallbackReq{
OperationID: operationID, CallbackCommand: constant.CallbackUserOfflineCommand,
UserID: userID, OperationID: operationID,
PlatformID: int32(platformID), UserID: userID,
Platform: constant.PlatformIDToName(platformID), PlatformID: int32(platformID),
}} Platform: constant.PlatformIDToName(platformID),
},
Seq: time.Now().Nanosecond() / 1e6,
}
callbackUserOfflineResp := &cbApi.CallbackUserOfflineResp{CommonCallbackResp: callbackResp} callbackUserOfflineResp := &cbApi.CallbackUserOfflineResp{CommonCallbackResp: callbackResp}
if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackOfflineReq, callbackUserOfflineResp, config.Config.Callback.CallbackUserOffline.CallbackTimeOut); err != nil { if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackOfflineReq, callbackUserOfflineResp, config.Config.Callback.CallbackUserOffline.CallbackTimeOut); err != nil {
callbackResp.ErrCode = http2.StatusInternalServerError callbackResp.ErrCode = http2.StatusInternalServerError

@ -3,6 +3,7 @@ package gate
import ( import (
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant" "Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/grpc-etcdv3/getcdv3"
pbChat "Open_IM/pkg/proto/chat" pbChat "Open_IM/pkg/proto/chat"
@ -248,7 +249,13 @@ func (ws *WServer) sendSignalMsgReq(conn *UserConn, m *Req) {
ws.sendSignalMsgResp(conn, 200, err.Error(), m, &signalResp) ws.sendSignalMsgResp(conn, 200, err.Error(), m, &signalResp)
} else { } else {
log.NewInfo(pbData.OperationID, "rpc call success to sendMsgReq", reply.String()) log.NewInfo(pbData.OperationID, "rpc call success to sendMsgReq", reply.String())
ws.sendSignalMsgResp(conn, 0, "", m, &signalResp) // save invitation info for offline push
if err := db.DB.NewCacheSignalInfo(pbData.MsgData); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), m, &signalResp)
ws.sendSignalMsgResp(conn, 200, err.Error(), m, &signalResp)
} else {
ws.sendSignalMsgResp(conn, 0, "", m, &signalResp)
}
} }
} else { } else {
log.NewError(m.OperationID, utils.GetSelfFuncName(), respPb.IsPass, respPb.CommonResp.ErrCode, respPb.CommonResp.ErrMsg) log.NewError(m.OperationID, utils.GetSelfFuncName(), respPb.IsPass, respPb.CommonResp.ErrCode, respPb.CommonResp.ErrMsg)

@ -1,6 +1,7 @@
package getui package getui
import ( import (
"Open_IM/internal/push"
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
"Open_IM/pkg/common/db" "Open_IM/pkg/common/db"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
@ -98,7 +99,7 @@ func newGetuiClient() *Getui {
return &Getui{} return &Getui{}
} }
func (g *Getui) Push(userIDList []string, alert, detailContent, operationID string) (resp string, err error) { func (g *Getui) Push(userIDList []string, alert, detailContent, operationID string, opts push.PushOpts) (resp string, err error) {
token, err := db.DB.GetGetuiToken() token, err := db.DB.GetGetuiToken()
log.NewDebug(operationID, utils.GetSelfFuncName(), "token", token) log.NewDebug(operationID, utils.GetSelfFuncName(), "token", token)
if err != nil { if err != nil {

@ -1,6 +1,7 @@
package push package push
import ( import (
"Open_IM/internal/push"
"Open_IM/internal/push/jpush/common" "Open_IM/internal/push/jpush/common"
"Open_IM/internal/push/jpush/requestBody" "Open_IM/internal/push/jpush/requestBody"
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
@ -32,12 +33,20 @@ func (j *JPush) SetAlias(cid, alias string) (resp string, err error) {
return resp, nil return resp, nil
} }
func (j *JPush) Push(accounts []string, alert, detailContent, operationID string) (string, error) { func (j *JPush) Push(accounts []string, alert, detailContent, operationID string, opts push.PushOpts) (string, error) {
var pf requestBody.Platform var pf requestBody.Platform
pf.SetAll() pf.SetAll()
var au requestBody.Audience var au requestBody.Audience
au.SetAlias(accounts) au.SetAlias(accounts)
var no requestBody.Notification var no requestBody.Notification
var extras requestBody.Extras
if opts.Signal.ClientMsgID != "" {
extras.ClientMsgID = opts.Signal.ClientMsgID
}
no.IOSEnableMutableContent()
no.SetExtras(extras)
no.SetAlert(alert) no.SetAlert(alert)
var me requestBody.Message var me requestBody.Message
me.SetMsgContent(detailContent) me.SetMsgContent(detailContent)

@ -15,11 +15,18 @@ type Android struct {
Intent struct { Intent struct {
URL string `json:"url,omitempty"` URL string `json:"url,omitempty"`
} `json:"intent,omitempty"` } `json:"intent,omitempty"`
Extras Extras `json:"extras"`
} }
type Ios struct { type Ios struct {
Alert string `json:"alert,omitempty"` Alert string `json:"alert,omitempty"`
Sound string `json:"sound,omitempty"` Sound string `json:"sound,omitempty"`
Badge string `json:"badge,omitempty"` Badge string `json:"badge,omitempty"`
Extras Extras `json:"extras"`
MutableContent bool `json:"mutable-content"`
}
type Extras struct {
ClientMsgID string `json:"clientMsgID"`
} }
func (n *Notification) SetAlert(alert string) { func (n *Notification) SetAlert(alert string) {
@ -29,8 +36,17 @@ func (n *Notification) SetAlert(alert string) {
n.IOS.Alert = alert n.IOS.Alert = alert
n.IOS.Sound = "default" n.IOS.Sound = "default"
n.IOS.Badge = "+1" n.IOS.Badge = "+1"
}
func (n *Notification) SetExtras(extras Extras) {
n.IOS.Extras = extras
n.Android.Extras = extras
} }
func (n *Notification) SetAndroidIntent() { func (n *Notification) SetAndroidIntent() {
n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent
} }
func (n *Notification) IOSEnableMutableContent() {
n.IOS.MutableContent = true
}

@ -9,7 +9,7 @@ import (
http2 "net/http" http2 "net/http"
) )
func callbackOfflinePush(operationID, userID string, info *commonPb.OfflinePushInfo, platformID int32) cbApi.CommonCallbackResp { func callbackOfflinePush(operationID, userID string, msg *commonPb.MsgData) cbApi.CommonCallbackResp {
callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} callbackResp := cbApi.CommonCallbackResp{OperationID: operationID}
if !config.Config.Callback.CallbackOfflinePush.Enable { if !config.Config.Callback.CallbackOfflinePush.Enable {
return callbackResp return callbackResp
@ -19,10 +19,16 @@ func callbackOfflinePush(operationID, userID string, info *commonPb.OfflinePushI
CallbackCommand: constant.CallbackOfflinePushCommand, CallbackCommand: constant.CallbackOfflinePushCommand,
OperationID: operationID, OperationID: operationID,
UserID: userID, UserID: userID,
PlatformID: platformID, PlatformID: msg.SenderPlatformID,
Platform: constant.PlatformIDToName(int(platformID)), Platform: constant.PlatformIDToName(int(msg.SenderPlatformID)),
}, },
OfflinePushInfo: info, OfflinePushInfo: msg.OfflinePushInfo,
SendID: msg.SendID,
GroupID: msg.GroupID,
ContentType: msg.ContentType,
SessionType: msg.SessionType,
AtUserIDList: msg.AtUserIDList,
Content: string(msg.Content),
} }
callbackOfflinePushResp := &cbApi.CallbackOfflinePushResp{CommonCallbackResp: &callbackResp} callbackOfflinePushResp := &cbApi.CallbackOfflinePushResp{CommonCallbackResp: &callbackResp}
if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackOfflinePushReq, callbackOfflinePushResp, config.Config.Callback.CallbackOfflinePush.CallbackTimeOut); err != nil { if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackOfflinePushReq, callbackOfflinePushResp, config.Config.Callback.CallbackOfflinePush.CallbackTimeOut); err != nil {

@ -7,16 +7,18 @@
package logic package logic
import ( import (
jpush "Open_IM/internal/push/jpush" "Open_IM/internal/push"
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant" "Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/grpc-etcdv3/getcdv3"
pbPush "Open_IM/pkg/proto/push" pbPush "Open_IM/pkg/proto/push"
pbRelay "Open_IM/pkg/proto/relay" pbRelay "Open_IM/pkg/proto/relay"
pbRtc "Open_IM/pkg/proto/rtc"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"encoding/json" "encoding/json"
"github.com/golang/protobuf/proto"
"google.golang.org/grpc" "google.golang.org/grpc"
"strings" "strings"
) )
@ -99,11 +101,15 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
} else { } else {
content = constant.ContentType2PushContent[constant.GroupMsg] content = constant.ContentType2PushContent[constant.GroupMsg]
} }
case constant.SignalingNotification:
content = constant.ContentType2PushContent[constant.SignalMsg]
default: default:
content = constant.ContentType2PushContent[constant.Common] content = constant.ContentType2PushContent[constant.Common]
} }
} }
callbackResp := callbackOfflinePush(pushMsg.OperationID, UIDList[0], pushMsg.MsgData.OfflinePushInfo, constant.AndroidPlatformID)
callbackResp := callbackOfflinePush(pushMsg.OperationID, UIDList[0], pushMsg.MsgData)
log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp")
if callbackResp.ErrCode != 0 { if callbackResp.ErrCode != 0 {
log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp)
@ -113,9 +119,14 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
return return
} }
if offlinePusher == nil { if offlinePusher == nil {
offlinePusher = jpush.JPushClient return
} }
pushResult, err := offlinePusher.Push(UIDList, content, jsonCustomContent, pushMsg.OperationID) opts, err := GetOfflinePushOpts(pushMsg)
if err != nil {
log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetOfflinePushOpts failed", pushMsg, err.Error())
}
log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), UIDList, content, jsonCustomContent, "opts:", opts)
pushResult, err := offlinePusher.Push(UIDList, content, jsonCustomContent, pushMsg.OperationID, opts)
if err != nil { if err != nil {
log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error()) log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error())
} else { } else {
@ -225,6 +236,23 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
//} //}
} }
func GetOfflinePushOpts(pushMsg *pbPush.PushMsgReq) (opts push.PushOpts, err error) {
if pushMsg.MsgData.ContentType < constant.SignalingNotificationEnd && pushMsg.MsgData.ContentType > constant.SignalingNotificationBegin {
req := &pbRtc.SignalReq{}
if err := proto.Unmarshal(pushMsg.MsgData.Content, req); err != nil {
return opts, utils.Wrap(err, "")
}
log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "SignalReq: ", req.String())
switch req.Payload.(type) {
case *pbRtc.SignalReq_Invite, *pbRtc.SignalReq_InviteInGroup:
opts.Signal.ClientMsgID = pushMsg.MsgData.ClientMsgID
log.NewDebug(pushMsg.OperationID, opts)
}
}
return opts, nil
}
//func SendMsgByWS(m *pbChat.WSToMsgSvrChatMsg) { //func SendMsgByWS(m *pbChat.WSToMsgSvrChatMsg) {
// m.MsgID = rpcChat.GetMsgID(m.SendID) // m.MsgID = rpcChat.GetMsgID(m.SendID)
// m.ClientMsgID = m.MsgID // m.ClientMsgID = m.MsgID

@ -1,5 +1,13 @@
package push package push
type OfflinePusher interface { type OfflinePusher interface {
Push(userIDList []string, alert, detailContent, operationID string) (resp string, err error) Push(userIDList []string, alert, detailContent, operationID string, opts PushOpts) (resp string, err error)
}
type PushOpts struct {
Signal Signal
}
type Signal struct {
ClientMsgID string
} }

@ -10,10 +10,11 @@ import (
pbAdminCMS "Open_IM/pkg/proto/admin_cms" pbAdminCMS "Open_IM/pkg/proto/admin_cms"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"google.golang.org/grpc"
"net" "net"
"strconv" "strconv"
"strings" "strings"
"google.golang.org/grpc"
) )
type adminCMSServer struct { type adminCMSServer struct {
@ -62,6 +63,7 @@ func (s *adminCMSServer) Run() {
log.Error("", "GetLocalIP failed ", err.Error()) log.Error("", "GetLocalIP failed ", err.Error())
} }
} }
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10)
if err != nil { if err != nil {
log.NewError("0", "RegisterEtcd failed ", err.Error()) log.NewError("0", "RegisterEtcd failed ", err.Error())

@ -141,7 +141,7 @@ func (rpc *rpcAuth) Run() {
log.Error("", "GetLocalIP failed ", err.Error()) log.Error("", "GetLocalIP failed ", err.Error())
} }
} }
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName, 10) err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName, 10)
if err != nil { if err != nil {
log.NewError(operationID, "RegisterEtcd failed ", err.Error(), log.NewError(operationID, "RegisterEtcd failed ", err.Error(),

@ -11,11 +11,12 @@ import (
commonPb "Open_IM/pkg/proto/sdk_ws" commonPb "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"google.golang.org/grpc"
"net" "net"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"google.golang.org/grpc"
) )
type cacheServer struct { type cacheServer struct {
@ -71,7 +72,7 @@ func (s *cacheServer) Run() {
log.Error("", "GetLocalIP failed ", err.Error()) log.Error("", "GetLocalIP failed ", err.Error())
} }
} }
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10)
if err != nil { if err != nil {
log.NewError("0", "RegisterEtcd failed ", err.Error()) log.NewError("0", "RegisterEtcd failed ", err.Error())

@ -164,6 +164,7 @@ func (rpc *rpcConversation) Run() {
log.Error("", "GetLocalIP failed ", err.Error()) log.Error("", "GetLocalIP failed ", err.Error())
} }
} }
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName, 10) err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), rpcRegisterIP, rpc.rpcPort, rpc.rpcRegisterName, 10)
if err != nil { if err != nil {
log.NewError("0", "RegisterEtcd failed ", err.Error(), log.NewError("0", "RegisterEtcd failed ", err.Error(),

@ -15,11 +15,12 @@ import (
sdkws "Open_IM/pkg/proto/sdk_ws" sdkws "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"google.golang.org/grpc"
"net" "net"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"google.golang.org/grpc"
) )
type friendServer struct { type friendServer struct {
@ -69,7 +70,7 @@ func (s *friendServer) Run() {
log.Error("", "GetLocalIP failed ", err.Error()) log.Error("", "GetLocalIP failed ", err.Error())
} }
} }
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10)
if err != nil { if err != nil {
log.NewError("0", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName) log.NewError("0", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName)

@ -71,6 +71,7 @@ func (s *groupServer) Run() {
log.Error("", "GetLocalIP failed ", err.Error()) log.Error("", "GetLocalIP failed ", err.Error())
} }
} }
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10)
if err != nil { if err != nil {
log.NewError("", "RegisterEtcd failed ", err.Error()) log.NewError("", "RegisterEtcd failed ", err.Error())
@ -1582,3 +1583,35 @@ func (s *groupServer) SetGroupMemberNickname(ctx context.Context, req *pbGroup.S
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}) log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""})
return &pbGroup.SetGroupMemberNicknameResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil return &pbGroup.SetGroupMemberNicknameResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil
} }
func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbGroup.SetGroupMemberInfoReq) (resp *pbGroup.SetGroupMemberInfoResp, err error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
resp = &pbGroup.SetGroupMemberInfoResp{CommonResp: &pbGroup.CommonResp{}}
groupMember := db.GroupMember{
GroupID: req.GroupID,
UserID: req.UserID,
}
m := make(map[string]interface{})
if req.RoleLevel != nil {
m["role_level"] = req.RoleLevel.Value
}
if req.FaceURL != nil {
m["user_group_face_url"] = req.FaceURL.Value
}
if req.Nickname != nil {
m["nickname"] = req.Nickname.Value
}
if req.Ex != nil {
m["ex"] = req.Ex.Value
}
err = imdb.UpdateGroupMemberInfoByMap(groupMember, m)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetGroupMemberInfo failed", err.Error())
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + ":" + err.Error()
return resp, nil
}
chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID)
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
return resp, nil
}

@ -70,6 +70,7 @@ func (s *messageCMSServer) Run() {
log.Error("", "GetLocalIP failed ", err.Error()) log.Error("", "GetLocalIP failed ", err.Error())
} }
} }
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10)
if err != nil { if err != nil {
log.NewError("0", "RegisterEtcd failed ", err.Error()) log.NewError("0", "RegisterEtcd failed ", err.Error())

@ -231,7 +231,7 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S
return returnMsg(&replay, pb, 201, "GetGroupMemberIDListFromCache logic failed", "", 0) return returnMsg(&replay, pb, 201, "GetGroupMemberIDListFromCache logic failed", "", 0)
} }
memberUserIDList := cacheResp.UserIDList memberUserIDList := cacheResp.UserIDList
log.Debug(pb.OperationID, "GetGroupAllMember userID list", cacheResp.UserIDList) log.Debug(pb.OperationID, "GetGroupAllMember userID list", cacheResp.UserIDList, "len: ", len(cacheResp.UserIDList))
var addUidList []string var addUidList []string
switch pb.MsgData.ContentType { switch pb.MsgData.ContentType {
case constant.MemberKickedNotification: case constant.MemberKickedNotification:
@ -861,6 +861,10 @@ func (rpc *rpcChat) sendMsgToGroupOptimization(list []string, groupPB *pbChat.Se
groupPB.MsgData.RecvID = v groupPB.MsgData.RecvID = v
isSend := modifyMessageByUserMessageReceiveOpt(v, groupPB.MsgData.GroupID, constant.GroupChatType, groupPB) isSend := modifyMessageByUserMessageReceiveOpt(v, groupPB.MsgData.GroupID, constant.GroupChatType, groupPB)
if isSend { if isSend {
if v == "" || groupPB.MsgData.SendID == "" {
log.Error(msgToMQGroup.OperationID, "sendMsgToGroupOptimization userID nil ", msgToMQGroup.String())
continue
}
err := rpc.sendMsgToKafka(&msgToMQGroup, v, status) err := rpc.sendMsgToKafka(&msgToMQGroup, v, status)
if err != nil { if err != nil {
log.NewError(msgToMQGroup.OperationID, "kafka send msg err:UserId", v, msgToMQGroup.String()) log.NewError(msgToMQGroup.OperationID, "kafka send msg err:UserId", v, msgToMQGroup.String())

@ -14,13 +14,14 @@ import (
pbCommon "Open_IM/pkg/proto/sdk_ws" pbCommon "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"google.golang.org/grpc"
"net" "net"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"time" "time"
"unsafe" "unsafe"
"google.golang.org/grpc"
) )
type officeServer struct { type officeServer struct {
@ -77,7 +78,7 @@ func (s *officeServer) Run() {
log.Error("", "GetLocalIP failed ", err.Error()) log.Error("", "GetLocalIP failed ", err.Error())
} }
} }
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10)
if err != nil { if err != nil {
log.NewError("0", "RegisterEtcd failed ", err.Error()) log.NewError("0", "RegisterEtcd failed ", err.Error())

@ -9,17 +9,18 @@ import (
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify" "Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/grpc-etcdv3/getcdv3"
"Open_IM/pkg/proto/auth" pbAuth "Open_IM/pkg/proto/auth"
groupRpc "Open_IM/pkg/proto/group" groupRpc "Open_IM/pkg/proto/group"
rpc "Open_IM/pkg/proto/organization" rpc "Open_IM/pkg/proto/organization"
open_im_sdk "Open_IM/pkg/proto/sdk_ws" open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"google.golang.org/grpc"
"net" "net"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"google.golang.org/grpc"
) )
type organizationServer struct { type organizationServer struct {
@ -67,6 +68,7 @@ func (s *organizationServer) Run() {
log.Error("", "GetLocalIP failed ", err.Error()) log.Error("", "GetLocalIP failed ", err.Error())
} }
} }
log.NewInfo("", "rpcRegisterIP", rpcRegisterIP)
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10)
if err != nil { if err != nil {
log.NewError("", "RegisterEtcd failed ", err.Error()) log.NewError("", "RegisterEtcd failed ", err.Error())
@ -152,7 +154,6 @@ func (s *organizationServer) UpdateDepartment(ctx context.Context, req *rpc.Upda
department := db.Department{} department := db.Department{}
utils.CopyStructFields(&department, req.DepartmentInfo) utils.CopyStructFields(&department, req.DepartmentInfo)
log.Debug(req.OperationID, "dst ", department, "src ", req.DepartmentInfo) log.Debug(req.OperationID, "dst ", department, "src ", req.DepartmentInfo)
if err := imdb.UpdateDepartment(&department, nil); err != nil { if err := imdb.UpdateDepartment(&department, nil); err != nil {
errMsg := req.OperationID + " " + "UpdateDepartment failed " + err.Error() errMsg := req.OperationID + " " + "UpdateDepartment failed " + err.Error()
@ -341,6 +342,7 @@ func (s *organizationServer) GetDepartmentParentIDList(_ context.Context, req *r
resp = &rpc.GetDepartmentParentIDListResp{} resp = &rpc.GetDepartmentParentIDListResp{}
resp.ParentIDList, err = imdb.GetDepartmentParentIDList(req.DepartmentID) resp.ParentIDList, err = imdb.GetDepartmentParentIDList(req.DepartmentID)
if err != nil { if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetDepartmentParentIDList failed", err.Error())
resp.ErrMsg = constant.ErrDB.ErrMsg + ": " + err.Error() resp.ErrMsg = constant.ErrDB.ErrMsg + ": " + err.Error()
resp.ErrCode = constant.ErrDB.ErrCode resp.ErrCode = constant.ErrDB.ErrCode
return resp, nil return resp, nil

@ -232,3 +232,17 @@ type SetGroupMemberNicknameReq struct {
type SetGroupMemberNicknameResp struct { type SetGroupMemberNicknameResp struct {
CommResp CommResp
} }
type SetGroupMemberInfoReq struct {
OperationID string `json:"operationID" binding:"required"`
GroupID string `json:"groupID" binding:"required"`
UserID string `json:"userID" binding:"required"`
Nickname *string `json:"nickname"`
FaceURL *string `json:"userGroupFaceUrl"`
RoleLevel *int32 `json:"roleLevel" validate:"gte=1,lte=3"`
Ex *string `json:"ex"`
}
type SetGroupMemberInfoResp struct {
CommResp
}

@ -57,3 +57,33 @@ type GetDownloadURLResp struct {
UpdateLog string `json:"update_log"` UpdateLog string `json:"update_log"`
} `json:"data"` } `json:"data"`
} }
type GetRTCInvitationInfoReq struct {
OperationID string `json:"operationID" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
}
type GetRTCInvitationInfoResp struct {
CommResp
Data struct {
OpUserID string `json:"opUserID"`
Invitation struct {
InviterUserID string `json:"inviterUserID"`
InviteeUserIDList []string `json:"inviteeUserIDList"`
GroupID string `json:"groupID"`
RoomID string `json:"roomID"`
Timeout int32 `json:"timeout"`
MediaType string `json:"mediaType"`
SessionType int32 `json:"sessionType"`
} `json:"invitation"`
OfflinePushInfo struct{} `json:"offlinePushInfo"`
} `json:"data"`
}
type GetRTCInvitationInfoStartAppReq struct {
OperationID string `json:"operationID" binding:"required"`
}
type GetRTCInvitationInfoStartAppResp struct {
GetRTCInvitationInfoResp
}

@ -3,6 +3,7 @@ package call_back_struct
type CallbackUserOnlineReq struct { type CallbackUserOnlineReq struct {
UserStatusCallbackReq UserStatusCallbackReq
Token string `json:"token"` Token string `json:"token"`
Seq int `json:"seq"`
} }
type CallbackUserOnlineResp struct { type CallbackUserOnlineResp struct {
@ -11,6 +12,7 @@ type CallbackUserOnlineResp struct {
type CallbackUserOfflineReq struct { type CallbackUserOfflineReq struct {
UserStatusCallbackReq UserStatusCallbackReq
Seq int `json:"seq"`
} }
type CallbackUserOfflineResp struct { type CallbackUserOfflineResp struct {

@ -5,6 +5,13 @@ import commonPb "Open_IM/pkg/proto/sdk_ws"
type CallbackOfflinePushReq struct { type CallbackOfflinePushReq struct {
UserStatusCallbackReq UserStatusCallbackReq
*commonPb.OfflinePushInfo *commonPb.OfflinePushInfo
CommonCallbackReq
SendID string `json:"sendID"`
GroupID string `json:"groupID"`
ContentType int32 `json:"contentType"`
SessionType int32 `json:"sessionType"`
AtUserIDList []string `json:"atUserIDList"`
Content string `json`
} }
type CallbackOfflinePushResp struct { type CallbackOfflinePushResp struct {

@ -419,6 +419,11 @@ type config struct {
OfflinePush POfflinePush `yaml:"offlinePush"` OfflinePush POfflinePush `yaml:"offlinePush"`
DefaultTips PDefaultTips `yaml:"defaultTips"` DefaultTips PDefaultTips `yaml:"defaultTips"`
} `yaml:"joinDepartmentNotification"` } `yaml:"joinDepartmentNotification"`
Signal struct {
OfflinePush struct {
Title string `yaml:"title"`
} `yaml:"offlinePush"`
} `yaml:"signal"`
} }
Demo struct { Demo struct {
Port []int `yaml:"openImDemoPort"` Port []int `yaml:"openImDemoPort"`
@ -442,8 +447,7 @@ type config struct {
ImAPIURL string `yaml:"imAPIURL"` ImAPIURL string `yaml:"imAPIURL"`
} }
Rtc struct { Rtc struct {
Port int `yaml:"port"` SignalTimeout string `yaml:"signalTimeout"`
Address string `yaml:"address"`
} `yaml:"rtc"` } `yaml:"rtc"`
} }
type PConversation struct { type PConversation struct {

@ -44,6 +44,7 @@ const (
Quote = 114 Quote = 114
Common = 200 Common = 200
GroupMsg = 201 GroupMsg = 201
SignalMsg = 202
//SysRelated //SysRelated
NotificationBegin = 1000 NotificationBegin = 1000
@ -218,14 +219,15 @@ const (
) )
var ContentType2PushContent = map[int64]string{ var ContentType2PushContent = map[int64]string{
Picture: "[图片]", Picture: "[图片]",
Voice: "[语音]", Voice: "[语音]",
Video: "[视频]", Video: "[视频]",
File: "[文件]", File: "[文件]",
Text: "你收到了一条文本消息", Text: "你收到了一条文本消息",
AtText: "[有人@你]", AtText: "[有人@你]",
GroupMsg: "你收到一条群聊消息", GroupMsg: "你收到一条群聊消息",
Common: "你收到一条新消息", Common: "你收到一条新消息",
SignalMsg: "音視頻通話邀請",
} }
const ( const (

@ -142,6 +142,18 @@ func UpdateGroupMemberInfo(groupMemberInfo db.GroupMember) error {
return nil return nil
} }
func UpdateGroupMemberInfoByMap(groupMemberInfo db.GroupMember, m map[string]interface{}) error {
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
if err != nil {
return err
}
err = dbConn.Table("group_members").Where("group_id=? and user_id=?", groupMemberInfo.GroupID, groupMemberInfo.UserID).Updates(m).Error
if err != nil {
return err
}
return nil
}
func GetOwnerManagerByGroupID(groupID string) ([]db.GroupMember, error) { func GetOwnerManagerByGroupID(groupID string) ([]db.GroupMember, error) {
dbConn, err := db.DB.MysqlDB.DefaultGormDB() dbConn, err := db.DB.MysqlDB.DefaultGormDB()
if err != nil { if err != nil {

@ -249,26 +249,27 @@ func GetDepartmentRelatedGroupIDList(departmentIDList []string) ([]string, error
func getDepartmentParent(departmentID string, dbConn *gorm.DB) (*db.Department, error) { func getDepartmentParent(departmentID string, dbConn *gorm.DB) (*db.Department, error) {
var department db.Department var department db.Department
var parentID string //var parentID string
dbConn.LogMode(true) dbConn.LogMode(true)
// select * from departments where department_id = (select parent_id from departments where department_id= zx234fd); // select * from departments where department_id = (select parent_id from departments where department_id= zx234fd);
err := dbConn.Table("departments").Where("department_id=?", dbConn.Table("departments").Where("department_id=?", departmentID).Pluck("parent_id", parentID)).Find(&department).Error //dbConn.Table("departments").Where("department_id=?", departmentID).Pluck("parent_id", parentID).Error
err := dbConn.Table("departments").Where("department_id=?").Find(&department).Error
return &department, err return &department, err
} }
func GetDepartmentParent(departmentID string, dbConn *gorm.DB, parentIDList []string) (*db.Department, error) { func GetDepartmentParent(departmentID string, dbConn *gorm.DB, parentIDList *[]string) error {
department, err := getDepartmentParent(departmentID, dbConn) department, err := getDepartmentParent(departmentID, dbConn)
if err != nil { if err != nil {
return nil, err return err
} }
if department.ParentID != "" { if department.ParentID != "" {
parentIDList = append(parentIDList, department.ParentID) *parentIDList = append(*parentIDList, department.ParentID)
_, err = GetDepartmentParent(departmentID, dbConn, parentIDList) err = GetDepartmentParent(departmentID, dbConn, parentIDList)
if err != nil { if err != nil {
return nil, nil return err
} }
} }
return nil, nil return nil
} }
func GetDepartmentParentIDList(departmentID string) ([]string, error) { func GetDepartmentParentIDList(departmentID string) ([]string, error) {
@ -277,6 +278,6 @@ func GetDepartmentParentIDList(departmentID string) ([]string, error) {
return nil, err return nil, err
} }
var parentIDList []string var parentIDList []string
_, err = GetDepartmentParent(departmentID, dbConn, parentIDList) err = GetDepartmentParent(departmentID, dbConn, &parentIDList)
return parentIDList, err return parentIDList, err
} }

@ -4,15 +4,21 @@ import (
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
log2 "Open_IM/pkg/common/log" log2 "Open_IM/pkg/common/log"
pbChat "Open_IM/pkg/proto/chat" pbChat "Open_IM/pkg/proto/chat"
pbRtc "Open_IM/pkg/proto/rtc"
pbCommon "Open_IM/pkg/proto/sdk_ws" pbCommon "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/garyburd/redigo/redis" "github.com/garyburd/redigo/redis"
"github.com/mitchellh/mapstructure"
//goRedis "github.com/go-redis/redis/v8"
"strconv" "strconv"
"time" "time"
"github.com/golang/protobuf/proto"
"github.com/mitchellh/mapstructure"
) )
//func (d * DataBases)pubMessage(channel, msg string) { //func (d * DataBases)pubMessage(channel, msg string) {
@ -101,3 +107,91 @@ func (d *DataBases) CleanUpOneUserAllMsgFromRedis(userID string, operationID str
} }
return nil return nil
} }
func (d *DataBases) NewCacheSignalInfo(msg *pbCommon.MsgData) error {
req := &pbRtc.SignalReq{}
if err := proto.Unmarshal(msg.Content, req); err != nil {
return err
}
//log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "SignalReq: ", req.String())
var inviteeUserIDList []string
switch invitationInfo := req.Payload.(type) {
case *pbRtc.SignalReq_Invite:
inviteeUserIDList = invitationInfo.Invite.Invitation.InviteeUserIDList
case *pbRtc.SignalReq_InviteInGroup:
inviteeUserIDList = invitationInfo.InviteInGroup.Invitation.InviteeUserIDList
default:
log2.NewDebug("", utils.GetSelfFuncName(), "req type not invite", string(msg.Content))
return nil
}
for _, userID := range inviteeUserIDList {
timeout, err := strconv.Atoi(config.Config.Rtc.SignalTimeout)
if err != nil {
return err
}
keyList := SignalListCache + userID
err = d.rdb.LPush(context.Background(), keyList, msg.ClientMsgID).Err()
if err != nil {
return err
}
err = d.rdb.Expire(context.Background(), keyList, time.Duration(timeout)*time.Second).Err()
if err != nil {
return err
}
key := SignalCache + msg.ClientMsgID
err = d.rdb.Set(context.Background(), key, msg.Content, time.Duration(timeout)*time.Second).Err()
if err != nil {
return err
}
return err
}
return nil
}
func (d *DataBases) GetSignalInfoFromCacheByClientMsgID(clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error) {
key := SignalCache + clientMsgID
invitationInfo = &pbRtc.SignalInviteReq{}
bytes, err := d.rdb.Get(context.Background(), key).Bytes()
if err != nil {
return nil, err
}
req := &pbRtc.SignalReq{}
if err = proto.Unmarshal(bytes, req); err != nil {
return nil, err
}
switch req2 := req.Payload.(type) {
case *pbRtc.SignalReq_Invite:
invitationInfo.Invitation = req2.Invite.Invitation
case *pbRtc.SignalReq_InviteInGroup:
invitationInfo.Invitation = req2.InviteInGroup.Invitation
}
return invitationInfo, err
}
func (d *DataBases) GetAvailableSignalInvitationInfo(userID string) (invitationInfo *pbRtc.SignalInviteReq, err error) {
keyList := SignalListCache + userID
result := d.rdb.RPop(context.Background(), keyList)
if err = result.Err(); err != nil {
return nil, utils.Wrap(err, "GetAvailableSignalInvitationInfo failed")
}
key, err := result.Result()
if err != nil {
return nil, utils.Wrap(err, "GetAvailableSignalInvitationInfo failed")
}
log2.NewDebug("", utils.GetSelfFuncName(), result, result.String())
invitationInfo, err = d.GetSignalInfoFromCacheByClientMsgID(key)
if err != nil {
return nil, utils.Wrap(err, "GetSignalInfoFromCacheByClientMsgID")
}
err = d.delUserSingalList(userID)
if err != nil {
return nil, utils.Wrap(err, "GetSignalInfoFromCacheByClientMsgID")
}
return invitationInfo, nil
}
func (d *DataBases) delUserSingalList(userID string) error {
keyList := SignalListCache + userID
err := d.rdb.Del(context.Background(), keyList).Err()
return err
}

@ -5,13 +5,18 @@ import (
"Open_IM/pkg/common/constant" "Open_IM/pkg/common/constant"
log2 "Open_IM/pkg/common/log" log2 "Open_IM/pkg/common/log"
pbChat "Open_IM/pkg/proto/chat" pbChat "Open_IM/pkg/proto/chat"
pbRtc "Open_IM/pkg/proto/rtc"
pbCommon "Open_IM/pkg/proto/sdk_ws" pbCommon "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"github.com/garyburd/redigo/redis" "github.com/garyburd/redigo/redis"
"github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
//osconfig "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha"
"strconv" "strconv"
) )
@ -29,6 +34,8 @@ const (
blackListCache = "BLACK_LIST_CACHE:" blackListCache = "BLACK_LIST_CACHE:"
groupCache = "GROUP_CACHE:" groupCache = "GROUP_CACHE:"
messageCache = "MESSAGE_CACHE:" messageCache = "MESSAGE_CACHE:"
SignalCache = "SIGNAL_CACHE:"
SignalListCache = "SIGNAL_LIST_CACHE:"
) )
func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) { func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) {
@ -342,3 +349,25 @@ func (d *DataBases) DelMsgFromCache(uid string, seqList []uint32, operationID st
} }
} }
} }
func (d *DataBases) CacheSignalInfo(msg *pbCommon.MsgData) error {
key := SignalCache + msg.ClientMsgID
_, err := d.Exec("SET", key, msg.Content, "ex", config.Config.Rtc.SignalTimeout)
return err
}
func (d *DataBases) GetSignalInfoFromCache(clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error) {
key := SignalCache + clientMsgID
result, err := redis.Bytes(d.Exec("GET", key))
log2.NewDebug("", utils.GetSelfFuncName(), clientMsgID, result, string(result))
if err != nil {
return nil, err
}
req := &pbRtc.SignalReq{}
if err = proto.Unmarshal(result, req); err != nil {
return nil, err
}
req2 := req.Payload.(*pbRtc.SignalReq_Invite)
invitationInfo = req2.Invite
return invitationInfo, err
}

File diff suppressed because it is too large Load Diff

@ -1,5 +1,6 @@
syntax = "proto3"; syntax = "proto3";
import "Open_IM/pkg/proto/sdk_ws/ws.proto"; import "Open_IM/pkg/proto/sdk_ws/ws.proto";
import "Open_IM/pkg/proto/sdk_ws/wrappers.proto";
option go_package = "./group;group"; option go_package = "./group;group";
package group; package group;
@ -412,6 +413,21 @@ message GetSuperGroupsInfoResp {
repeated server_api_params.GroupInfo GroupInfoList = 3; repeated server_api_params.GroupInfo GroupInfoList = 3;
} }
message SetGroupMemberInfoReq{
string groupID = 1;
string userID = 2;
string opUserID = 3;
string operationID = 4;
google.protobuf.StringValue nickname = 5;
google.protobuf.StringValue faceURL = 6;
google.protobuf.Int32Value roleLevel = 7;
google.protobuf.StringValue ex = 8;
}
message SetGroupMemberInfoResp{
CommonResp CommonResp = 1;
}
service group{ service group{
rpc createGroup(CreateGroupReq) returns(CreateGroupResp); rpc createGroup(CreateGroupReq) returns(CreateGroupResp);
rpc joinGroup(JoinGroupReq) returns(JoinGroupResp); rpc joinGroup(JoinGroupReq) returns(JoinGroupResp);
@ -449,6 +465,8 @@ service group{
rpc GetJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp); rpc GetJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp);
rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp); rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp);
rpc SetGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp);
} }

@ -0,0 +1,123 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Wrappers for primitive (non-message) types. These types are useful
// for embedding primitives in the `google.protobuf.Any` type and for places
// where we need to distinguish between the absence of a primitive
// typed field and its default value.
//
// These wrappers have no meaningful use within repeated fields as they lack
// the ability to detect presence on individual elements.
// These wrappers have no meaningful use within a map or a oneof since
// individual entries of a map or fields of a oneof can already detect presence.
syntax = "proto3";
package google.protobuf;
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
option cc_enable_arenas = true;
option go_package = "google.golang.org/protobuf/types/known/wrapperspb";
option java_package = "com.google.protobuf";
option java_outer_classname = "WrappersProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
// Wrapper message for `double`.
//
// The JSON representation for `DoubleValue` is JSON number.
message DoubleValue {
// The double value.
double value = 1;
}
// Wrapper message for `float`.
//
// The JSON representation for `FloatValue` is JSON number.
message FloatValue {
// The float value.
float value = 1;
}
// Wrapper message for `int64`.
//
// The JSON representation for `Int64Value` is JSON string.
message Int64Value {
// The int64 value.
int64 value = 1;
}
// Wrapper message for `uint64`.
//
// The JSON representation for `UInt64Value` is JSON string.
message UInt64Value {
// The uint64 value.
uint64 value = 1;
}
// Wrapper message for `int32`.
//
// The JSON representation for `Int32Value` is JSON number.
message Int32Value {
// The int32 value.
int32 value = 1;
}
// Wrapper message for `uint32`.
//
// The JSON representation for `UInt32Value` is JSON number.
message UInt32Value {
// The uint32 value.
uint32 value = 1;
}
// Wrapper message for `bool`.
//
// The JSON representation for `BoolValue` is JSON `true` and `false`.
message BoolValue {
// The bool value.
bool value = 1;
}
// Wrapper message for `string`.
//
// The JSON representation for `StringValue` is JSON string.
message StringValue {
// The string value.
string value = 1;
}
// Wrapper message for `bytes`.
//
// The JSON representation for `BytesValue` is JSON string.
message BytesValue {
// The bytes value.
bytes value = 1;
}
Loading…
Cancel
Save