mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: initial memo service definition (#2077)
* chore: initial memo service definition * chore: update * chore: update * chore: update
This commit is contained in:
71
proto/api/v2/memo_service.proto
Normal file
71
proto/api/v2/memo_service.proto
Normal file
@@ -0,0 +1,71 @@
|
||||
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 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";
|
||||
}
|
||||
}
|
||||
|
||||
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 ListMemosRequest {
|
||||
int32 page = 1;
|
||||
|
||||
int32 page_size = 2;
|
||||
|
||||
// Filter is used to filter memos returned in the list.
|
||||
string filter = 3;
|
||||
}
|
||||
|
||||
message ListMemosResponse {
|
||||
repeated Memo memos = 1;
|
||||
|
||||
int32 total = 2;
|
||||
}
|
||||
|
||||
message GetMemoRequest {
|
||||
int32 id = 1;
|
||||
}
|
||||
|
||||
message GetMemoResponse {
|
||||
Memo memo = 1;
|
||||
}
|
||||
|
||||
enum Visibility {
|
||||
VISIBILITY_UNSPECIFIED = 0;
|
||||
|
||||
PRIVATE = 1;
|
||||
|
||||
PROTECTED = 2;
|
||||
|
||||
PUBLIC = 3;
|
||||
}
|
@@ -3,6 +3,7 @@ syntax = "proto3";
|
||||
package memos.api.v2;
|
||||
|
||||
import "api/v2/common.proto";
|
||||
import "api/v2/memo_service.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/client.proto";
|
||||
|
||||
@@ -35,8 +36,6 @@ message User {
|
||||
string open_id = 9;
|
||||
|
||||
string avatar_url = 10;
|
||||
|
||||
repeated UserSetting settings = 11;
|
||||
}
|
||||
|
||||
enum Role {
|
||||
@@ -86,13 +85,3 @@ message UserSettingValue {
|
||||
Visibility visibility_value = 2;
|
||||
}
|
||||
}
|
||||
|
||||
enum Visibility {
|
||||
VISIBILITY_UNSPECIFIED = 0;
|
||||
|
||||
PRIVATE = 1;
|
||||
|
||||
PROTECTED = 2;
|
||||
|
||||
PUBLIC = 3;
|
||||
}
|
||||
|
Reference in New Issue
Block a user