rpc changes
This commit is contained in:
@@ -5,16 +5,19 @@ package aoba;
|
||||
|
||||
service AobaRpc {
|
||||
rpc GetMedia (Id) returns (MediaResponse);
|
||||
rpc DeleteMedia (Id) returns (Empty);
|
||||
rpc UpdateMedia (Empty) returns (Empty);
|
||||
rpc ListMedia(PageFilter) returns (ListResponse);
|
||||
rpc GetUser(Id) returns (UserResponse);
|
||||
}
|
||||
|
||||
message PageFilter{
|
||||
message PageFilter {
|
||||
optional int32 page = 1;
|
||||
optional int32 pageSize = 2;
|
||||
optional string query = 3;
|
||||
}
|
||||
|
||||
message Id{
|
||||
message Id {
|
||||
string value = 1;
|
||||
}
|
||||
|
||||
@@ -25,7 +28,7 @@ message MediaResponse {
|
||||
}
|
||||
}
|
||||
|
||||
message ListResponse{
|
||||
message ListResponse {
|
||||
repeated MediaModel items = 1;
|
||||
Pagination pagination = 2;
|
||||
}
|
||||
@@ -38,7 +41,21 @@ message Pagination {
|
||||
optional string query = 5;
|
||||
}
|
||||
|
||||
message Empty{}
|
||||
message UserResponse {
|
||||
oneof userResult {
|
||||
UserModel user = 1;
|
||||
Empty empty = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message UserModel {
|
||||
Id id = 1;
|
||||
string username = 2;
|
||||
string email = 3;
|
||||
bool isAdmin = 4;
|
||||
}
|
||||
|
||||
message Empty {}
|
||||
|
||||
message MediaModel {
|
||||
Id id = 1;
|
||||
|
||||
Reference in New Issue
Block a user