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

package searchservice

import (
	"context"

	"juwan-backend/app/search/rpc/pb"

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

type (
	AddFavoritesReq      = pb.AddFavoritesReq
	AddFavoritesResp     = pb.AddFavoritesResp
	DelFavoritesReq      = pb.DelFavoritesReq
	DelFavoritesResp     = pb.DelFavoritesResp
	Favorites            = pb.Favorites
	GetFavoritesByIdReq  = pb.GetFavoritesByIdReq
	GetFavoritesByIdResp = pb.GetFavoritesByIdResp
	SearchFavoritesReq   = pb.SearchFavoritesReq
	SearchFavoritesResp  = pb.SearchFavoritesResp

	SearchService interface {
		AddFavorites(ctx context.Context, in *AddFavoritesReq, opts ...grpc.CallOption) (*AddFavoritesResp, error)
		DelFavorites(ctx context.Context, in *DelFavoritesReq, opts ...grpc.CallOption) (*DelFavoritesResp, error)
		GetFavoritesById(ctx context.Context, in *GetFavoritesByIdReq, opts ...grpc.CallOption) (*GetFavoritesByIdResp, error)
		SearchFavorites(ctx context.Context, in *SearchFavoritesReq, opts ...grpc.CallOption) (*SearchFavoritesResp, error)
	}

	defaultSearchService struct {
		cli zrpc.Client
	}
)

func NewSearchService(cli zrpc.Client) SearchService {
	return &defaultSearchService{
		cli: cli,
	}
}

func (m *defaultSearchService) AddFavorites(ctx context.Context, in *AddFavoritesReq, opts ...grpc.CallOption) (*AddFavoritesResp, error) {
	client := pb.NewSearchServiceClient(m.cli.Conn())
	return client.AddFavorites(ctx, in, opts...)
}

func (m *defaultSearchService) DelFavorites(ctx context.Context, in *DelFavoritesReq, opts ...grpc.CallOption) (*DelFavoritesResp, error) {
	client := pb.NewSearchServiceClient(m.cli.Conn())
	return client.DelFavorites(ctx, in, opts...)
}

func (m *defaultSearchService) GetFavoritesById(ctx context.Context, in *GetFavoritesByIdReq, opts ...grpc.CallOption) (*GetFavoritesByIdResp, error) {
	client := pb.NewSearchServiceClient(m.cli.Conn())
	return client.GetFavoritesById(ctx, in, opts...)
}

func (m *defaultSearchService) SearchFavorites(ctx context.Context, in *SearchFavoritesReq, opts ...grpc.CallOption) (*SearchFavoritesResp, error) {
	client := pb.NewSearchServiceClient(m.cli.Conn())
	return client.SearchFavorites(ctx, in, opts...)
}
