rag/api/library/library.proto

48 lines
883 B
Protocol Buffer
Raw Normal View History

2024-07-15 13:08:48 +00:00
syntax = "proto3";
package LibraryService;
option go_package = "leafdev.top/leaf/rag/proto/library";
import "google/api/annotations.proto";
2024-07-15 18:07:41 +00:00
2024-07-15 17:09:07 +00:00
//import "google.golang.org/grpc/health/grpc_health_v1";
2024-07-15 13:08:48 +00:00
service LibraryService {
rpc ListLibrary(ListLibraryRequest) returns (ListLibraryResponse) {
option (google.api.http) = {
2024-07-15 18:07:41 +00:00
get: "/api/v1/libraries"
2024-07-15 13:08:48 +00:00
};
}
2024-07-15 18:07:41 +00:00
rpc CreateLibrary(CreateLibraryRequest) returns (CreateLibraryResponse) {
option (google.api.http) = {
post: "/api/v1/libraries"
};
}
2024-07-15 13:08:48 +00:00
}
2024-07-15 18:07:41 +00:00
message Library {
int64 id = 1;
string name = 2;
string user_id = 3;
string created_at = 4;
string updated_at = 5;
}
2024-07-15 13:08:48 +00:00
2024-07-15 18:07:41 +00:00
message ListLibraryRequest {
int32 page = 1;
2024-07-15 13:08:48 +00:00
}
message ListLibraryResponse {
2024-07-15 18:07:41 +00:00
repeated Library libraries = 1;
}
2024-07-15 13:08:48 +00:00
2024-07-15 18:07:41 +00:00
message CreateLibraryRequest {
string name = 1;
}
message CreateLibraryResponse {
Library library = 1;
}