pull/261/head
wangchuxiao 3 years ago
parent e2e5ab656f
commit f202d5f54a

@ -12,6 +12,7 @@ import (
"Open_IM/pkg/utils"
"context"
"github.com/golang/protobuf/ptypes/wrappers"
"google.golang.org/grpc"
"github.com/gin-gonic/gin"
@ -227,8 +228,9 @@ func GetGroupAllMemberList(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
maxSizeOption := grpc.MaxCallRecvMsgSize(1024 * 1024 * constant.GroupRPCRecvSize)
client := rpc.NewGroupClient(etcdConn)
RpcResp, err := client.GetGroupAllMember(context.Background(), req)
RpcResp, err := client.GetGroupAllMember(context.Background(), req, maxSizeOption)
if err != nil {
log.NewError(req.OperationID, "GetGroupAllMember failed err", err.Error(), req.String())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})

@ -61,8 +61,8 @@ func (s *groupServer) Run() {
log.NewInfo("", "listen network success, ", address, listener)
defer listener.Close()
//grpc server
recvSize := 1024 * 1024 * 30
sendSize := 1024 * 1024 * 30
recvSize := 1024 * 1024 * constant.GroupRPCRecvSize
sendSize := 1024 * 1024 * constant.GroupRPCSendSize
var options = []grpc.ServerOption{
grpc.MaxRecvMsgSize(recvSize),
grpc.MaxSendMsgSize(sendSize),

@ -287,6 +287,11 @@ const (
Directly = 2 //直接进群
)
const (
GroupRPCRecvSize = 30
GroupRPCSendSize = 30
)
const FriendAcceptTip = "You have successfully become friends, so start chatting"
func GroupIsBanChat(status int32) bool {

@ -1074,7 +1074,8 @@ func (d *DataBases) GetSuperGroupByUserID(userID string) (UserToSuperGroup, erro
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup)
var user UserToSuperGroup
return user, c.FindOne(ctx, bson.M{"user_id": userID}).Decode(&user)
_ = c.FindOne(ctx, bson.M{"user_id": userID}).Decode(&user)
return user, nil
}
func (d *DataBases) DeleteSuperGroup(groupID string) error {

Loading…
Cancel
Save