mirror of
https://github.com/JuLi0n21/thumbnailservice.git
synced 2026-04-20 00:10:07 +00:00
47 lines
1.6 KiB
Protocol Buffer
47 lines
1.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package thumbnail_service;
|
|
|
|
option go_package = "./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);
|
|
rpc OcrFile(OCRFileRequest) returns (OCRFileResponse);
|
|
}
|
|
|
|
// 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
|
|
} |