niming_backend/protobuf_files/niming.proto

74 lines
1.5 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
2024-11-25 21:51:50 +08:00
// This is for posting a paragraph.
message Post {
string content = 1;
optional int64 ref = 2;
repeated bytes files = 3;
}
2024-11-26 09:17:44 +08:00
enum Status {
2024-11-25 21:51:50 +08:00
Failed = 0;
Success = 1;
}
// The response of the posting, defining what should return.
message PostResponse {
2024-11-26 09:17:44 +08:00
Status status = 1;
2024-11-25 21:51:50 +08:00
string hash = 2;
uint64 id = 3;
optional string failed_message = 4;
}
2024-12-12 11:30:51 +08:00
message FetchPostResponse {
2024-11-25 21:51:50 +08:00
message Message {
uint64 id = 1;
string content = 2;
// reply to a post, like a mail chat.
2024-12-09 03:24:22 +08:00
// optional uint64 ref = 3;
2024-11-25 21:51:50 +08:00
// request files through /article/file/<id> with MIME type.
// See it as a BLOB url;
2024-12-09 03:24:22 +08:00
repeated string files_hash = 3;
optional string igid = 4;
repeated string comments_hash = 5;
2024-11-25 21:51:50 +08:00
}
// Several post info
2024-11-26 17:38:28 +08:00
repeated Message posts = 1;
2024-12-12 11:30:51 +08:00
}
message FetchCommentResponse {
message Message {
string sha1 = 1;
string content = 2;
}
2024-12-17 01:08:35 +08:00
// Several comment info
repeated Message posts = 1;
}
// FOR ADMIN
message AdminFetchPostResponse {
message Message {
uint64 id = 1;
string content = 2;
repeated string files_hash = 3;
optional string igid = 4;
repeated string comments_hash = 5;
string ip = 6;
string hash = 7;
string mark = 8;
}
2024-12-12 11:30:51 +08:00
// Several post info
repeated Message posts = 1;
2024-12-17 01:08:35 +08:00
}
message AdminFetchCommentResponse {
message Message {
string sha1 = 1;
string content = 2;
string ip = 3;
string hash = 4;
string mark = 5;
}
// Several comment info
repeated Message posts = 1;
}