Skip to content
Snippets Groups Projects
Commit 6e136cd8 authored by Pavel Antonov's avatar Pavel Antonov :asterisk:
Browse files

Merge branch 'feature/PRXS-2794-TagsListFilter' into 'master'

Добавлен фильтр по тегам (tag)  в Collections.List

See merge request perxis/perxis-go!386
parents b961ba78 8d47f178
No related branches found
No related tags found
No related merge requests found
Subproject commit 1e2543d67705f22a4553e04b4e37a7b9372f5cbc Subproject commit 28e1ab4712c393762eaefa2a14b0492a9ad7be6c
...@@ -27,4 +27,5 @@ type Filter struct { ...@@ -27,4 +27,5 @@ type Filter struct {
ExcludeSystem bool `json:"exclude_system,omitempty"` ExcludeSystem bool `json:"exclude_system,omitempty"`
Name []string `json:"name,omitempty"` Name []string `json:"name,omitempty"`
ID []string `json:"id,omitempty"` ID []string `json:"id,omitempty"`
Tag []string `json:"tag,omitempty"`
} }
...@@ -218,6 +218,7 @@ func PtrFilterToProto(filter *service.Filter) (*pb.ListRequest_Filter, error) { ...@@ -218,6 +218,7 @@ func PtrFilterToProto(filter *service.Filter) (*pb.ListRequest_Filter, error) {
IncludeHidden: filter.IncludeHidden, IncludeHidden: filter.IncludeHidden,
Name: filter.Name, Name: filter.Name,
Id: filter.ID, Id: filter.ID,
Tag: filter.Tag,
}, nil }, nil
} }
...@@ -231,6 +232,7 @@ func ProtoToPtrFilter(protoFilter *pb.ListRequest_Filter) (*service.Filter, erro ...@@ -231,6 +232,7 @@ func ProtoToPtrFilter(protoFilter *pb.ListRequest_Filter) (*service.Filter, erro
ExcludeSystem: protoFilter.ExcludeSystem, ExcludeSystem: protoFilter.ExcludeSystem,
Name: protoFilter.Name, Name: protoFilter.Name,
ID: protoFilter.Id, ID: protoFilter.Id,
Tag: protoFilter.Tag,
}, nil }, nil
} }
......
This diff is collapsed.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.3.0 // - protoc-gen-go-grpc v1.5.1
// - protoc v5.28.1 // - protoc v5.28.3
// source: collections/collections.proto // source: collections/collections.proto
package collections package collections
...@@ -16,8 +16,8 @@ import ( ...@@ -16,8 +16,8 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later. // Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion7 const _ = grpc.SupportPackageIsVersion9
const ( const (
Collections_Create_FullMethodName = "/content.collections.Collections/Create" Collections_Create_FullMethodName = "/content.collections.Collections/Create"
...@@ -63,8 +63,9 @@ func NewCollectionsClient(cc grpc.ClientConnInterface) CollectionsClient { ...@@ -63,8 +63,9 @@ func NewCollectionsClient(cc grpc.ClientConnInterface) CollectionsClient {
} }
func (c *collectionsClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { func (c *collectionsClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateResponse) out := new(CreateResponse)
err := c.cc.Invoke(ctx, Collections_Create_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Collections_Create_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -72,8 +73,9 @@ func (c *collectionsClient) Create(ctx context.Context, in *CreateRequest, opts ...@@ -72,8 +73,9 @@ func (c *collectionsClient) Create(ctx context.Context, in *CreateRequest, opts
} }
func (c *collectionsClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { func (c *collectionsClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetResponse) out := new(GetResponse)
err := c.cc.Invoke(ctx, Collections_Get_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Collections_Get_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -81,8 +83,9 @@ func (c *collectionsClient) Get(ctx context.Context, in *GetRequest, opts ...grp ...@@ -81,8 +83,9 @@ func (c *collectionsClient) Get(ctx context.Context, in *GetRequest, opts ...grp
} }
func (c *collectionsClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { func (c *collectionsClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListResponse) out := new(ListResponse)
err := c.cc.Invoke(ctx, Collections_List_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Collections_List_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -90,8 +93,9 @@ func (c *collectionsClient) List(ctx context.Context, in *ListRequest, opts ...g ...@@ -90,8 +93,9 @@ func (c *collectionsClient) List(ctx context.Context, in *ListRequest, opts ...g
} }
func (c *collectionsClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { func (c *collectionsClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty) out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, Collections_Update_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Collections_Update_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -99,8 +103,9 @@ func (c *collectionsClient) Update(ctx context.Context, in *UpdateRequest, opts ...@@ -99,8 +103,9 @@ func (c *collectionsClient) Update(ctx context.Context, in *UpdateRequest, opts
} }
func (c *collectionsClient) SetSchema(ctx context.Context, in *SetSchemaRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { func (c *collectionsClient) SetSchema(ctx context.Context, in *SetSchemaRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty) out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, Collections_SetSchema_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Collections_SetSchema_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -108,8 +113,9 @@ func (c *collectionsClient) SetSchema(ctx context.Context, in *SetSchemaRequest, ...@@ -108,8 +113,9 @@ func (c *collectionsClient) SetSchema(ctx context.Context, in *SetSchemaRequest,
} }
func (c *collectionsClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { func (c *collectionsClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty) out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, Collections_Delete_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Collections_Delete_FullMethodName, in, out, cOpts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -118,7 +124,7 @@ func (c *collectionsClient) Delete(ctx context.Context, in *DeleteRequest, opts ...@@ -118,7 +124,7 @@ func (c *collectionsClient) Delete(ctx context.Context, in *DeleteRequest, opts
// CollectionsServer is the server API for Collections service. // CollectionsServer is the server API for Collections service.
// All implementations must embed UnimplementedCollectionsServer // All implementations must embed UnimplementedCollectionsServer
// for forward compatibility // for forward compatibility.
type CollectionsServer interface { type CollectionsServer interface {
// Создать коллекцию. Установка схемы производится через отдельный метод `SetSchema` и методом `Create` игнорируется // Создать коллекцию. Установка схемы производится через отдельный метод `SetSchema` и методом `Create` игнорируется
Create(context.Context, *CreateRequest) (*CreateResponse, error) Create(context.Context, *CreateRequest) (*CreateResponse, error)
...@@ -143,9 +149,12 @@ type CollectionsServer interface { ...@@ -143,9 +149,12 @@ type CollectionsServer interface {
mustEmbedUnimplementedCollectionsServer() mustEmbedUnimplementedCollectionsServer()
} }
// UnimplementedCollectionsServer must be embedded to have forward compatible implementations. // UnimplementedCollectionsServer must be embedded to have
type UnimplementedCollectionsServer struct { // forward compatible implementations.
} //
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedCollectionsServer struct{}
func (UnimplementedCollectionsServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { func (UnimplementedCollectionsServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
...@@ -166,6 +175,7 @@ func (UnimplementedCollectionsServer) Delete(context.Context, *DeleteRequest) (* ...@@ -166,6 +175,7 @@ func (UnimplementedCollectionsServer) Delete(context.Context, *DeleteRequest) (*
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
} }
func (UnimplementedCollectionsServer) mustEmbedUnimplementedCollectionsServer() {} func (UnimplementedCollectionsServer) mustEmbedUnimplementedCollectionsServer() {}
func (UnimplementedCollectionsServer) testEmbeddedByValue() {}
// UnsafeCollectionsServer may be embedded to opt out of forward compatibility for this service. // UnsafeCollectionsServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CollectionsServer will // Use of this interface is not recommended, as added methods to CollectionsServer will
...@@ -175,6 +185,13 @@ type UnsafeCollectionsServer interface { ...@@ -175,6 +185,13 @@ type UnsafeCollectionsServer interface {
} }
func RegisterCollectionsServer(s grpc.ServiceRegistrar, srv CollectionsServer) { func RegisterCollectionsServer(s grpc.ServiceRegistrar, srv CollectionsServer) {
// If the following call pancis, it indicates UnimplementedCollectionsServer 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(&Collections_ServiceDesc, srv) s.RegisterService(&Collections_ServiceDesc, srv)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment