This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@lendry-erp/contracts",
|
"name": "@lendry-erp/contracts",
|
||||||
"version": "1.2.40",
|
"version": "1.2.41",
|
||||||
"description": "Protobuf definitions and generated TypeScript types",
|
"description": "Protobuf definitions and generated TypeScript types",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|||||||
33
proto/media/media.proto
Normal file
33
proto/media/media.proto
Normal 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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user