package service

import (
	"context"

	"github.com/tidbcloud/tiinf/monitor/tilog"
	"go.uber.org/zap"

	globaldedicatedv1 "github.com/tidbcloud/tidb-management-service/api/spec/global/dedicated/v1"
	mockcoresvc "github.com/tidbcloud/tidb-management-service/tempo-proxy/mock-core-svc/service"
)

type MockService struct {
	globaldedicatedv1.UnimplementedClusterServiceServer

	CoreSvc *mockcoresvc.MockCoreSvc
	name    string
}

func NewMockService(name string) *MockService {
	return &MockService{
		CoreSvc: mockcoresvc.NewMockCoreSvc(name),
		name:    name,
	}
}

func (svc *MockService) GetClusterConfidentialInfo(
	ctx context.Context,
	in *globaldedicatedv1.GetClusterConfidentialInfoRequest,
) (*globaldedicatedv1.GetClusterConfidentialInfoResponse, error) {
	tilog.PlainInfo("mock-dedicated-global",
		zap.String("service", svc.name),
		zap.String("method", "GetClusterConfidentialInfo"))
	return &globaldedicatedv1.GetClusterConfidentialInfoResponse{}, nil
}
