Files
thumbnailservice/thumbnail.proto
2025-06-02 00:07:51 +02:00

59 lines
1.8 KiB
Protocol Buffer

syntax = "proto3";
package thumbnail_service;
option go_package = "./proto";
import "google/api/annotations.proto";
// Enum for the file type
enum FileType {
FILE_TYPE_UNSPECIFIED = 0; // Default value for unspecified file type
IMAGE = 1; // Image file
VIDEO = 2; // Video file
PDF = 3; // PDF file
}
// Service definition
service ThumbnailService {
rpc GenerateThumbnail(ThumbnailRequest) returns (ThumbnailResponse) {
option (google.api.http) = {
post: "/v1/thumbnail"
body: "*"
};
}
rpc OcrFile(OCRFileRequest) returns (OCRFileResponse) {
option (google.api.http) = {
post: "/v1/ocr"
body: "*"
};
}
}
// Request message for generating thumbnails
message ThumbnailRequest {
bytes file_content = 1; // File content as bytes
FileType file_type = 2; // File type (image, video, pdf)
int32 max_width = 3; // Optional max width for resizing (0 means no limit)
int32 max_height = 4; // Optional max height for resizing (0 means no limit)
}
// Response message for the thumbnail generation
message ThumbnailResponse {
string message = 1; // Message indicating success or failure
bytes thumbnail_content = 2; // Thumbnail content as bytes
}
//create a ocred version of a document
message OCRFileRequest {
bytes file_content = 1; //file
FileType file_type = 2; //file type for future adding of maybe other stuff?
bool cleanUp = 3; // if whitespace should be normalized and cleaned from "useless chars"
}
//Response message of ocred document
message OCRFileResponse {
string message = 1; // Status Message
bytes ocr_content = 2; //data of the ocred file
string text_content = 3; //text of the file
}