chore: tweak search resources

This commit is contained in:
Steven
2024-07-22 15:33:02 +08:00
parent 95fa145665
commit 44e56844f5
11 changed files with 703 additions and 1430 deletions

View File

@@ -22,7 +22,6 @@ const _ = grpc.SupportPackageIsVersion8
const (
MemoService_CreateMemo_FullMethodName = "/memos.api.v1.MemoService/CreateMemo"
MemoService_ListMemos_FullMethodName = "/memos.api.v1.MemoService/ListMemos"
MemoService_SearchMemos_FullMethodName = "/memos.api.v1.MemoService/SearchMemos"
MemoService_GetMemo_FullMethodName = "/memos.api.v1.MemoService/GetMemo"
MemoService_GetMemoByUid_FullMethodName = "/memos.api.v1.MemoService/GetMemoByUid"
MemoService_UpdateMemo_FullMethodName = "/memos.api.v1.MemoService/UpdateMemo"
@@ -53,8 +52,6 @@ type MemoServiceClient interface {
CreateMemo(ctx context.Context, in *CreateMemoRequest, opts ...grpc.CallOption) (*Memo, error)
// ListMemos lists memos with pagination and filter.
ListMemos(ctx context.Context, in *ListMemosRequest, opts ...grpc.CallOption) (*ListMemosResponse, error)
// SearchMemos searches memos.
SearchMemos(ctx context.Context, in *SearchMemosRequest, opts ...grpc.CallOption) (*SearchMemosResponse, error)
// GetMemo gets a memo.
GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*Memo, error)
// GetMemoByUid gets a memo by uid
@@ -125,16 +122,6 @@ func (c *memoServiceClient) ListMemos(ctx context.Context, in *ListMemosRequest,
return out, nil
}
func (c *memoServiceClient) SearchMemos(ctx context.Context, in *SearchMemosRequest, opts ...grpc.CallOption) (*SearchMemosResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SearchMemosResponse)
err := c.cc.Invoke(ctx, MemoService_SearchMemos_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *memoServiceClient) GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*Memo, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Memo)
@@ -343,8 +330,6 @@ type MemoServiceServer interface {
CreateMemo(context.Context, *CreateMemoRequest) (*Memo, error)
// ListMemos lists memos with pagination and filter.
ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error)
// SearchMemos searches memos.
SearchMemos(context.Context, *SearchMemosRequest) (*SearchMemosResponse, error)
// GetMemo gets a memo.
GetMemo(context.Context, *GetMemoRequest) (*Memo, error)
// GetMemoByUid gets a memo by uid
@@ -398,9 +383,6 @@ func (UnimplementedMemoServiceServer) CreateMemo(context.Context, *CreateMemoReq
func (UnimplementedMemoServiceServer) ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListMemos not implemented")
}
func (UnimplementedMemoServiceServer) SearchMemos(context.Context, *SearchMemosRequest) (*SearchMemosResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SearchMemos not implemented")
}
func (UnimplementedMemoServiceServer) GetMemo(context.Context, *GetMemoRequest) (*Memo, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetMemo not implemented")
}
@@ -510,24 +492,6 @@ func _MemoService_ListMemos_Handler(srv interface{}, ctx context.Context, dec fu
return interceptor(ctx, in, info, handler)
}
func _MemoService_SearchMemos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchMemosRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MemoServiceServer).SearchMemos(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: MemoService_SearchMemos_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MemoServiceServer).SearchMemos(ctx, req.(*SearchMemosRequest))
}
return interceptor(ctx, in, info, handler)
}
func _MemoService_GetMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetMemoRequest)
if err := dec(in); err != nil {
@@ -903,10 +867,6 @@ var MemoService_ServiceDesc = grpc.ServiceDesc{
MethodName: "ListMemos",
Handler: _MemoService_ListMemos_Handler,
},
{
MethodName: "SearchMemos",
Handler: _MemoService_SearchMemos_Handler,
},
{
MethodName: "GetMemo",
Handler: _MemoService_GetMemo_Handler,