diff --git a/config/config.yaml b/config/config.yaml index 032087cba..03428a8ec 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -60,7 +60,7 @@ serverip: api: openImApiPort: [ 10000 ] sdk: - sdkWsPort: [ 30000 ] + openImSdkWsPort: [ 30000 ] credential: tencent: @@ -105,7 +105,7 @@ modulename: pushName: push longconnsvr: - websocketPort: [ 17778 ] + openImWsPort: [ 17778 ] websocketMaxConnNum: 10000 websocketMaxMsgLen: 4096 websocketTimeOut: 10 diff --git a/script/check_all.sh b/script/check_all.sh index 784012e4d..dd8042fde 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -4,9 +4,7 @@ source ./style_info.cfg source ./path_info.cfg source ./function.sh service_port_name=( - #api port name openImApiPort - #rpc port name openImUserPort openImFriendPort openImOfflineMessagePort @@ -14,8 +12,8 @@ service_port_name=( openImGroupPort openImAuthPort openImPushPort - websocketPort - sdkWsPort + openImWsPort + openImSdkWsPort ) for i in ${service_port_name[*]};do list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}') diff --git a/script/docker_start_all.sh b/script/docker_start_all.sh index 7d5086313..740b88e85 100644 --- a/script/docker_start_all.sh +++ b/script/docker_start_all.sh @@ -8,6 +8,7 @@ need_to_start_server_shell=( msg_gateway_start.sh push_start.sh msg_transfer_start.sh + sdk_svr_start.sh ) #fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started diff --git a/script/msg_gateway_start.sh b/script/msg_gateway_start.sh index bcd928c53..eca66e9bf 100644 --- a/script/msg_gateway_start.sh +++ b/script/msg_gateway_start.sh @@ -4,7 +4,7 @@ source ./style_info.cfg source ./path_info.cfg source ./function.sh list1=$(cat $config_path | grep openImOnlineRelayPort | awk -F '[:]' '{print $NF}') -list2=$(cat $config_path | grep websocketPort | awk -F '[:]' '{print $NF}') +list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}') list_to_string $list1 rpc_ports=($ports_array) list_to_string $list2 @@ -39,7 +39,7 @@ if [ $check -ge 1 ]; then ports=$(netstat -netulp | grep -w ${i} | awk '{print $4}' | awk -F '[:]' '{print $NF}') allPorts=${allPorts}"$ports " done - echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS !!!"${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS"${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_gateway_name}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} diff --git a/script/msg_transfer_start.sh b/script/msg_transfer_start.sh index 82dd8a364..13af4d9bd 100644 --- a/script/msg_transfer_start.sh +++ b/script/msg_transfer_start.sh @@ -29,7 +29,7 @@ for i in $ports ; do allPorts=${allPorts}"$i " done - echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS !!!"${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} diff --git a/script/push_start.sh b/script/push_start.sh index f294ff6d1..f636e99e1 100644 --- a/script/push_start.sh +++ b/script/push_start.sh @@ -36,7 +36,7 @@ if [ $check -eq 1 ]; then for i in $ports; do allPorts=${allPorts}"$i " done - echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS !!!"${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${push_name}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} diff --git a/script/start_sdk_svr.sh b/script/sdk_svr_start.sh similarity index 92% rename from script/start_sdk_svr.sh rename to script/sdk_svr_start.sh index b27d9f330..16c468fac 100644 --- a/script/start_sdk_svr.sh +++ b/script/sdk_svr_start.sh @@ -4,8 +4,8 @@ source ./style_info.cfg source ./path_info.cfg source ./function.sh list1=$(cat $config_path | grep openImApiPort | awk -F '[:]' '{print $NF}') -list2=$(cat $config_path | grep websocketPort | awk -F '[:]' '{print $NF}') -list3=$(cat $config_path | grep sdkWsPort | awk -F '[:]' '{print $NF}') +list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}') +list3=$(cat $config_path | grep openImSdkWsPort | awk -F '[:]' '{print $NF}') list_to_string $list1 api_ports=($ports_array) list_to_string $list2 diff --git a/src/common/config/config.go b/src/common/config/config.go index 939cdae2b..b11eb638c 100644 --- a/src/common/config/config.go +++ b/src/common/config/config.go @@ -14,7 +14,7 @@ type config struct { GinPort []int `yaml:"openImApiPort"` } Sdk struct { - WsPort []int `yaml:"sdkWsPort"` + WsPort []int `yaml:"openImSdkWsPort"` } Credential struct { Tencent struct { @@ -92,7 +92,7 @@ type config struct { PushName string `yaml:"pushName"` } LongConnSvr struct { - WebsocketPort []int `yaml:"websocketPort"` + WebsocketPort []int `yaml:"openImWsPort"` WebsocketMaxConnNum int `yaml:"websocketMaxConnNum"` WebsocketMaxMsgLen int `yaml:"websocketMaxMsgLen"` WebsocketTimeOut int `yaml:"websocketTimeOut"` diff --git a/src/rpc/friend/friend/add_friend.go b/src/rpc/friend/friend/add_friend.go index 6fd9f4b27..79e95a274 100644 --- a/src/rpc/friend/friend/add_friend.go +++ b/src/rpc/friend/friend/add_friend.go @@ -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) } } } diff --git a/src/rpc/group/group/group.go b/src/rpc/group/group/group.go index e1e1426b1..749932194 100644 --- a/src/rpc/group/group/group.go +++ b/src/rpc/group/group/group.go @@ -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,