I am batman
This commit is contained in:
65
proto/post.proto
Normal file
65
proto/post.proto
Normal file
@@ -0,0 +1,65 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package post;
|
||||
|
||||
option go_package = "go-microservices/proto/post;postpb";
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service PostService {
|
||||
rpc CreatePost (CreatePostRequest) returns (CreatePostResponse);
|
||||
rpc GetPost (GetPostRequest) returns (GetPostResponse);
|
||||
rpc UpdatePost (UpdatePostRequest) returns (UpdatePostResponse);
|
||||
rpc DeletePost (DeletePostRequest) returns (google.protobuf.Empty);
|
||||
rpc ListPosts (ListPostsRequest) returns (ListPostsResponse);
|
||||
}
|
||||
|
||||
message Post {
|
||||
string id = 1;
|
||||
string author_id = 2;
|
||||
string title = 3;
|
||||
string content = 4;
|
||||
int64 created_at = 5;
|
||||
int64 updated_at = 6;
|
||||
}
|
||||
|
||||
message CreatePostRequest {
|
||||
string author_id = 1;
|
||||
string title = 2;
|
||||
string content = 3;
|
||||
}
|
||||
|
||||
message CreatePostResponse {
|
||||
Post post = 1;
|
||||
}
|
||||
|
||||
message GetPostRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetPostResponse {
|
||||
Post post = 1;
|
||||
}
|
||||
|
||||
message UpdatePostRequest {
|
||||
string id = 1;
|
||||
string title = 2;
|
||||
string content = 3;
|
||||
}
|
||||
|
||||
message UpdatePostResponse {
|
||||
Post post = 1;
|
||||
}
|
||||
|
||||
message DeletePostRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message ListPostsRequest {
|
||||
int32 page = 1;
|
||||
int32 page_size = 2;
|
||||
}
|
||||
|
||||
message ListPostsResponse {
|
||||
repeated Post posts = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user