rag/api/library/library.proto
2024-07-16 02:07:41 +08:00

48 lines
883 B
Protocol Buffer

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