add media proto file
All checks were successful
Publish / Publish Job (push) Successful in 2m23s

This commit is contained in:
Дмитрий
2026-05-08 16:22:00 +03:00
parent 1ce76254e5
commit 04bfccb868
2 changed files with 34 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@lendry-erp/contracts",
"version": "1.2.40",
"version": "1.2.41",
"description": "Protobuf definitions and generated TypeScript types",
"type": "commonjs",
"main": "./dist/index.js",

33
proto/media/media.proto Normal file
View File

@@ -0,0 +1,33 @@
// contracts/proto/media/v1/media.proto
syntax = "proto3";
package media.v1;
option go_package = "git.lendry.ru/lendry-erp/proto.git/go;pb";
service MediaService {
// Загрузка файла
rpc Upload(UploadRequest) returns (UploadResponse);
// Генерация временной ссылки для скачивания/просмотра
rpc GetPresignedUrl(GetPresignedUrlRequest) returns (GetPresignedUrlResponse);
}
message UploadRequest {
string file_name = 1;
bytes data = 2; // Сами байты файла
string mode = 3; // "avatar", "chat", "raw"
}
message UploadResponse {
string file_name = 1;
int64 size = 2;
}
message GetPresignedUrlRequest {
string file_name = 1;
bool is_public = 2; // Если true, ссылка живет 24 часа, иначе 2 минуты
}
message GetPresignedUrlResponse {
string url = 1;
}