Skip to content
Snippets Groups Projects
Commit f4915552 authored by ko_oler's avatar ko_oler
Browse files

Добавлены аннотации (google.api.http) в спецификацию сервиса "Items" для работы с Rest API

parent 0627c9f8
No related branches found
No related tags found
1 merge request!91Добавлены аннотации (google.api.http) в спецификацию сервиса "Items" для работы с Rest API
...@@ -13,6 +13,7 @@ import "common/common.proto"; ...@@ -13,6 +13,7 @@ import "common/common.proto";
import "common/error.proto"; import "common/error.proto";
import "google/protobuf/timestamp.proto"; import "google/protobuf/timestamp.proto";
import "google/protobuf/struct.proto"; import "google/protobuf/struct.proto";
import "google/api/annotations.proto";
option go_package = "git.perx.ru/perxis/perxis-go/proto/items;items"; option go_package = "git.perx.ru/perxis/perxis-go/proto/items;items";
...@@ -446,48 +447,138 @@ service Items { ...@@ -446,48 +447,138 @@ service Items {
/** /**
* Создать запись * Создать запись
*/ */
rpc Create(CreateRequest) returns(CreateResponse) {} rpc Create(CreateRequest) returns(CreateResponse) {
option (google.api.http) = {
post: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/create"
body: "item"
};
}
/** /**
* Валидация данных записи * Валидация данных записи
*/ */
rpc Introspect(IntrospectRequest) returns(IntrospectResponse) {} rpc Introspect(IntrospectRequest) returns(IntrospectResponse) {
option (google.api.http) = {
post: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/introspect"
body: "item"
};
}
/** /**
* Получение записи по идентификатору * Получение записи по идентификатору
*/ */
rpc Get(GetRequest) returns(GetResponse) {} rpc Get(GetRequest) returns(GetResponse) {
option (google.api.http) = {
get: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/{item_id}"
};
}
/** /**
* Поиск по текущим записям * Поиск по текущим записям
*/ */
rpc Find(FindRequest) returns(FindResponse) {} rpc Find(FindRequest) returns(FindResponse) {
rpc Update(UpdateRequest) returns(google.protobuf.Empty) {} option (google.api.http) = {
rpc Delete(DeleteRequest) returns(google.protobuf.Empty) {} get: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/find"
rpc Undelete(UndeleteRequest) returns(google.protobuf.Empty) {} };
}
rpc Publish(PublishRequest) returns(google.protobuf.Empty) {} rpc Update(UpdateRequest) returns(google.protobuf.Empty) {
rpc Unpublish(UnpublishRequest) returns(google.protobuf.Empty) {} option (google.api.http) = {
rpc GetPublished(GetPublishedRequest) returns(GetPublishedResponse) {} put: "/v1/content/spaces/{item.space_id}/environments/{item.env_id}/collections/{item.collection_id}/items/{item.id}"
rpc FindPublished(FindPublishedRequest) returns(FindPublishedResponse) {} body: "*"
rpc CheckoutRevision(CheckoutRevisionRequest) returns(CheckoutRevisionResponse) {} };
}
rpc Delete(DeleteRequest) returns(google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/content/spaces/{item.space_id}/environments/{item.env_id}/collections/{item.collection_id}/items/{item.id}/{options.update_attrs}/{options.erase}"
};
}
rpc Undelete(UndeleteRequest) returns(google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/content/spaces/{item.space_id}/environments/{item.env_id}/collections/{item.collection_id}/items/{item.id}/undelete"
body: "*"
};
}
rpc Publish(PublishRequest) returns(google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/content/spaces/{item.space_id}/environments/{item.env_id}/collections/{item.collection_id}/items/{item.id}/publish"
body: "*"
};
}
rpc Unpublish(UnpublishRequest) returns(google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/content/spaces/{item.space_id}/environments/{item.env_id}/collections/{item.collection_id}/items/{item.id}/unpublish"
body: "*"
};
}
rpc GetPublished(GetPublishedRequest) returns(GetPublishedResponse) {
option (google.api.http) = {
get: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/{item_id}/published"
};
}
rpc FindPublished(FindPublishedRequest) returns(FindPublishedResponse) {
option (google.api.http) = {
get: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/find/published"
};
}
rpc CheckoutRevision(CheckoutRevisionRequest) returns(CheckoutRevisionResponse) {
option (google.api.http) = {
get: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/{item_id}/revision/{revision_id}/checkout-revision"
};
}
/** /**
* Расчет значений по существующим данным. Например, получение среднего значения поля * Расчет значений по существующим данным. Например, получение среднего значения поля
*/ */
rpc Aggregate(AggregateRequest) returns(AggregateResponse) {} rpc Aggregate(AggregateRequest) returns(AggregateResponse) {
option (google.api.http) = {
post: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/aggregate"
body: "*"
};
}
/** /**
* Расчет значений по существующим **опубликованным** данным. * Расчет значений по существующим **опубликованным** данным.
*/ */
rpc AggregatePublished(AggregatePublishedRequest) returns(AggregatePublishedResponse) {} rpc AggregatePublished(AggregatePublishedRequest) returns(AggregatePublishedResponse) {
option (google.api.http) = {
rpc GetRevision(GetRevisionRequest) returns(GetRevisionResponse) {} post: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/aggregate/published"
rpc ListRevisions(ListRevisionsRequest) returns(ListRevisionsResponse) {} body: "*"
};
rpc Archive(ArchiveRequest) returns(google.protobuf.Empty) {} }
rpc FindArchived(FindArchivedRequest) returns(FindArchivedResponse) {}
rpc Unarchive(UnarchiveRequest) returns(google.protobuf.Empty) {} rpc GetRevision(GetRevisionRequest) returns(GetRevisionResponse) {
rpc GetArchived(GetArchivedRequest) returns(GetArchivedResponse) {} option (google.api.http) = {
get: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/{item_id}/revision/{revision_id}"
};
}
rpc ListRevisions(ListRevisionsRequest) returns(ListRevisionsResponse) {
option (google.api.http) = {
get: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/{item_id}/revisions"
};
}
rpc Archive(ArchiveRequest) returns(google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/content/spaces/{item.space_id}/environments/{item.env_id}/collections/{item.collection_id}/items/{item.id}/archive"
body: "item"
};
}
rpc FindArchived(FindArchivedRequest) returns(FindArchivedResponse) {
option (google.api.http) = {
get: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/find/archived"
};
}
rpc Unarchive(UnarchiveRequest) returns(google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/content/spaces/{item.space_id}/environments/{item.env_id}/collections/{item.collection_id}/items/{item.id}/unarchive"
body: "item"
};
}
rpc GetArchived(GetArchivedRequest) returns(GetArchivedResponse) {
option (google.api.http) = {
get: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/{item_id}/archived"
};
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment