// 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/cloud/proto/note.proto

package cloud

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 (
	Note_CreateNote_FullMethodName       = "/cloud.Note/CreateNote"
	Note_GetNote_FullMethodName          = "/cloud.Note/GetNote"
	Note_UpdateNote_FullMethodName       = "/cloud.Note/UpdateNote"
	Note_DeleteNote_FullMethodName       = "/cloud.Note/DeleteNote"
	Note_ListNotes_FullMethodName        = "/cloud.Note/ListNotes"
	Note_TogglePin_FullMethodName        = "/cloud.Note/TogglePin"
	Note_IncrementViews_FullMethodName   = "/cloud.Note/IncrementViews"
	Note_SearchNotes_FullMethodName      = "/cloud.Note/SearchNotes"
	Note_InsertAttachment_FullMethodName = "/cloud.Note/InsertAttachment"
	Note_DeleteAttachment_FullMethodName = "/cloud.Note/DeleteAttachment"
)

// NoteClient is the client API for Note 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 NoteClient interface {
	// 创建笔记
	CreateNote(ctx context.Context, in *CreateNoteRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
	// 获取笔记详情
	GetNote(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudNoteItem, error)
	// 更新笔记
	UpdateNote(ctx context.Context, in *CloudNoteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
	// 删除笔记
	DeleteNote(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
	// 获取笔记列表
	ListNotes(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error)
	// 置顶/取消置顶笔记
	TogglePin(ctx context.Context, in *TogglePinRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
	// 增加浏览次数
	IncrementViews(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
	// 搜索笔记
	SearchNotes(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error)
	// 上传附件
	InsertAttachment(ctx context.Context, in *NoteAttachmentItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
	// 删除附件
	DeleteAttachment(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
}

type noteClient struct {
	cc grpc.ClientConnInterface
}

func NewNoteClient(cc grpc.ClientConnInterface) NoteClient {
	return &noteClient{cc}
}

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

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

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

func (c *noteClient) DeleteNote(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, Note_DeleteNote_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *noteClient) ListNotes(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListNotesResponse)
	err := c.cc.Invoke(ctx, Note_ListNotes_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

func (c *noteClient) IncrementViews(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, Note_IncrementViews_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *noteClient) SearchNotes(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListNotesResponse)
	err := c.cc.Invoke(ctx, Note_SearchNotes_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

func (c *noteClient) DeleteAttachment(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, Note_DeleteAttachment_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// NoteServer is the server API for Note service.
// All implementations should embed UnimplementedNoteServer
// for forward compatibility.
//
// 笔记服务
type NoteServer interface {
	// 创建笔记
	CreateNote(context.Context, *CreateNoteRequest) (*protobuf.StatusReply, error)
	// 获取笔记详情
	GetNote(context.Context, *protobuf.IdentRequest) (*CloudNoteItem, error)
	// 更新笔记
	UpdateNote(context.Context, *CloudNoteItem) (*protobuf.StatusReply, error)
	// 删除笔记
	DeleteNote(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
	// 获取笔记列表
	ListNotes(context.Context, *protobuf.FetchRequest) (*ListNotesResponse, error)
	// 置顶/取消置顶笔记
	TogglePin(context.Context, *TogglePinRequest) (*protobuf.StatusReply, error)
	// 增加浏览次数
	IncrementViews(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
	// 搜索笔记
	SearchNotes(context.Context, *protobuf.FetchRequest) (*ListNotesResponse, error)
	// 上传附件
	InsertAttachment(context.Context, *NoteAttachmentItem) (*protobuf.StatusReply, error)
	// 删除附件
	DeleteAttachment(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
}

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

func (UnimplementedNoteServer) CreateNote(context.Context, *CreateNoteRequest) (*protobuf.StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method CreateNote not implemented")
}
func (UnimplementedNoteServer) GetNote(context.Context, *protobuf.IdentRequest) (*CloudNoteItem, error) {
	return nil, status.Error(codes.Unimplemented, "method GetNote not implemented")
}
func (UnimplementedNoteServer) UpdateNote(context.Context, *CloudNoteItem) (*protobuf.StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method UpdateNote not implemented")
}
func (UnimplementedNoteServer) DeleteNote(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method DeleteNote not implemented")
}
func (UnimplementedNoteServer) ListNotes(context.Context, *protobuf.FetchRequest) (*ListNotesResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListNotes not implemented")
}
func (UnimplementedNoteServer) TogglePin(context.Context, *TogglePinRequest) (*protobuf.StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method TogglePin not implemented")
}
func (UnimplementedNoteServer) IncrementViews(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method IncrementViews not implemented")
}
func (UnimplementedNoteServer) SearchNotes(context.Context, *protobuf.FetchRequest) (*ListNotesResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method SearchNotes not implemented")
}
func (UnimplementedNoteServer) InsertAttachment(context.Context, *NoteAttachmentItem) (*protobuf.StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method InsertAttachment not implemented")
}
func (UnimplementedNoteServer) DeleteAttachment(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method DeleteAttachment not implemented")
}
func (UnimplementedNoteServer) testEmbeddedByValue() {}

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

func RegisterNoteServer(s grpc.ServiceRegistrar, srv NoteServer) {
	// If the following call panics, it indicates UnimplementedNoteServer 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(&Note_ServiceDesc, srv)
}

func _Note_CreateNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateNoteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NoteServer).CreateNote(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Note_CreateNote_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NoteServer).CreateNote(ctx, req.(*CreateNoteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Note_GetNote_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.(NoteServer).GetNote(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Note_GetNote_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NoteServer).GetNote(ctx, req.(*protobuf.IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Note_UpdateNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CloudNoteItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NoteServer).UpdateNote(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Note_UpdateNote_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NoteServer).UpdateNote(ctx, req.(*CloudNoteItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Note_DeleteNote_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.(NoteServer).DeleteNote(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Note_DeleteNote_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NoteServer).DeleteNote(ctx, req.(*protobuf.IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Note_ListNotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(protobuf.FetchRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NoteServer).ListNotes(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Note_ListNotes_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NoteServer).ListNotes(ctx, req.(*protobuf.FetchRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Note_TogglePin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TogglePinRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NoteServer).TogglePin(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Note_TogglePin_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NoteServer).TogglePin(ctx, req.(*TogglePinRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Note_IncrementViews_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.(NoteServer).IncrementViews(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Note_IncrementViews_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NoteServer).IncrementViews(ctx, req.(*protobuf.IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Note_SearchNotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(protobuf.FetchRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NoteServer).SearchNotes(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Note_SearchNotes_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NoteServer).SearchNotes(ctx, req.(*protobuf.FetchRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Note_InsertAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(NoteAttachmentItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NoteServer).InsertAttachment(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Note_InsertAttachment_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NoteServer).InsertAttachment(ctx, req.(*NoteAttachmentItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Note_DeleteAttachment_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.(NoteServer).DeleteAttachment(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Note_DeleteAttachment_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NoteServer).DeleteAttachment(ctx, req.(*protobuf.IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Note_ServiceDesc is the grpc.ServiceDesc for Note service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Note_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cloud.Note",
	HandlerType: (*NoteServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateNote",
			Handler:    _Note_CreateNote_Handler,
		},
		{
			MethodName: "GetNote",
			Handler:    _Note_GetNote_Handler,
		},
		{
			MethodName: "UpdateNote",
			Handler:    _Note_UpdateNote_Handler,
		},
		{
			MethodName: "DeleteNote",
			Handler:    _Note_DeleteNote_Handler,
		},
		{
			MethodName: "ListNotes",
			Handler:    _Note_ListNotes_Handler,
		},
		{
			MethodName: "TogglePin",
			Handler:    _Note_TogglePin_Handler,
		},
		{
			MethodName: "IncrementViews",
			Handler:    _Note_IncrementViews_Handler,
		},
		{
			MethodName: "SearchNotes",
			Handler:    _Note_SearchNotes_Handler,
		},
		{
			MethodName: "InsertAttachment",
			Handler:    _Note_InsertAttachment_Handler,
		},
		{
			MethodName: "DeleteAttachment",
			Handler:    _Note_DeleteAttachment_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "module/base/cloud/proto/note.proto",
}
