Skip to content
Snippets Groups Projects
Commit 0dd516f1 authored by Anton Sattarov's avatar Anton Sattarov :cucumber:
Browse files

Merge branch 'feature/2763-RoleHiddenFlag' into 'master'

Перегенерирован клиент для collections после добавления поля "Скрыть" в Access

See merge request perxis/perxis-go!351
parents 7f5b2fed 86e152f1
No related branches found
No related tags found
No related merge requests found
Subproject commit d726595953e28a01e85401dc955dd9a7009ec3cc
Subproject commit 1e2543d67705f22a4553e04b4e37a7b9372f5cbc
......@@ -23,6 +23,7 @@ type Access struct {
HiddenFields []string // Поля не отображаемые в интерфейсе и не возвращаемые API
DenyReadFields []string // Поля недоступные для редактирования и не обновляемые через API
DenyWriteFields []string // Поля отображаемые в интерфейсе, но не возвращаемые в API
Hidden bool // Скрыть коллекцию в интерфейсе от пользователя
}
func (a Access) Clone() *Access {
......@@ -32,6 +33,7 @@ func (a Access) Clone() *Access {
HiddenFields: make([]string, len(a.HiddenFields)),
DenyReadFields: make([]string, len(a.DenyReadFields)),
DenyWriteFields: make([]string, len(a.DenyWriteFields)),
Hidden: a.Hidden,
}
copy(clone.Actions, a.Actions)
......
......@@ -59,6 +59,7 @@ func PtrCollectionToProto(coll *service.Collection) (*pb.Collection, error) {
WriteonlyFields: coll.Access.DenyWriteFields,
DenyReadFields: coll.Access.DenyReadFields,
DenyWriteFields: coll.Access.DenyWriteFields,
Hidden: coll.Access.Hidden,
}
}
protoCollection := &pb.Collection{
......@@ -122,6 +123,7 @@ func ProtoToPtrCollection(protoCollection *pb.Collection) (*service.Collection,
HiddenFields: protoCollection.Access.HiddenFields,
DenyReadFields: protoCollection.Access.DenyReadFields,
DenyWriteFields: protoCollection.Access.DenyWriteFields,
Hidden: protoCollection.Access.Hidden,
}
if len(access.DenyReadFields) == 0 {
access.DenyReadFields = protoCollection.Access.WriteonlyFields
......
This diff is collapsed.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.27.3
// - protoc-gen-go-grpc v1.3.0
// - protoc v5.28.1
// source: collections/collections.proto
package collections
......@@ -16,8 +16,8 @@ import (
// 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
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
Collections_Create_FullMethodName = "/content.collections.Collections/Create"
......@@ -63,9 +63,8 @@ func NewCollectionsClient(cc grpc.ClientConnInterface) CollectionsClient {
}
func (c *collectionsClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateResponse)
err := c.cc.Invoke(ctx, Collections_Create_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, Collections_Create_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
......@@ -73,9 +72,8 @@ func (c *collectionsClient) Create(ctx context.Context, in *CreateRequest, opts
}
func (c *collectionsClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetResponse)
err := c.cc.Invoke(ctx, Collections_Get_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, Collections_Get_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
......@@ -83,9 +81,8 @@ 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) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListResponse)
err := c.cc.Invoke(ctx, Collections_List_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, Collections_List_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
......@@ -93,9 +90,8 @@ 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) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, Collections_Update_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, Collections_Update_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
......@@ -103,9 +99,8 @@ 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) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, Collections_SetSchema_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, Collections_SetSchema_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
......@@ -113,9 +108,8 @@ func (c *collectionsClient) SetSchema(ctx context.Context, in *SetSchemaRequest,
}
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)
err := c.cc.Invoke(ctx, Collections_Delete_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, Collections_Delete_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
......@@ -124,7 +118,7 @@ func (c *collectionsClient) Delete(ctx context.Context, in *DeleteRequest, opts
// CollectionsServer is the server API for Collections service.
// All implementations must embed UnimplementedCollectionsServer
// for forward compatibility.
// for forward compatibility
type CollectionsServer interface {
// Создать коллекцию. Установка схемы производится через отдельный метод `SetSchema` и методом `Create` игнорируется
Create(context.Context, *CreateRequest) (*CreateResponse, error)
......@@ -149,12 +143,9 @@ type CollectionsServer interface {
mustEmbedUnimplementedCollectionsServer()
}
// UnimplementedCollectionsServer must 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 UnimplementedCollectionsServer struct{}
// UnimplementedCollectionsServer must be embedded to have forward compatible implementations.
type UnimplementedCollectionsServer struct {
}
func (UnimplementedCollectionsServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
......@@ -175,7 +166,6 @@ func (UnimplementedCollectionsServer) Delete(context.Context, *DeleteRequest) (*
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedCollectionsServer) mustEmbedUnimplementedCollectionsServer() {}
func (UnimplementedCollectionsServer) testEmbeddedByValue() {}
// 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
......@@ -185,13 +175,6 @@ type UnsafeCollectionsServer interface {
}
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)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment