package client

import (
	"context"

	"google.golang.org/grpc"
	activityv1 "hyapp.local/api/proto/activity/v1"
)

// CPWeeklyRankClient abstracts H5 CP weekly rank reads from activity-service.
type CPWeeklyRankClient interface {
	GetCPWeeklyRankStatus(ctx context.Context, req *activityv1.GetCPWeeklyRankStatusRequest) (*activityv1.GetCPWeeklyRankStatusResponse, error)
}

type grpcCPWeeklyRankClient struct {
	client activityv1.CPWeeklyRankServiceClient
}

func NewGRPCCPWeeklyRankClient(conn *grpc.ClientConn) CPWeeklyRankClient {
	return &grpcCPWeeklyRankClient{client: activityv1.NewCPWeeklyRankServiceClient(conn)}
}

func (c *grpcCPWeeklyRankClient) GetCPWeeklyRankStatus(ctx context.Context, req *activityv1.GetCPWeeklyRankStatusRequest) (*activityv1.GetCPWeeklyRankStatusResponse, error) {
	return c.client.GetCPWeeklyRankStatus(ctx, req)
}
