You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
876 B
32 lines
876 B
package group
|
|
|
|
import (
|
|
"OpenIM/internal/api2rpc"
|
|
"OpenIM/pkg/apistruct"
|
|
"OpenIM/pkg/common/config"
|
|
"OpenIM/pkg/proto/group"
|
|
"github.com/OpenIMSDK/openKeeper"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type Group struct {
|
|
zk *openKeeper.ZkClient
|
|
}
|
|
|
|
func (g *Group) getGroupClient() (group.GroupClient, error) {
|
|
conn, err := g.zk.GetConn(config.Config.RpcRegisterName.OpenImGroupName)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return group.NewGroupClient(conn), nil
|
|
}
|
|
|
|
func (g *Group) KickGroupMember(c *gin.Context) {
|
|
var fn = group.GroupClient.KickGroupMember
|
|
api2rpc.New(&apistruct.KickGroupMemberReq{}, &apistruct.KickGroupMemberResp{}, fn).Call(c, g.getGroupClient)
|
|
}
|
|
|
|
func (g *Group) GetGroupMembersInfo(c *gin.Context) {
|
|
api2rpc.New(&apistruct.GetGroupMembersInfoReq{}, &apistruct.GetGroupMembersInfoResp{}, group.GroupClient.GetGroupMembersInfo).Call(c, g.getGroupClient)
|
|
}
|