From 81e8fcb2bd51b0ccf162ceea8514a6dfe228a617 Mon Sep 17 00:00:00 2001 From: ko_oler <kooler89@gmail.com> Date: Sun, 21 May 2023 16:49:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B3=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D1=8B=20=D0=BC=D0=BE=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B8=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D1=8B=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=8F=20PublishedAt/By,?= =?UTF-8?q?=20ArchivedAt/By=20=D0=B8=D0=B7=20Item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/items/item.go | 24 ------ pkg/items/mocks/ItemObserver.go | 2 +- pkg/items/mocks/ItemReadObserver.go | 14 +++- pkg/items/mocks/Items.go | 65 +++++++++++---- pkg/items/mocks/Middleware.go | 2 +- pkg/items/mocks/PreSaver.go | 9 +- pkg/items/mocks/ProcessDataFunc.go | 7 +- pkg/items/mocks/Storage.go | 48 ++++++++--- proto/items/items.pb.go | 24 +++--- proto/items/items_grpc.pb.go | 125 +++++++++++++++++----------- 10 files changed, 197 insertions(+), 123 deletions(-) diff --git a/pkg/items/item.go b/pkg/items/item.go index fc3a5154..4c74d121 100644 --- a/pkg/items/item.go +++ b/pkg/items/item.go @@ -104,10 +104,6 @@ type Item struct { Locale string `json:"locale" bson:"-"` Translations map[string]map[string]interface{} `json:"translations" bson:"translations,omitempty"` RevisionID string `json:"revId,omitempty" bson:"revision_id"` - PublishedAt time.Time `json:"publishedAt,omitempty" bson:"published_at,omitempty"` - PublishedBy string `json:"publishedBy,omitempty" bson:"published_by,omitempty"` - ArchivedAt time.Time `json:"archivedAt,omitempty" bson:"archived_at,omitempty"` - ArchivedBy string `json:"archivedBy,omitempty" bson:"archived_by,omitempty"` Permissions *Permissions `json:"permissions,omitempty" bson:"-"` // Флаги записи @@ -154,10 +150,6 @@ func (i *Item) ToMap() map[string]interface{} { "updated_at": i.UpdatedAt, "updated_by": i.UpdatedBy, "revision_id": i.RevisionID, - "published_at": i.PublishedAt, - "published_by": i.PublishedBy, - "archived_at": i.ArchivedAt, - "archived_by": i.ArchivedBy, "data": i.Data, "translations": i.Translations, "locale": i.Locale, @@ -316,10 +308,6 @@ func (i *Item) SetSystemField(field string, value interface{}) error { i.UpdatedAt, ok = value.(time.Time) case "revision_id": i.RevisionID, ok = value.(string) - case "published_by": - i.PublishedBy, ok = value.(string) - case "published_at": - i.PublishedAt, ok = value.(time.Time) case "hidden": i.Hidden, ok = value.(bool) case "deleted": @@ -360,10 +348,6 @@ func (i *Item) GetSystem(field string) (any, error) { return i.UpdatedAt, nil case "revision_id": return i.RevisionID, nil - case "published_by": - return i.PublishedBy, nil - case "published_at": - return i.PublishedAt, nil case "hidden": return i.Hidden, nil case "deleted": @@ -467,8 +451,6 @@ func ItemToProto(item *Item) *pb.Item { CreatedBy: item.CreatedBy, UpdatedBy: item.UpdatedBy, RevisionId: item.RevisionID, - PublishedBy: item.PublishedBy, - ArchivedBy: item.ArchivedBy, Locale: item.Locale, Hidden: item.Hidden, Template: item.Template, @@ -486,8 +468,6 @@ func ItemToProto(item *Item) *pb.Item { } protoItem.CreatedRevAt = timestamppb.New(item.CreatedRevAt) - protoItem.PublishedAt = timestamppb.New(item.PublishedAt) - protoItem.ArchivedAt = timestamppb.New(item.ArchivedAt) protoItem.CreatedAt = timestamppb.New(item.CreatedAt) protoItem.UpdatedAt = timestamppb.New(item.UpdatedAt) @@ -519,8 +499,6 @@ func ItemFromProto(protoItem *pb.Item) *Item { CreatedBy: protoItem.CreatedBy, UpdatedBy: protoItem.UpdatedBy, RevisionID: protoItem.RevisionId, - PublishedBy: protoItem.PublishedBy, - ArchivedBy: protoItem.ArchivedBy, Locale: protoItem.Locale, Hidden: protoItem.Hidden, Template: protoItem.Template, @@ -549,8 +527,6 @@ func ItemFromProto(protoItem *pb.Item) *Item { } item.CreatedRevAt = protoItem.CreatedRevAt.AsTime() - item.PublishedAt = protoItem.PublishedAt.AsTime() - item.ArchivedAt = protoItem.ArchivedAt.AsTime() item.CreatedAt = protoItem.CreatedAt.AsTime() item.UpdatedAt = protoItem.UpdatedAt.AsTime() diff --git a/pkg/items/mocks/ItemObserver.go b/pkg/items/mocks/ItemObserver.go index a72fb9b5..c4b4954c 100644 --- a/pkg/items/mocks/ItemObserver.go +++ b/pkg/items/mocks/ItemObserver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.15.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks diff --git a/pkg/items/mocks/ItemReadObserver.go b/pkg/items/mocks/ItemReadObserver.go index b14c8aaf..cdbc43d4 100644 --- a/pkg/items/mocks/ItemReadObserver.go +++ b/pkg/items/mocks/ItemReadObserver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.15.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks @@ -19,6 +19,11 @@ func (_m *ItemReadObserver) OnPostFind(ctx context.Context, _a1 []*items.Item, t ret := _m.Called(ctx, _a1, total) var r0 []*items.Item + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, []*items.Item, int) ([]*items.Item, int, error)); ok { + return rf(ctx, _a1, total) + } if rf, ok := ret.Get(0).(func(context.Context, []*items.Item, int) []*items.Item); ok { r0 = rf(ctx, _a1, total) } else { @@ -27,14 +32,12 @@ func (_m *ItemReadObserver) OnPostFind(ctx context.Context, _a1 []*items.Item, t } } - var r1 int if rf, ok := ret.Get(1).(func(context.Context, []*items.Item, int) int); ok { r1 = rf(ctx, _a1, total) } else { r1 = ret.Get(1).(int) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, []*items.Item, int) error); ok { r2 = rf(ctx, _a1, total) } else { @@ -49,6 +52,10 @@ func (_m *ItemReadObserver) OnPostGet(ctx context.Context, item *items.Item) (*i ret := _m.Called(ctx, item) var r0 *items.Item + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *items.Item) (*items.Item, error)); ok { + return rf(ctx, item) + } if rf, ok := ret.Get(0).(func(context.Context, *items.Item) *items.Item); ok { r0 = rf(ctx, item) } else { @@ -57,7 +64,6 @@ func (_m *ItemReadObserver) OnPostGet(ctx context.Context, item *items.Item) (*i } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *items.Item) error); ok { r1 = rf(ctx, item) } else { diff --git a/pkg/items/mocks/Items.go b/pkg/items/mocks/Items.go index 6ecfdeaa..1f6833ff 100644 --- a/pkg/items/mocks/Items.go +++ b/pkg/items/mocks/Items.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.15.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks @@ -28,6 +28,10 @@ func (_m *Items) Aggregate(ctx context.Context, spaceId string, envId string, co ret := _m.Called(_ca...) var r0 map[string]interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregateOptions) (map[string]interface{}, error)); ok { + return rf(ctx, spaceId, envId, collectionId, filter, options...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregateOptions) map[string]interface{}); ok { r0 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { @@ -36,7 +40,6 @@ func (_m *Items) Aggregate(ctx context.Context, spaceId string, envId string, co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregateOptions) error); ok { r1 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { @@ -58,6 +61,10 @@ func (_m *Items) AggregatePublished(ctx context.Context, spaceId string, envId s ret := _m.Called(_ca...) var r0 map[string]interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregatePublishedOptions) (map[string]interface{}, error)); ok { + return rf(ctx, spaceId, envId, collectionId, filter, options...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregatePublishedOptions) map[string]interface{}); ok { r0 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { @@ -66,7 +73,6 @@ func (_m *Items) AggregatePublished(ctx context.Context, spaceId string, envId s } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *items.Filter, ...*items.AggregatePublishedOptions) error); ok { r1 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { @@ -109,6 +115,10 @@ func (_m *Items) Create(ctx context.Context, item *items.Item, opts ...*items.Cr ret := _m.Called(_ca...) var r0 *items.Item + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *items.Item, ...*items.CreateOptions) (*items.Item, error)); ok { + return rf(ctx, item, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *items.Item, ...*items.CreateOptions) *items.Item); ok { r0 = rf(ctx, item, opts...) } else { @@ -117,7 +127,6 @@ func (_m *Items) Create(ctx context.Context, item *items.Item, opts ...*items.Cr } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *items.Item, ...*items.CreateOptions) error); ok { r1 = rf(ctx, item, opts...) } else { @@ -160,6 +169,11 @@ func (_m *Items) Find(ctx context.Context, spaceId string, envId string, collect ret := _m.Called(_ca...) var r0 []*items.Item + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.FindOptions) ([]*items.Item, int, error)); ok { + return rf(ctx, spaceId, envId, collectionId, filter, options...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.FindOptions) []*items.Item); ok { r0 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { @@ -168,14 +182,12 @@ func (_m *Items) Find(ctx context.Context, spaceId string, envId string, collect } } - var r1 int if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *items.Filter, ...*items.FindOptions) int); ok { r1 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { r1 = ret.Get(1).(int) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, string, string, string, *items.Filter, ...*items.FindOptions) error); ok { r2 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { @@ -197,6 +209,11 @@ func (_m *Items) FindArchived(ctx context.Context, spaceId string, envId string, ret := _m.Called(_ca...) var r0 []*items.Item + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.FindArchivedOptions) ([]*items.Item, int, error)); ok { + return rf(ctx, spaceId, envId, collectionId, filter, options...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.FindArchivedOptions) []*items.Item); ok { r0 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { @@ -205,14 +222,12 @@ func (_m *Items) FindArchived(ctx context.Context, spaceId string, envId string, } } - var r1 int if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *items.Filter, ...*items.FindArchivedOptions) int); ok { r1 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { r1 = ret.Get(1).(int) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, string, string, string, *items.Filter, ...*items.FindArchivedOptions) error); ok { r2 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { @@ -234,6 +249,11 @@ func (_m *Items) FindPublished(ctx context.Context, spaceId string, envId string ret := _m.Called(_ca...) var r0 []*items.Item + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) ([]*items.Item, int, error)); ok { + return rf(ctx, spaceId, envId, collectionId, filter, options...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) []*items.Item); ok { r0 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { @@ -242,14 +262,12 @@ func (_m *Items) FindPublished(ctx context.Context, spaceId string, envId string } } - var r1 int if rf, ok := ret.Get(1).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) int); ok { r1 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { r1 = ret.Get(1).(int) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, string, string, string, *items.Filter, ...*items.FindPublishedOptions) error); ok { r2 = rf(ctx, spaceId, envId, collectionId, filter, options...) } else { @@ -271,6 +289,10 @@ func (_m *Items) Get(ctx context.Context, spaceId string, envId string, collecti ret := _m.Called(_ca...) var r0 *items.Item + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetOptions) (*items.Item, error)); ok { + return rf(ctx, spaceId, envId, collectionId, itemId, options...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetOptions) *items.Item); ok { r0 = rf(ctx, spaceId, envId, collectionId, itemId, options...) } else { @@ -279,7 +301,6 @@ func (_m *Items) Get(ctx context.Context, spaceId string, envId string, collecti } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, ...*items.GetOptions) error); ok { r1 = rf(ctx, spaceId, envId, collectionId, itemId, options...) } else { @@ -301,6 +322,10 @@ func (_m *Items) GetPublished(ctx context.Context, spaceId string, envId string, ret := _m.Called(_ca...) var r0 *items.Item + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) (*items.Item, error)); ok { + return rf(ctx, spaceId, envId, collectionId, itemId, options...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) *items.Item); ok { r0 = rf(ctx, spaceId, envId, collectionId, itemId, options...) } else { @@ -309,7 +334,6 @@ func (_m *Items) GetPublished(ctx context.Context, spaceId string, envId string, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, ...*items.GetPublishedOptions) error); ok { r1 = rf(ctx, spaceId, envId, collectionId, itemId, options...) } else { @@ -331,6 +355,10 @@ func (_m *Items) GetRevision(ctx context.Context, spaceId string, envId string, ret := _m.Called(_ca...) var r0 *items.Item + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string, ...*items.GetRevisionOptions) (*items.Item, error)); ok { + return rf(ctx, spaceId, envId, collectionId, itemId, revisionId, options...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string, ...*items.GetRevisionOptions) *items.Item); ok { r0 = rf(ctx, spaceId, envId, collectionId, itemId, revisionId, options...) } else { @@ -339,7 +367,6 @@ func (_m *Items) GetRevision(ctx context.Context, spaceId string, envId string, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, string, ...*items.GetRevisionOptions) error); ok { r1 = rf(ctx, spaceId, envId, collectionId, itemId, revisionId, options...) } else { @@ -361,6 +388,11 @@ func (_m *Items) Introspect(ctx context.Context, item *items.Item, opts ...*item ret := _m.Called(_ca...) var r0 *items.Item + var r1 *schema.Schema + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *items.Item, ...*items.IntrospectOptions) (*items.Item, *schema.Schema, error)); ok { + return rf(ctx, item, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *items.Item, ...*items.IntrospectOptions) *items.Item); ok { r0 = rf(ctx, item, opts...) } else { @@ -369,7 +401,6 @@ func (_m *Items) Introspect(ctx context.Context, item *items.Item, opts ...*item } } - var r1 *schema.Schema if rf, ok := ret.Get(1).(func(context.Context, *items.Item, ...*items.IntrospectOptions) *schema.Schema); ok { r1 = rf(ctx, item, opts...) } else { @@ -378,7 +409,6 @@ func (_m *Items) Introspect(ctx context.Context, item *items.Item, opts ...*item } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *items.Item, ...*items.IntrospectOptions) error); ok { r2 = rf(ctx, item, opts...) } else { @@ -400,6 +430,10 @@ func (_m *Items) ListRevisions(ctx context.Context, spaceId string, envId string ret := _m.Called(_ca...) var r0 []*items.Item + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.ListRevisionsOptions) ([]*items.Item, error)); ok { + return rf(ctx, spaceId, envId, collectionId, itemId, options...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, ...*items.ListRevisionsOptions) []*items.Item); ok { r0 = rf(ctx, spaceId, envId, collectionId, itemId, options...) } else { @@ -408,7 +442,6 @@ func (_m *Items) ListRevisions(ctx context.Context, spaceId string, envId string } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, ...*items.ListRevisionsOptions) error); ok { r1 = rf(ctx, spaceId, envId, collectionId, itemId, options...) } else { diff --git a/pkg/items/mocks/Middleware.go b/pkg/items/mocks/Middleware.go index 7830ca74..89adb974 100644 --- a/pkg/items/mocks/Middleware.go +++ b/pkg/items/mocks/Middleware.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.15.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks diff --git a/pkg/items/mocks/PreSaver.go b/pkg/items/mocks/PreSaver.go index 2a78120e..eb4e0cc2 100644 --- a/pkg/items/mocks/PreSaver.go +++ b/pkg/items/mocks/PreSaver.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.15.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks @@ -21,6 +21,11 @@ func (_m *PreSaver) PreSave(ctx context.Context, f *field.Field, v interface{}, ret := _m.Called(ctx, f, v, itemCtx) var r0 interface{} + var r1 bool + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *field.Field, interface{}, *items.Context) (interface{}, bool, error)); ok { + return rf(ctx, f, v, itemCtx) + } if rf, ok := ret.Get(0).(func(context.Context, *field.Field, interface{}, *items.Context) interface{}); ok { r0 = rf(ctx, f, v, itemCtx) } else { @@ -29,14 +34,12 @@ func (_m *PreSaver) PreSave(ctx context.Context, f *field.Field, v interface{}, } } - var r1 bool if rf, ok := ret.Get(1).(func(context.Context, *field.Field, interface{}, *items.Context) bool); ok { r1 = rf(ctx, f, v, itemCtx) } else { r1 = ret.Get(1).(bool) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *field.Field, interface{}, *items.Context) error); ok { r2 = rf(ctx, f, v, itemCtx) } else { diff --git a/pkg/items/mocks/ProcessDataFunc.go b/pkg/items/mocks/ProcessDataFunc.go index 5aa99801..cb04ca90 100644 --- a/pkg/items/mocks/ProcessDataFunc.go +++ b/pkg/items/mocks/ProcessDataFunc.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.15.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks @@ -20,6 +20,10 @@ func (_m *ProcessDataFunc) Execute(ctx context.Context, sch *schema.Schema, data ret := _m.Called(ctx, sch, data) var r0 map[string]interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *schema.Schema, map[string]interface{}) (map[string]interface{}, error)); ok { + return rf(ctx, sch, data) + } if rf, ok := ret.Get(0).(func(context.Context, *schema.Schema, map[string]interface{}) map[string]interface{}); ok { r0 = rf(ctx, sch, data) } else { @@ -28,7 +32,6 @@ func (_m *ProcessDataFunc) Execute(ctx context.Context, sch *schema.Schema, data } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *schema.Schema, map[string]interface{}) error); ok { r1 = rf(ctx, sch, data) } else { diff --git a/pkg/items/mocks/Storage.go b/pkg/items/mocks/Storage.go index 9c502969..5630fc8b 100644 --- a/pkg/items/mocks/Storage.go +++ b/pkg/items/mocks/Storage.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.15.0. DO NOT EDIT. +// Code generated by mockery v2.27.1. DO NOT EDIT. package mocks @@ -29,6 +29,10 @@ func (_m *Storage) Aggregate(ctx context.Context, coll *collections.Collection, ret := _m.Called(_ca...) var r0 map[string]interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Filter, ...*items.AggregateOptions) (map[string]interface{}, error)); ok { + return rf(ctx, coll, filter, options...) + } if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Filter, ...*items.AggregateOptions) map[string]interface{}); ok { r0 = rf(ctx, coll, filter, options...) } else { @@ -37,7 +41,6 @@ func (_m *Storage) Aggregate(ctx context.Context, coll *collections.Collection, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, *items.Filter, ...*items.AggregateOptions) error); ok { r1 = rf(ctx, coll, filter, options...) } else { @@ -59,6 +62,10 @@ func (_m *Storage) AggregatePublished(ctx context.Context, coll *collections.Col ret := _m.Called(_ca...) var r0 map[string]interface{} + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Filter, ...*items.AggregatePublishedOptions) (map[string]interface{}, error)); ok { + return rf(ctx, coll, filter, options...) + } if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Filter, ...*items.AggregatePublishedOptions) map[string]interface{}); ok { r0 = rf(ctx, coll, filter, options...) } else { @@ -67,7 +74,6 @@ func (_m *Storage) AggregatePublished(ctx context.Context, coll *collections.Col } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, *items.Filter, ...*items.AggregatePublishedOptions) error); ok { r1 = rf(ctx, coll, filter, options...) } else { @@ -145,6 +151,10 @@ func (_m *Storage) Create(ctx context.Context, coll *collections.Collection, ite ret := _m.Called(_ca...) var r0 *items.Item + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Item, ...*items.CreateOptions) (*items.Item, error)); ok { + return rf(ctx, coll, item, options...) + } if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Item, ...*items.CreateOptions) *items.Item); ok { r0 = rf(ctx, coll, item, options...) } else { @@ -153,7 +163,6 @@ func (_m *Storage) Create(ctx context.Context, coll *collections.Collection, ite } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, *items.Item, ...*items.CreateOptions) error); ok { r1 = rf(ctx, coll, item, options...) } else { @@ -189,6 +198,11 @@ func (_m *Storage) Find(ctx context.Context, coll *collections.Collection, filte ret := _m.Called(_ca...) var r0 []*items.Item + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindOptions) ([]*items.Item, int, error)); ok { + return rf(ctx, coll, filter, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindOptions) []*items.Item); ok { r0 = rf(ctx, coll, filter, opts...) } else { @@ -197,14 +211,12 @@ func (_m *Storage) Find(ctx context.Context, coll *collections.Collection, filte } } - var r1 int if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindOptions) int); ok { r1 = rf(ctx, coll, filter, opts...) } else { r1 = ret.Get(1).(int) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindOptions) error); ok { r2 = rf(ctx, coll, filter, opts...) } else { @@ -226,6 +238,11 @@ func (_m *Storage) FindArchived(ctx context.Context, coll *collections.Collectio ret := _m.Called(_ca...) var r0 []*items.Item + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindArchivedOptions) ([]*items.Item, int, error)); ok { + return rf(ctx, coll, filter, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindArchivedOptions) []*items.Item); ok { r0 = rf(ctx, coll, filter, opts...) } else { @@ -234,14 +251,12 @@ func (_m *Storage) FindArchived(ctx context.Context, coll *collections.Collectio } } - var r1 int if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindArchivedOptions) int); ok { r1 = rf(ctx, coll, filter, opts...) } else { r1 = ret.Get(1).(int) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindArchivedOptions) error); ok { r2 = rf(ctx, coll, filter, opts...) } else { @@ -263,6 +278,11 @@ func (_m *Storage) FindPublished(ctx context.Context, coll *collections.Collecti ret := _m.Called(_ca...) var r0 []*items.Item + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindPublishedOptions) ([]*items.Item, int, error)); ok { + return rf(ctx, coll, filter, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindPublishedOptions) []*items.Item); ok { r0 = rf(ctx, coll, filter, opts...) } else { @@ -271,14 +291,12 @@ func (_m *Storage) FindPublished(ctx context.Context, coll *collections.Collecti } } - var r1 int if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindPublishedOptions) int); ok { r1 = rf(ctx, coll, filter, opts...) } else { r1 = ret.Get(1).(int) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, *collections.Collection, *items.Filter, ...*items.FindPublishedOptions) error); ok { r2 = rf(ctx, coll, filter, opts...) } else { @@ -300,6 +318,10 @@ func (_m *Storage) GetRevision(ctx context.Context, coll *collections.Collection ret := _m.Called(_ca...) var r0 *items.Item + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, string, string, ...*items.GetRevisionOptions) (*items.Item, error)); ok { + return rf(ctx, coll, itemId, revisionId, options...) + } if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, string, string, ...*items.GetRevisionOptions) *items.Item); ok { r0 = rf(ctx, coll, itemId, revisionId, options...) } else { @@ -308,7 +330,6 @@ func (_m *Storage) GetRevision(ctx context.Context, coll *collections.Collection } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, string, string, ...*items.GetRevisionOptions) error); ok { r1 = rf(ctx, coll, itemId, revisionId, options...) } else { @@ -344,6 +365,10 @@ func (_m *Storage) ListRevisions(ctx context.Context, coll *collections.Collecti ret := _m.Called(_ca...) var r0 []*items.Item + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, string, ...*items.ListRevisionsOptions) ([]*items.Item, error)); ok { + return rf(ctx, coll, itemId, options...) + } if rf, ok := ret.Get(0).(func(context.Context, *collections.Collection, string, ...*items.ListRevisionsOptions) []*items.Item); ok { r0 = rf(ctx, coll, itemId, options...) } else { @@ -352,7 +377,6 @@ func (_m *Storage) ListRevisions(ctx context.Context, coll *collections.Collecti } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *collections.Collection, string, ...*items.ListRevisionsOptions) error); ok { r1 = rf(ctx, coll, itemId, options...) } else { diff --git a/proto/items/items.pb.go b/proto/items/items.pb.go index 161f7772..b0c145cc 100644 --- a/proto/items/items.pb.go +++ b/proto/items/items.pb.go @@ -8,7 +8,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.29.0 +// protoc-gen-go v1.30.0 // protoc v3.21.12 // source: items/items.proto @@ -359,7 +359,7 @@ func (x *Permissions) GetHardDelete() bool { return false } -//* +// * // Пользовательская запись type Item struct { state protoimpl.MessageState @@ -999,7 +999,7 @@ type CreateOptions struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` + UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` // позволяет обновить системные поля: created_by, created_at, created_rev_at, updated_by, updated_at } func (x *CreateOptions) Reset() { @@ -1125,7 +1125,7 @@ type UpdateOptions struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` + UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` // позволяет обновить системные поля: created_by, created_at, created_rev_at, updated_by, updated_at } func (x *UpdateOptions) Reset() { @@ -1219,8 +1219,8 @@ type DeleteOptions struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` - Erase bool `protobuf:"varint,2,opt,name=erase,proto3" json:"erase,omitempty"` + UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` // позволяет обновить системные поля: created_by, created_at, created_rev_at, updated_by, updated_at + Erase bool `protobuf:"varint,2,opt,name=erase,proto3" json:"erase,omitempty"` // полное удаление без сохранения удаленной версии объекта } func (x *DeleteOptions) Reset() { @@ -1274,7 +1274,7 @@ type UndeleteOptions struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` + UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` // позволяет обновить системные поля: created_by, created_at, created_rev_at, updated_by, updated_at } func (x *UndeleteOptions) Reset() { @@ -1321,7 +1321,7 @@ type PublishOptions struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` + UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` // позволяет обновить системные поля: created_by, created_at, created_rev_at, updated_by, updated_at } func (x *PublishOptions) Reset() { @@ -1368,7 +1368,7 @@ type UnpublishOptions struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` + UpdateAttrs bool `protobuf:"varint,1,opt,name=update_attrs,json=updateAttrs,proto3" json:"update_attrs,omitempty"` // позволяет обновить системные поля: created_by, created_at, created_rev_at, updated_by, updated_at } func (x *UnpublishOptions) Reset() { @@ -2212,7 +2212,7 @@ type DeleteRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Item *Item `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` + Item *Item `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` // важны только переданные внутри идентификаторы или, если указана опция update_attrs, поля которые изменяются: created_by, created_at, created_rev_at, updated_by, updated_at Options *DeleteOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` } @@ -2766,7 +2766,7 @@ func (x *AggregateRequest) GetOptions() *AggregateOptions { return nil } -//* +// * // Содержит в себе набор `название:значение`. Название соответствует переданному в AggregateOptions ключу. type AggregateResponse struct { state protoimpl.MessageState @@ -3193,7 +3193,7 @@ func (x *ListRevisionsResponse) GetItems() []*Item { return nil } -//* +// * // Запрос на архивирование элемента type ArchiveRequest struct { state protoimpl.MessageState diff --git a/proto/items/items_grpc.pb.go b/proto/items/items_grpc.pb.go index 08f6c91b..7c7d321a 100644 --- a/proto/items/items_grpc.pb.go +++ b/proto/items/items_grpc.pb.go @@ -1,3 +1,11 @@ +//* +// # Items +// +// API Сервиса работы с пользовательским записями (Items) +// +// Предоставляет доступ к записям пользовательских коллекций +// + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 @@ -19,20 +27,41 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Items_Create_FullMethodName = "/content.items.Items/Create" + Items_Introspect_FullMethodName = "/content.items.Items/Introspect" + Items_Get_FullMethodName = "/content.items.Items/Get" + Items_Find_FullMethodName = "/content.items.Items/Find" + Items_Update_FullMethodName = "/content.items.Items/Update" + Items_Delete_FullMethodName = "/content.items.Items/Delete" + Items_Undelete_FullMethodName = "/content.items.Items/Undelete" + Items_Publish_FullMethodName = "/content.items.Items/Publish" + Items_Unpublish_FullMethodName = "/content.items.Items/Unpublish" + Items_GetPublished_FullMethodName = "/content.items.Items/GetPublished" + Items_FindPublished_FullMethodName = "/content.items.Items/FindPublished" + Items_Aggregate_FullMethodName = "/content.items.Items/Aggregate" + Items_AggregatePublished_FullMethodName = "/content.items.Items/AggregatePublished" + Items_GetRevision_FullMethodName = "/content.items.Items/GetRevision" + Items_ListRevisions_FullMethodName = "/content.items.Items/ListRevisions" + Items_Archive_FullMethodName = "/content.items.Items/Archive" + Items_FindArchived_FullMethodName = "/content.items.Items/FindArchived" + Items_Unarchive_FullMethodName = "/content.items.Items/Unarchive" +) + // ItemsClient is the client API for Items 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 ItemsClient interface { - //* + // * // Создать запись Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) - //* + // * // Валидация данных записи Introspect(ctx context.Context, in *IntrospectRequest, opts ...grpc.CallOption) (*IntrospectResponse, error) - //* + // * // Получение записи по идентификатору Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) - //* + // * // Поиск по текущим записям Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (*FindResponse, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) @@ -42,10 +71,10 @@ type ItemsClient interface { Unpublish(ctx context.Context, in *UnpublishRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) GetPublished(ctx context.Context, in *GetPublishedRequest, opts ...grpc.CallOption) (*GetPublishedResponse, error) FindPublished(ctx context.Context, in *FindPublishedRequest, opts ...grpc.CallOption) (*FindPublishedResponse, error) - //* + // * // Расчет значений по существующим данным. Например, получение среднего значения поля Aggregate(ctx context.Context, in *AggregateRequest, opts ...grpc.CallOption) (*AggregateResponse, error) - //* + // * // Расчет значений по существующим **опубликованным** данным. AggregatePublished(ctx context.Context, in *AggregatePublishedRequest, opts ...grpc.CallOption) (*AggregatePublishedResponse, error) GetRevision(ctx context.Context, in *GetRevisionRequest, opts ...grpc.CallOption) (*GetRevisionResponse, error) @@ -65,7 +94,7 @@ func NewItemsClient(cc grpc.ClientConnInterface) ItemsClient { func (c *itemsClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { out := new(CreateResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/Create", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Create_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -74,7 +103,7 @@ func (c *itemsClient) Create(ctx context.Context, in *CreateRequest, opts ...grp func (c *itemsClient) Introspect(ctx context.Context, in *IntrospectRequest, opts ...grpc.CallOption) (*IntrospectResponse, error) { out := new(IntrospectResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/Introspect", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Introspect_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -83,7 +112,7 @@ func (c *itemsClient) Introspect(ctx context.Context, in *IntrospectRequest, opt func (c *itemsClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { out := new(GetResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/Get", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Get_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -92,7 +121,7 @@ func (c *itemsClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.Call func (c *itemsClient) Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (*FindResponse, error) { out := new(FindResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/Find", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Find_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -101,7 +130,7 @@ func (c *itemsClient) Find(ctx context.Context, in *FindRequest, opts ...grpc.Ca func (c *itemsClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/content.items.Items/Update", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Update_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -110,7 +139,7 @@ func (c *itemsClient) Update(ctx context.Context, in *UpdateRequest, opts ...grp func (c *itemsClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/content.items.Items/Delete", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Delete_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -119,7 +148,7 @@ func (c *itemsClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grp func (c *itemsClient) Undelete(ctx context.Context, in *UndeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/content.items.Items/Undelete", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Undelete_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -128,7 +157,7 @@ func (c *itemsClient) Undelete(ctx context.Context, in *UndeleteRequest, opts .. func (c *itemsClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/content.items.Items/Publish", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Publish_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -137,7 +166,7 @@ func (c *itemsClient) Publish(ctx context.Context, in *PublishRequest, opts ...g func (c *itemsClient) Unpublish(ctx context.Context, in *UnpublishRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/content.items.Items/Unpublish", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Unpublish_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -146,7 +175,7 @@ func (c *itemsClient) Unpublish(ctx context.Context, in *UnpublishRequest, opts func (c *itemsClient) GetPublished(ctx context.Context, in *GetPublishedRequest, opts ...grpc.CallOption) (*GetPublishedResponse, error) { out := new(GetPublishedResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/GetPublished", in, out, opts...) + err := c.cc.Invoke(ctx, Items_GetPublished_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -155,7 +184,7 @@ func (c *itemsClient) GetPublished(ctx context.Context, in *GetPublishedRequest, func (c *itemsClient) FindPublished(ctx context.Context, in *FindPublishedRequest, opts ...grpc.CallOption) (*FindPublishedResponse, error) { out := new(FindPublishedResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/FindPublished", in, out, opts...) + err := c.cc.Invoke(ctx, Items_FindPublished_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -164,7 +193,7 @@ func (c *itemsClient) FindPublished(ctx context.Context, in *FindPublishedReques func (c *itemsClient) Aggregate(ctx context.Context, in *AggregateRequest, opts ...grpc.CallOption) (*AggregateResponse, error) { out := new(AggregateResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/Aggregate", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Aggregate_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -173,7 +202,7 @@ func (c *itemsClient) Aggregate(ctx context.Context, in *AggregateRequest, opts func (c *itemsClient) AggregatePublished(ctx context.Context, in *AggregatePublishedRequest, opts ...grpc.CallOption) (*AggregatePublishedResponse, error) { out := new(AggregatePublishedResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/AggregatePublished", in, out, opts...) + err := c.cc.Invoke(ctx, Items_AggregatePublished_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -182,7 +211,7 @@ func (c *itemsClient) AggregatePublished(ctx context.Context, in *AggregatePubli func (c *itemsClient) GetRevision(ctx context.Context, in *GetRevisionRequest, opts ...grpc.CallOption) (*GetRevisionResponse, error) { out := new(GetRevisionResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/GetRevision", in, out, opts...) + err := c.cc.Invoke(ctx, Items_GetRevision_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -191,7 +220,7 @@ func (c *itemsClient) GetRevision(ctx context.Context, in *GetRevisionRequest, o func (c *itemsClient) ListRevisions(ctx context.Context, in *ListRevisionsRequest, opts ...grpc.CallOption) (*ListRevisionsResponse, error) { out := new(ListRevisionsResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/ListRevisions", in, out, opts...) + err := c.cc.Invoke(ctx, Items_ListRevisions_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -200,7 +229,7 @@ func (c *itemsClient) ListRevisions(ctx context.Context, in *ListRevisionsReques func (c *itemsClient) Archive(ctx context.Context, in *ArchiveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/content.items.Items/Archive", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Archive_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -209,7 +238,7 @@ func (c *itemsClient) Archive(ctx context.Context, in *ArchiveRequest, opts ...g func (c *itemsClient) FindArchived(ctx context.Context, in *FindArchivedRequest, opts ...grpc.CallOption) (*FindArchivedResponse, error) { out := new(FindArchivedResponse) - err := c.cc.Invoke(ctx, "/content.items.Items/FindArchived", in, out, opts...) + err := c.cc.Invoke(ctx, Items_FindArchived_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -218,7 +247,7 @@ func (c *itemsClient) FindArchived(ctx context.Context, in *FindArchivedRequest, func (c *itemsClient) Unarchive(ctx context.Context, in *UnarchiveRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/content.items.Items/Unarchive", in, out, opts...) + err := c.cc.Invoke(ctx, Items_Unarchive_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -229,16 +258,16 @@ func (c *itemsClient) Unarchive(ctx context.Context, in *UnarchiveRequest, opts // All implementations must embed UnimplementedItemsServer // for forward compatibility type ItemsServer interface { - //* + // * // Создать запись Create(context.Context, *CreateRequest) (*CreateResponse, error) - //* + // * // Валидация данных записи Introspect(context.Context, *IntrospectRequest) (*IntrospectResponse, error) - //* + // * // Получение записи по идентификатору Get(context.Context, *GetRequest) (*GetResponse, error) - //* + // * // Поиск по текущим записям Find(context.Context, *FindRequest) (*FindResponse, error) Update(context.Context, *UpdateRequest) (*emptypb.Empty, error) @@ -248,10 +277,10 @@ type ItemsServer interface { Unpublish(context.Context, *UnpublishRequest) (*emptypb.Empty, error) GetPublished(context.Context, *GetPublishedRequest) (*GetPublishedResponse, error) FindPublished(context.Context, *FindPublishedRequest) (*FindPublishedResponse, error) - //* + // * // Расчет значений по существующим данным. Например, получение среднего значения поля Aggregate(context.Context, *AggregateRequest) (*AggregateResponse, error) - //* + // * // Расчет значений по существующим **опубликованным** данным. AggregatePublished(context.Context, *AggregatePublishedRequest) (*AggregatePublishedResponse, error) GetRevision(context.Context, *GetRevisionRequest) (*GetRevisionResponse, error) @@ -343,7 +372,7 @@ func _Items_Create_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Create", + FullMethod: Items_Create_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Create(ctx, req.(*CreateRequest)) @@ -361,7 +390,7 @@ func _Items_Introspect_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Introspect", + FullMethod: Items_Introspect_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Introspect(ctx, req.(*IntrospectRequest)) @@ -379,7 +408,7 @@ func _Items_Get_Handler(srv interface{}, ctx context.Context, dec func(interface } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Get", + FullMethod: Items_Get_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Get(ctx, req.(*GetRequest)) @@ -397,7 +426,7 @@ func _Items_Find_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Find", + FullMethod: Items_Find_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Find(ctx, req.(*FindRequest)) @@ -415,7 +444,7 @@ func _Items_Update_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Update", + FullMethod: Items_Update_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Update(ctx, req.(*UpdateRequest)) @@ -433,7 +462,7 @@ func _Items_Delete_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Delete", + FullMethod: Items_Delete_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Delete(ctx, req.(*DeleteRequest)) @@ -451,7 +480,7 @@ func _Items_Undelete_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Undelete", + FullMethod: Items_Undelete_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Undelete(ctx, req.(*UndeleteRequest)) @@ -469,7 +498,7 @@ func _Items_Publish_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Publish", + FullMethod: Items_Publish_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Publish(ctx, req.(*PublishRequest)) @@ -487,7 +516,7 @@ func _Items_Unpublish_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Unpublish", + FullMethod: Items_Unpublish_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Unpublish(ctx, req.(*UnpublishRequest)) @@ -505,7 +534,7 @@ func _Items_GetPublished_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/GetPublished", + FullMethod: Items_GetPublished_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).GetPublished(ctx, req.(*GetPublishedRequest)) @@ -523,7 +552,7 @@ func _Items_FindPublished_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/FindPublished", + FullMethod: Items_FindPublished_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).FindPublished(ctx, req.(*FindPublishedRequest)) @@ -541,7 +570,7 @@ func _Items_Aggregate_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Aggregate", + FullMethod: Items_Aggregate_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Aggregate(ctx, req.(*AggregateRequest)) @@ -559,7 +588,7 @@ func _Items_AggregatePublished_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/AggregatePublished", + FullMethod: Items_AggregatePublished_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).AggregatePublished(ctx, req.(*AggregatePublishedRequest)) @@ -577,7 +606,7 @@ func _Items_GetRevision_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/GetRevision", + FullMethod: Items_GetRevision_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).GetRevision(ctx, req.(*GetRevisionRequest)) @@ -595,7 +624,7 @@ func _Items_ListRevisions_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/ListRevisions", + FullMethod: Items_ListRevisions_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).ListRevisions(ctx, req.(*ListRevisionsRequest)) @@ -613,7 +642,7 @@ func _Items_Archive_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Archive", + FullMethod: Items_Archive_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Archive(ctx, req.(*ArchiveRequest)) @@ -631,7 +660,7 @@ func _Items_FindArchived_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/FindArchived", + FullMethod: Items_FindArchived_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).FindArchived(ctx, req.(*FindArchivedRequest)) @@ -649,7 +678,7 @@ func _Items_Unarchive_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/content.items.Items/Unarchive", + FullMethod: Items_Unarchive_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ItemsServer).Unarchive(ctx, req.(*UnarchiveRequest)) -- GitLab