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";
import "common/error.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/struct.proto";
import "google/api/annotations.proto";
option go_package = "git.perx.ru/perxis/perxis-go/proto/items;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 Update(UpdateRequest) returns(google.protobuf.Empty) {}
rpc Delete(DeleteRequest) returns(google.protobuf.Empty) {}
rpc Undelete(UndeleteRequest) returns(google.protobuf.Empty) {}
rpc Publish(PublishRequest) returns(google.protobuf.Empty) {}
rpc Unpublish(UnpublishRequest) returns(google.protobuf.Empty) {}
rpc GetPublished(GetPublishedRequest) returns(GetPublishedResponse) {}
rpc FindPublished(FindPublishedRequest) returns(FindPublishedResponse) {}
rpc CheckoutRevision(CheckoutRevisionRequest) returns(CheckoutRevisionResponse) {}
rpc Find(FindRequest) returns(FindResponse) {
option (google.api.http) = {
get: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/find"
};
}
rpc Update(UpdateRequest) returns(google.protobuf.Empty) {
option (google.api.http) = {
put: "/v1/content/spaces/{item.space_id}/environments/{item.env_id}/collections/{item.collection_id}/items/{item.id}"
body: "*"
};
}
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 GetRevision(GetRevisionRequest) returns(GetRevisionResponse) {}
rpc ListRevisions(ListRevisionsRequest) returns(ListRevisionsResponse) {}
rpc Archive(ArchiveRequest) returns(google.protobuf.Empty) {}
rpc FindArchived(FindArchivedRequest) returns(FindArchivedResponse) {}
rpc Unarchive(UnarchiveRequest) returns(google.protobuf.Empty) {}
rpc GetArchived(GetArchivedRequest) returns(GetArchivedResponse) {}
rpc AggregatePublished(AggregatePublishedRequest) returns(AggregatePublishedResponse) {
option (google.api.http) = {
post: "/v1/content/spaces/{space_id}/environments/{env_id}/collections/{collection_id}/items/aggregate/published"
body: "*"
};
}
rpc GetRevision(GetRevisionRequest) returns(GetRevisionResponse) {
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