mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: impl memo comment api
This commit is contained in:
@@ -9,6 +9,10 @@ import "google/api/client.proto";
|
||||
option go_package = "gen/api/v2";
|
||||
|
||||
service MemoService {
|
||||
rpc CreateMemo(CreateMemoRequest) returns (CreateMemoResponse) {
|
||||
option (google.api.http) = {post: "/api/v2/memos"};
|
||||
}
|
||||
|
||||
rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/memos"};
|
||||
}
|
||||
@@ -17,6 +21,26 @@ service MemoService {
|
||||
option (google.api.http) = {get: "/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";
|
||||
}
|
||||
|
||||
rpc ListMemoComments(ListMemoCommentsRequest) returns (ListMemoCommentsResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/memos/{id}/comments"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
}
|
||||
|
||||
enum Visibility {
|
||||
VISIBILITY_UNSPECIFIED = 0;
|
||||
|
||||
PRIVATE = 1;
|
||||
|
||||
PROTECTED = 2;
|
||||
|
||||
PUBLIC = 3;
|
||||
}
|
||||
|
||||
message Memo {
|
||||
@@ -37,6 +61,16 @@ message Memo {
|
||||
bool pinned = 8;
|
||||
}
|
||||
|
||||
message CreateMemoRequest {
|
||||
string content = 1;
|
||||
|
||||
Visibility visibility = 2;
|
||||
}
|
||||
|
||||
message CreateMemoResponse {
|
||||
Memo memo = 1;
|
||||
}
|
||||
|
||||
message ListMemosRequest {
|
||||
int32 page = 1;
|
||||
|
||||
@@ -58,12 +92,21 @@ message GetMemoResponse {
|
||||
Memo memo = 1;
|
||||
}
|
||||
|
||||
enum Visibility {
|
||||
VISIBILITY_UNSPECIFIED = 0;
|
||||
message CreateMemoCommentRequest {
|
||||
// id is the memo id to create comment for.
|
||||
int32 id = 1;
|
||||
|
||||
PRIVATE = 1;
|
||||
|
||||
PROTECTED = 2;
|
||||
|
||||
PUBLIC = 3;
|
||||
CreateMemoRequest create = 2;
|
||||
}
|
||||
|
||||
message CreateMemoCommentResponse {
|
||||
Memo memo = 1;
|
||||
}
|
||||
|
||||
message ListMemoCommentsRequest {
|
||||
int32 id = 1;
|
||||
}
|
||||
|
||||
message ListMemoCommentsResponse {
|
||||
repeated Memo memos = 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user