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

package server

import (
	"context"

	"github.com/cherish-chat/xxim-server/app/conversation/internal/logic/groupservice"
	"github.com/cherish-chat/xxim-server/app/conversation/internal/svc"
	"github.com/cherish-chat/xxim-server/common/pb"
)

type GroupServiceServer struct {
	svcCtx *svc.ServiceContext
	pb.UnimplementedGroupServiceServer
}

func NewGroupServiceServer(svcCtx *svc.ServiceContext) *GroupServiceServer {
	return &GroupServiceServer{
		svcCtx: svcCtx,
	}
}

// GroupCreate 创建群组
func (s *GroupServiceServer) GroupCreate(ctx context.Context, in *pb.GroupCreateReq) (*pb.GroupCreateResp, error) {
	l := groupservicelogic.NewGroupCreateLogic(ctx, s.svcCtx)
	return l.GroupCreate(in)
}

// CountJoinGroup 统计加入的群组数量
func (s *GroupServiceServer) CountJoinGroup(ctx context.Context, in *pb.CountJoinGroupReq) (*pb.CountJoinGroupResp, error) {
	l := groupservicelogic.NewCountJoinGroupLogic(ctx, s.svcCtx)
	return l.CountJoinGroup(in)
}

// CountCreateGroup 统计创建的群组数量
func (s *GroupServiceServer) CountCreateGroup(ctx context.Context, in *pb.CountCreateGroupReq) (*pb.CountCreateGroupResp, error) {
	l := groupservicelogic.NewCountCreateGroupLogic(ctx, s.svcCtx)
	return l.CountCreateGroup(in)
}

// GroupSubscribe 群组订阅
func (s *GroupServiceServer) GroupSubscribe(ctx context.Context, in *pb.GroupSubscribeReq) (*pb.GroupSubscribeResp, error) {
	l := groupservicelogic.NewGroupSubscribeLogic(ctx, s.svcCtx)
	return l.GroupSubscribe(in)
}

// ListGroupSubscribers 列出群组订阅者
func (s *GroupServiceServer) ListGroupSubscribers(ctx context.Context, in *pb.ListGroupSubscribersReq) (*pb.ListGroupSubscribersResp, error) {
	l := groupservicelogic.NewListGroupSubscribersLogic(ctx, s.svcCtx)
	return l.ListGroupSubscribers(in)
}
