mirror of
				https://github.com/usememos/memos.git
				synced 2025-11-01 01:06:04 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			114 lines
		
	
	
	
		
			2.1 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
			
		
		
	
	
			114 lines
		
	
	
	
		
			2.1 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
| syntax = "proto3";
 | |
| 
 | |
| package memos.api.v2;
 | |
| 
 | |
| import "api/v2/common.proto";
 | |
| import "google/api/annotations.proto";
 | |
| 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"};
 | |
|   }
 | |
| 
 | |
|   rpc GetMemo(GetMemoRequest) returns (GetMemoResponse) {
 | |
|     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 {
 | |
|   int32 id = 1;
 | |
| 
 | |
|   RowStatus row_status = 2;
 | |
| 
 | |
|   int32 creator_id = 3;
 | |
| 
 | |
|   int64 created_ts = 4;
 | |
| 
 | |
|   int64 updated_ts = 5;
 | |
| 
 | |
|   string content = 6;
 | |
| 
 | |
|   Visibility visibility = 7;
 | |
| 
 | |
|   bool pinned = 8;
 | |
| }
 | |
| 
 | |
| message CreateMemoRequest {
 | |
|   string content = 1;
 | |
| 
 | |
|   Visibility visibility = 2;
 | |
| }
 | |
| 
 | |
| message CreateMemoResponse {
 | |
|   Memo memo = 1;
 | |
| }
 | |
| 
 | |
| message ListMemosRequest {
 | |
|   int32 page = 1;
 | |
| 
 | |
|   int32 page_size = 2;
 | |
| 
 | |
|   // Filter is used to filter memos returned in the list.
 | |
|   string filter = 3;
 | |
| 
 | |
|   optional int32 creator_id = 4;
 | |
| }
 | |
| 
 | |
| message ListMemosResponse {
 | |
|   repeated Memo memos = 1;
 | |
| }
 | |
| 
 | |
| message GetMemoRequest {
 | |
|   int32 id = 1;
 | |
| }
 | |
| 
 | |
| message GetMemoResponse {
 | |
|   Memo memo = 1;
 | |
| }
 | |
| 
 | |
| message CreateMemoCommentRequest {
 | |
|   // id is the memo id to create comment for.
 | |
|   int32 id = 1;
 | |
| 
 | |
|   CreateMemoRequest create = 2;
 | |
| }
 | |
| 
 | |
| message CreateMemoCommentResponse {
 | |
|   Memo memo = 1;
 | |
| }
 | |
| 
 | |
| message ListMemoCommentsRequest {
 | |
|   int32 id = 1;
 | |
| }
 | |
| 
 | |
| message ListMemoCommentsResponse {
 | |
|   repeated Memo memos = 1;
 | |
| }
 |