package client

import (
	"context"

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

// ActivityGrowthClient 只包装等级事件消费 RPC，避免 game-service 依赖 activity-service 内部实现。
type ActivityGrowthClient struct {
	growth activityv1.GrowthLevelServiceClient
	task   activityv1.TaskServiceClient
}

func NewActivityGrowthClient(conn *grpc.ClientConn) *ActivityGrowthClient {
	return &ActivityGrowthClient{
		growth: activityv1.NewGrowthLevelServiceClient(conn),
		task:   activityv1.NewTaskServiceClient(conn),
	}
}

func (c *ActivityGrowthClient) ConsumeLevelEvent(ctx context.Context, req *activityv1.ConsumeLevelEventRequest, opts ...grpc.CallOption) (*activityv1.ConsumeLevelEventResponse, error) {
	return c.growth.ConsumeLevelEvent(ctx, req, opts...)
}

func (c *ActivityGrowthClient) ConsumeTaskEvent(ctx context.Context, req *activityv1.ConsumeTaskEventRequest, opts ...grpc.CallOption) (*activityv1.ConsumeTaskEventResponse, error) {
	return c.task.ConsumeTaskEvent(ctx, req, opts...)
}
