// 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/cms/proto/pages.proto

package cms

import (
	protobuf "bsm/full/protobuf"
	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 (
	Pages_Fetch_FullMethodName         = "/cms.Pages/Fetch"
	Pages_GetByIdentity_FullMethodName = "/cms.Pages/GetByIdentity"
	Pages_GetByKey_FullMethodName      = "/cms.Pages/GetByKey"
	Pages_Create_FullMethodName        = "/cms.Pages/Create"
	Pages_Modify_FullMethodName        = "/cms.Pages/Modify"
	Pages_Delete_FullMethodName        = "/cms.Pages/Delete"
)

// PagesClient is the client API for Pages 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.
//
// 单页管理
type PagesClient interface {
	// 单页列表
	Fetch(ctx context.Context, in *PagesListRequest, opts ...grpc.CallOption) (*PagesListReply, error)
	// 获取单页详情 By Identity
	GetByIdentity(ctx context.Context, in *GetPagesRequest, opts ...grpc.CallOption) (*PagesItem, error)
	// 获取单页详情 By Key
	GetByKey(ctx context.Context, in *GetPagesByKeyRequest, opts ...grpc.CallOption) (*PagesItem, error)
	// 发布单页
	Create(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
	// 修改单页
	Modify(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
	// 删除单页
	Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
}

type pagesClient struct {
	cc grpc.ClientConnInterface
}

func NewPagesClient(cc grpc.ClientConnInterface) PagesClient {
	return &pagesClient{cc}
}

func (c *pagesClient) Fetch(ctx context.Context, in *PagesListRequest, opts ...grpc.CallOption) (*PagesListReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PagesListReply)
	err := c.cc.Invoke(ctx, Pages_Fetch_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pagesClient) GetByIdentity(ctx context.Context, in *GetPagesRequest, opts ...grpc.CallOption) (*PagesItem, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PagesItem)
	err := c.cc.Invoke(ctx, Pages_GetByIdentity_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pagesClient) GetByKey(ctx context.Context, in *GetPagesByKeyRequest, opts ...grpc.CallOption) (*PagesItem, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PagesItem)
	err := c.cc.Invoke(ctx, Pages_GetByKey_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pagesClient) Create(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(protobuf.StatusReply)
	err := c.cc.Invoke(ctx, Pages_Create_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pagesClient) Modify(ctx context.Context, in *PagesItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(protobuf.StatusReply)
	err := c.cc.Invoke(ctx, Pages_Modify_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pagesClient) Delete(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(protobuf.StatusReply)
	err := c.cc.Invoke(ctx, Pages_Delete_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PagesServer is the server API for Pages service.
// All implementations should embed UnimplementedPagesServer
// for forward compatibility.
//
// 单页管理
type PagesServer interface {
	// 单页列表
	Fetch(context.Context, *PagesListRequest) (*PagesListReply, error)
	// 获取单页详情 By Identity
	GetByIdentity(context.Context, *GetPagesRequest) (*PagesItem, error)
	// 获取单页详情 By Key
	GetByKey(context.Context, *GetPagesByKeyRequest) (*PagesItem, error)
	// 发布单页
	Create(context.Context, *PagesItem) (*protobuf.StatusReply, error)
	// 修改单页
	Modify(context.Context, *PagesItem) (*protobuf.StatusReply, error)
	// 删除单页
	Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
}

// UnimplementedPagesServer 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 UnimplementedPagesServer struct{}

func (UnimplementedPagesServer) Fetch(context.Context, *PagesListRequest) (*PagesListReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedPagesServer) GetByIdentity(context.Context, *GetPagesRequest) (*PagesItem, error) {
	return nil, status.Error(codes.Unimplemented, "method GetByIdentity not implemented")
}
func (UnimplementedPagesServer) GetByKey(context.Context, *GetPagesByKeyRequest) (*PagesItem, error) {
	return nil, status.Error(codes.Unimplemented, "method GetByKey not implemented")
}
func (UnimplementedPagesServer) Create(context.Context, *PagesItem) (*protobuf.StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedPagesServer) Modify(context.Context, *PagesItem) (*protobuf.StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedPagesServer) Delete(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedPagesServer) testEmbeddedByValue() {}

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

func RegisterPagesServer(s grpc.ServiceRegistrar, srv PagesServer) {
	// If the following call panics, it indicates UnimplementedPagesServer 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(&Pages_ServiceDesc, srv)
}

func _Pages_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PagesListRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PagesServer).Fetch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Pages_Fetch_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PagesServer).Fetch(ctx, req.(*PagesListRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Pages_GetByIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetPagesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PagesServer).GetByIdentity(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Pages_GetByIdentity_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PagesServer).GetByIdentity(ctx, req.(*GetPagesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Pages_GetByKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetPagesByKeyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PagesServer).GetByKey(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Pages_GetByKey_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PagesServer).GetByKey(ctx, req.(*GetPagesByKeyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Pages_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PagesItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PagesServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Pages_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PagesServer).Create(ctx, req.(*PagesItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Pages_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PagesItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PagesServer).Modify(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Pages_Modify_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PagesServer).Modify(ctx, req.(*PagesItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Pages_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(protobuf.IdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PagesServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Pages_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PagesServer).Delete(ctx, req.(*protobuf.IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Pages_ServiceDesc is the grpc.ServiceDesc for Pages service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Pages_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cms.Pages",
	HandlerType: (*PagesServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Fetch",
			Handler:    _Pages_Fetch_Handler,
		},
		{
			MethodName: "GetByIdentity",
			Handler:    _Pages_GetByIdentity_Handler,
		},
		{
			MethodName: "GetByKey",
			Handler:    _Pages_GetByKey_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _Pages_Create_Handler,
		},
		{
			MethodName: "Modify",
			Handler:    _Pages_Modify_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Pages_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "module/base/cms/proto/pages.proto",
}
