mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: implement list memo resources api
This commit is contained in:
@@ -24,6 +24,7 @@ const (
|
||||
MemoService_GetMemo_FullMethodName = "/memos.api.v2.MemoService/GetMemo"
|
||||
MemoService_UpdateMemo_FullMethodName = "/memos.api.v2.MemoService/UpdateMemo"
|
||||
MemoService_DeleteMemo_FullMethodName = "/memos.api.v2.MemoService/DeleteMemo"
|
||||
MemoService_ListMemoResources_FullMethodName = "/memos.api.v2.MemoService/ListMemoResources"
|
||||
MemoService_CreateMemoComment_FullMethodName = "/memos.api.v2.MemoService/CreateMemoComment"
|
||||
MemoService_ListMemoComments_FullMethodName = "/memos.api.v2.MemoService/ListMemoComments"
|
||||
)
|
||||
@@ -37,6 +38,7 @@ type MemoServiceClient interface {
|
||||
GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error)
|
||||
UpdateMemo(ctx context.Context, in *UpdateMemoRequest, opts ...grpc.CallOption) (*UpdateMemoResponse, error)
|
||||
DeleteMemo(ctx context.Context, in *DeleteMemoRequest, opts ...grpc.CallOption) (*DeleteMemoResponse, error)
|
||||
ListMemoResources(ctx context.Context, in *ListMemoResourcesRequest, opts ...grpc.CallOption) (*ListMemoResourcesResponse, error)
|
||||
CreateMemoComment(ctx context.Context, in *CreateMemoCommentRequest, opts ...grpc.CallOption) (*CreateMemoCommentResponse, error)
|
||||
ListMemoComments(ctx context.Context, in *ListMemoCommentsRequest, opts ...grpc.CallOption) (*ListMemoCommentsResponse, error)
|
||||
}
|
||||
@@ -94,6 +96,15 @@ func (c *memoServiceClient) DeleteMemo(ctx context.Context, in *DeleteMemoReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) ListMemoResources(ctx context.Context, in *ListMemoResourcesRequest, opts ...grpc.CallOption) (*ListMemoResourcesResponse, error) {
|
||||
out := new(ListMemoResourcesResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_ListMemoResources_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *memoServiceClient) CreateMemoComment(ctx context.Context, in *CreateMemoCommentRequest, opts ...grpc.CallOption) (*CreateMemoCommentResponse, error) {
|
||||
out := new(CreateMemoCommentResponse)
|
||||
err := c.cc.Invoke(ctx, MemoService_CreateMemoComment_FullMethodName, in, out, opts...)
|
||||
@@ -121,6 +132,7 @@ type MemoServiceServer interface {
|
||||
GetMemo(context.Context, *GetMemoRequest) (*GetMemoResponse, error)
|
||||
UpdateMemo(context.Context, *UpdateMemoRequest) (*UpdateMemoResponse, error)
|
||||
DeleteMemo(context.Context, *DeleteMemoRequest) (*DeleteMemoResponse, error)
|
||||
ListMemoResources(context.Context, *ListMemoResourcesRequest) (*ListMemoResourcesResponse, error)
|
||||
CreateMemoComment(context.Context, *CreateMemoCommentRequest) (*CreateMemoCommentResponse, error)
|
||||
ListMemoComments(context.Context, *ListMemoCommentsRequest) (*ListMemoCommentsResponse, error)
|
||||
mustEmbedUnimplementedMemoServiceServer()
|
||||
@@ -145,6 +157,9 @@ func (UnimplementedMemoServiceServer) UpdateMemo(context.Context, *UpdateMemoReq
|
||||
func (UnimplementedMemoServiceServer) DeleteMemo(context.Context, *DeleteMemoRequest) (*DeleteMemoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteMemo not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) ListMemoResources(context.Context, *ListMemoResourcesRequest) (*ListMemoResourcesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListMemoResources not implemented")
|
||||
}
|
||||
func (UnimplementedMemoServiceServer) CreateMemoComment(context.Context, *CreateMemoCommentRequest) (*CreateMemoCommentResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateMemoComment not implemented")
|
||||
}
|
||||
@@ -254,6 +269,24 @@ func _MemoService_DeleteMemo_Handler(srv interface{}, ctx context.Context, dec f
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_ListMemoResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListMemoResourcesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MemoServiceServer).ListMemoResources(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MemoService_ListMemoResources_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MemoServiceServer).ListMemoResources(ctx, req.(*ListMemoResourcesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MemoService_CreateMemoComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateMemoCommentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -317,6 +350,10 @@ var MemoService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "DeleteMemo",
|
||||
Handler: _MemoService_DeleteMemo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListMemoResources",
|
||||
Handler: _MemoService_ListMemoResources_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateMemoComment",
|
||||
Handler: _MemoService_CreateMemoComment_Handler,
|
||||
|
Reference in New Issue
Block a user