|
|
|
@ -245,8 +245,9 @@ func CreateGroup(c *gin.Context) {
|
|
|
|
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
req := &rpc.CreateGroupReq{}
|
|
|
|
|
utils.CopyStructFields(req, ¶ms)
|
|
|
|
|
req := &rpc.CreateGroupReq{GroupInfo: &open_im_sdk.GroupInfo{}}
|
|
|
|
|
utils.CopyStructFields(req.GroupInfo, ¶ms)
|
|
|
|
|
|
|
|
|
|
for _, v := range params.MemberList {
|
|
|
|
|
req.InitMemberList = append(req.InitMemberList, &rpc.GroupAddMemberInfo{UserID: v.UserID, RoleLevel: v.RoleLevel})
|
|
|
|
|
}
|
|
|
|
@ -257,6 +258,8 @@ func CreateGroup(c *gin.Context) {
|
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
req.OwnerUserID = req.OpUserID
|
|
|
|
|
req.OperationID = params.OperationID
|
|
|
|
|
log.NewInfo(req.OperationID, "CreateGroup args ", req.String())
|
|
|
|
|
|
|
|
|
|
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName)
|
|
|
|
@ -447,7 +450,7 @@ func SetGroupInfo(c *gin.Context) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
req := &rpc.SetGroupInfoReq{GroupInfo: &open_im_sdk.GroupInfo{}}
|
|
|
|
|
utils.CopyStructFields(req.GroupInfo, ¶ms.Group)
|
|
|
|
|
utils.CopyStructFields(req.GroupInfo, ¶ms)
|
|
|
|
|
req.OperationID = params.OperationID
|
|
|
|
|
var ok bool
|
|
|
|
|
ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"))
|
|
|
|
|