65 lines
1.1 KiB
Protocol Buffer
65 lines
1.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package todo.v1;
|
|
|
|
enum Status {
|
|
Todo = 0;
|
|
NeedsMoreInfo = 1;
|
|
Doing = 2;
|
|
Done = 3;
|
|
}
|
|
|
|
enum Field {
|
|
FieldId = 0;
|
|
FieldTitle = 1;
|
|
FieldDescription = 2;
|
|
FieldStatus = 3;
|
|
}
|
|
|
|
enum Operation {
|
|
Equals = 0;
|
|
NotEquals = 1;
|
|
GreaterThan = 2;
|
|
LessThan = 3;
|
|
Like = 4;
|
|
}
|
|
|
|
message GetTodosRequest {
|
|
int32 id = 1;
|
|
}
|
|
|
|
message GetTodosResponse {
|
|
int64 id = 1;
|
|
string title = 2;
|
|
string description = 3;
|
|
Status status = 4;
|
|
}
|
|
|
|
message ListTodosRequest {
|
|
int32 page = 1;
|
|
int32 per_page = 2;
|
|
string orber_by = 3;
|
|
bool asc = 4;
|
|
repeated Filter filters = 5;
|
|
}
|
|
|
|
message Filter {
|
|
Field field = 1;
|
|
string value = 2;
|
|
Operation operation = 3;
|
|
}
|
|
|
|
message Metadata {
|
|
int32 totalCount = 1;
|
|
}
|
|
|
|
message ListTodosResponse {
|
|
repeated GetTodosResponse data = 1;
|
|
Metadata meta = 2;
|
|
}
|
|
|
|
service TodoService {
|
|
rpc GetTodo(GetTodosRequest) returns (GetTodosResponse);
|
|
rpc ListTodos(ListTodosRequest) returns (ListTodosResponse);
|
|
}
|