// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v7.35.0
// source: module/base/initial/proto/data.proto

package initial

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	Data_Country_FullMethodName = "/initial.Data/Country"
	Data_Areas_FullMethodName   = "/initial.Data/Areas"
	Data_Datas_FullMethodName   = "/initial.Data/Datas"
)

// DataClient is the client API for Data service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// initial-数据
type DataClient interface {
	Country(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CountryReply, error)
	// 系统区域数据,默认级别：市
	Areas(ctx context.Context, in *AreasRequest, opts ...grpc.CallOption) (*AreasReply, error)
	// 系统数据
	Datas(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DatasReply, error)
}

type dataClient struct {
	cc grpc.ClientConnInterface
}

func NewDataClient(cc grpc.ClientConnInterface) DataClient {
	return &dataClient{cc}
}

func (c *dataClient) Country(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CountryReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CountryReply)
	err := c.cc.Invoke(ctx, Data_Country_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dataClient) Areas(ctx context.Context, in *AreasRequest, opts ...grpc.CallOption) (*AreasReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AreasReply)
	err := c.cc.Invoke(ctx, Data_Areas_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dataClient) Datas(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DatasReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DatasReply)
	err := c.cc.Invoke(ctx, Data_Datas_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// DataServer is the server API for Data service.
// All implementations should embed UnimplementedDataServer
// for forward compatibility.
//
// initial-数据
type DataServer interface {
	Country(context.Context, *Empty) (*CountryReply, error)
	// 系统区域数据,默认级别：市
	Areas(context.Context, *AreasRequest) (*AreasReply, error)
	// 系统数据
	Datas(context.Context, *Empty) (*DatasReply, error)
}

// UnimplementedDataServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedDataServer struct{}

func (UnimplementedDataServer) Country(context.Context, *Empty) (*CountryReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Country not implemented")
}
func (UnimplementedDataServer) Areas(context.Context, *AreasRequest) (*AreasReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Areas not implemented")
}
func (UnimplementedDataServer) Datas(context.Context, *Empty) (*DatasReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Datas not implemented")
}
func (UnimplementedDataServer) testEmbeddedByValue() {}

// UnsafeDataServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DataServer will
// result in compilation errors.
type UnsafeDataServer interface {
	mustEmbedUnimplementedDataServer()
}

func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) {
	// If the following call panics, it indicates UnimplementedDataServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&Data_ServiceDesc, srv)
}

func _Data_Country_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DataServer).Country(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Data_Country_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DataServer).Country(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Data_Areas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AreasRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DataServer).Areas(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Data_Areas_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DataServer).Areas(ctx, req.(*AreasRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Data_Datas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DataServer).Datas(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Data_Datas_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DataServer).Datas(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

// Data_ServiceDesc is the grpc.ServiceDesc for Data service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Data_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "initial.Data",
	HandlerType: (*DataServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Country",
			Handler:    _Data_Country_Handler,
		},
		{
			MethodName: "Areas",
			Handler:    _Data_Areas_Handler,
		},
		{
			MethodName: "Datas",
			Handler:    _Data_Datas_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "module/base/initial/proto/data.proto",
}
