// Code generated by goctl. DO NOT EDIT.
// Source: conversation.proto

package groupservice

import (
	"context"

	"github.com/cherish-chat/xxim-server/common/pb"

	"github.com/zeromicro/go-zero/zrpc"
	"google.golang.org/grpc"
)

type (
	ConversationSettingUpdateReq                            = pb.ConversationSettingUpdateReq
	ConversationSettingUpdateResp                           = pb.ConversationSettingUpdateResp
	CountCreateGroupReq                                     = pb.CountCreateGroupReq
	CountCreateGroupResp                                    = pb.CountCreateGroupResp
	CountFriendReq                                          = pb.CountFriendReq
	CountFriendResp                                         = pb.CountFriendResp
	CountJoinGroupReq                                       = pb.CountJoinGroupReq
	CountJoinGroupResp                                      = pb.CountJoinGroupResp
	DeleteUserSubscriptionReq                               = pb.DeleteUserSubscriptionReq
	DeleteUserSubscriptionResp                              = pb.DeleteUserSubscriptionResp
	FriendApplyHandleReq                                    = pb.FriendApplyHandleReq
	FriendApplyHandleResp                                   = pb.FriendApplyHandleResp
	FriendApplyReq                                          = pb.FriendApplyReq
	FriendApplyResp                                         = pb.FriendApplyResp
	GroupCreateReq                                          = pb.GroupCreateReq
	GroupCreateResp                                         = pb.GroupCreateResp
	GroupSubscribeReq                                       = pb.GroupSubscribeReq
	GroupSubscribeResp                                      = pb.GroupSubscribeResp
	ListFriendApplyReq                                      = pb.ListFriendApplyReq
	ListFriendApplyReq_Filter                               = pb.ListFriendApplyReq_Filter
	ListFriendApplyReq_Option                               = pb.ListFriendApplyReq_Option
	ListFriendApplyResp                                     = pb.ListFriendApplyResp
	ListFriendApplyResp_FriendApply                         = pb.ListFriendApplyResp_FriendApply
	ListGroupSubscribersReq                                 = pb.ListGroupSubscribersReq
	ListGroupSubscribersReq_Filter                          = pb.ListGroupSubscribersReq_Filter
	ListGroupSubscribersReq_Option                          = pb.ListGroupSubscribersReq_Option
	ListGroupSubscribersResp                                = pb.ListGroupSubscribersResp
	ListGroupSubscribersResp_Subscriber                     = pb.ListGroupSubscribersResp_Subscriber
	ListJoinedConversationsReq                              = pb.ListJoinedConversationsReq
	ListJoinedConversationsReq_Filter                       = pb.ListJoinedConversationsReq_Filter
	ListJoinedConversationsReq_Filter_SettingKV             = pb.ListJoinedConversationsReq_Filter_SettingKV
	ListJoinedConversationsReq_Option                       = pb.ListJoinedConversationsReq_Option
	ListJoinedConversationsResp                             = pb.ListJoinedConversationsResp
	ListJoinedConversationsResp_Conversation                = pb.ListJoinedConversationsResp_Conversation
	ListJoinedConversationsResp_Conversation_SelfMemberInfo = pb.ListJoinedConversationsResp_Conversation_SelfMemberInfo
	ListSubscriptionSubscribersReq                          = pb.ListSubscriptionSubscribersReq
	ListSubscriptionSubscribersReq_Filter                   = pb.ListSubscriptionSubscribersReq_Filter
	ListSubscriptionSubscribersReq_Option                   = pb.ListSubscriptionSubscribersReq_Option
	ListSubscriptionSubscribersResp                         = pb.ListSubscriptionSubscribersResp
	ListSubscriptionSubscribersResp_Subscriber              = pb.ListSubscriptionSubscribersResp_Subscriber
	SubscriptionAfterOfflineReq                             = pb.SubscriptionAfterOfflineReq
	SubscriptionAfterOfflineResp                            = pb.SubscriptionAfterOfflineResp
	SubscriptionAfterOnlineReq                              = pb.SubscriptionAfterOnlineReq
	SubscriptionAfterOnlineResp                             = pb.SubscriptionAfterOnlineResp
	SubscriptionSubscribeReq                                = pb.SubscriptionSubscribeReq
	SubscriptionSubscribeResp                               = pb.SubscriptionSubscribeResp
	UpsertUserSubscriptionReq                               = pb.UpsertUserSubscriptionReq
	UpsertUserSubscriptionResp                              = pb.UpsertUserSubscriptionResp
	UserSubscription                                        = pb.UserSubscription

	GroupService interface {
		// GroupCreate 创建群组
		GroupCreate(ctx context.Context, in *GroupCreateReq, opts ...grpc.CallOption) (*GroupCreateResp, error)
		// CountJoinGroup 统计加入的群组数量
		CountJoinGroup(ctx context.Context, in *CountJoinGroupReq, opts ...grpc.CallOption) (*CountJoinGroupResp, error)
		// CountCreateGroup 统计创建的群组数量
		CountCreateGroup(ctx context.Context, in *CountCreateGroupReq, opts ...grpc.CallOption) (*CountCreateGroupResp, error)
		// GroupSubscribe 群组订阅
		GroupSubscribe(ctx context.Context, in *GroupSubscribeReq, opts ...grpc.CallOption) (*GroupSubscribeResp, error)
		// ListGroupSubscribers 列出群组订阅者
		ListGroupSubscribers(ctx context.Context, in *ListGroupSubscribersReq, opts ...grpc.CallOption) (*ListGroupSubscribersResp, error)
	}

	defaultGroupService struct {
		cli zrpc.Client
	}
)

func NewGroupService(cli zrpc.Client) GroupService {
	return &defaultGroupService{
		cli: cli,
	}
}

// GroupCreate 创建群组
func (m *defaultGroupService) GroupCreate(ctx context.Context, in *GroupCreateReq, opts ...grpc.CallOption) (*GroupCreateResp, error) {
	client := pb.NewGroupServiceClient(m.cli.Conn())
	return client.GroupCreate(ctx, in, opts...)
}

// CountJoinGroup 统计加入的群组数量
func (m *defaultGroupService) CountJoinGroup(ctx context.Context, in *CountJoinGroupReq, opts ...grpc.CallOption) (*CountJoinGroupResp, error) {
	client := pb.NewGroupServiceClient(m.cli.Conn())
	return client.CountJoinGroup(ctx, in, opts...)
}

// CountCreateGroup 统计创建的群组数量
func (m *defaultGroupService) CountCreateGroup(ctx context.Context, in *CountCreateGroupReq, opts ...grpc.CallOption) (*CountCreateGroupResp, error) {
	client := pb.NewGroupServiceClient(m.cli.Conn())
	return client.CountCreateGroup(ctx, in, opts...)
}

// GroupSubscribe 群组订阅
func (m *defaultGroupService) GroupSubscribe(ctx context.Context, in *GroupSubscribeReq, opts ...grpc.CallOption) (*GroupSubscribeResp, error) {
	client := pb.NewGroupServiceClient(m.cli.Conn())
	return client.GroupSubscribe(ctx, in, opts...)
}

// ListGroupSubscribers 列出群组订阅者
func (m *defaultGroupService) ListGroupSubscribers(ctx context.Context, in *ListGroupSubscribersReq, opts ...grpc.CallOption) (*ListGroupSubscribersResp, error) {
	client := pb.NewGroupServiceClient(m.cli.Conn())
	return client.ListGroupSubscribers(ctx, in, opts...)
}
