chore: update memo service

This commit is contained in:
Steven
2023-12-20 23:14:15 +08:00
parent fc01a796f8
commit 762cb25227
7 changed files with 957 additions and 186 deletions

View File

@@ -6,13 +6,17 @@ import "api/v2/common.proto";
import "api/v2/markdown_service.proto";
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "gen/api/v2";
service MemoService {
rpc CreateMemo(CreateMemoRequest) returns (CreateMemoResponse) {
option (google.api.http) = {post: "/api/v2/memos"};
option (google.api.http) = {
post: "/api/v2/memos"
body: "*"
};
}
rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) {
@@ -24,6 +28,19 @@ service MemoService {
option (google.api.method_signature) = "id";
}
rpc UpdateMemo(UpdateMemoRequest) returns (UpdateMemoResponse) {
option (google.api.http) = {
patch: "/api/v2/memos/{id}"
body: "*"
};
option (google.api.method_signature) = "id, update_mask";
}
rpc DeleteMemo(DeleteMemoRequest) returns (DeleteMemoResponse) {
option (google.api.http) = {delete: "/api/v2/memos/{id}"};
option (google.api.method_signature) = "id";
}
rpc CreateMemoComment(CreateMemoCommentRequest) returns (CreateMemoCommentResponse) {
option (google.api.http) = {post: "/api/v2/memos/{id}/comments"};
option (google.api.method_signature) = "id";
@@ -98,6 +115,24 @@ message GetMemoResponse {
Memo memo = 1;
}
message UpdateMemoRequest {
int32 id = 1;
Memo memo = 2;
google.protobuf.FieldMask update_mask = 3;
}
message UpdateMemoResponse {
Memo memo = 1;
}
message DeleteMemoRequest {
int32 id = 1;
}
message DeleteMemoResponse {}
message CreateMemoCommentRequest {
// id is the memo id to create comment for.
int32 id = 1;