mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-18 13:45:09 +00:00
Add blog service & follow model changes in tags/posts (#22)
This commit is contained in:
57
blog/posts/proto/posts.proto
Normal file
57
blog/posts/proto/posts.proto
Normal file
@@ -0,0 +1,57 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package posts;
|
||||
|
||||
service Posts {
|
||||
// Query currently only supports read by slug or timestamp, no listing.
|
||||
rpc Query(QueryRequest) returns (QueryResponse) {}
|
||||
rpc Save(SaveRequest) returns (SaveResponse) {}
|
||||
rpc Delete(DeleteRequest) returns (DeleteResponse) {}
|
||||
}
|
||||
|
||||
message Post {
|
||||
string id = 1;
|
||||
string title = 2;
|
||||
string slug = 3;
|
||||
string content = 4;
|
||||
int64 created = 5;
|
||||
int64 updated = 6;
|
||||
string author = 7;
|
||||
repeated string tags = 8;
|
||||
}
|
||||
|
||||
// Query posts. Acts as a listing when no id or slug provided.
|
||||
// Gets a single post by id or slug if any of them provided.
|
||||
message QueryRequest {
|
||||
string id = 1;
|
||||
string slug = 2;
|
||||
string tag = 3;
|
||||
int64 offset = 4;
|
||||
int64 limit = 5;
|
||||
}
|
||||
|
||||
message QueryResponse {
|
||||
repeated Post posts = 1;
|
||||
}
|
||||
|
||||
message SaveRequest {
|
||||
string id = 1;
|
||||
string title = 2;
|
||||
string slug = 3;
|
||||
string content = 4;
|
||||
int64 timestamp = 5;
|
||||
// When updating a post and wanting to delete all tags,
|
||||
// send a list of tags with only one member being an empty string [""]
|
||||
repeated string tags = 6;
|
||||
}
|
||||
|
||||
message SaveResponse {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message DeleteRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message DeleteResponse {}
|
||||
|
||||
Reference in New Issue
Block a user