From be2b0a505d76d6807c2befd25564692910fce12c Mon Sep 17 00:00:00 2001
From: Semyon Krestyaninov <krestyaninov@perx.ru>
Date: Mon, 20 May 2024 18:57:37 +0000
Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B3=D0=B5=D0=BD?=
 =?UTF-8?q?=D0=B5=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=20=D0=B8=20?=
 =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BA=D0=BE?=
 =?UTF-8?q?=D0=B4=20Files=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=BE=D0=BE=D1=82?=
 =?UTF-8?q?=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D0=B8=D1=8F=20=D1=81=20?=
 =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=D0=BC=20?=
 =?UTF-8?q?=D0=B2=20perxis-proto?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../grpc/protobuf_type_converters.microgen.go          |  4 ++--
 pkg/files/file.go                                      |  4 ++--
 pkg/files/file_test.go                                 |  2 +-
 .../grpc/protobuf_type_converters.microgen.go          |  4 ++--
 proto/files/files.pb.go                                | 10 +++++-----
 proto/files/files_grpc.pb.go                           |  2 +-
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/images/transport/grpc/protobuf_type_converters.microgen.go b/images/transport/grpc/protobuf_type_converters.microgen.go
index 48a13510..51f6d686 100644
--- a/images/transport/grpc/protobuf_type_converters.microgen.go
+++ b/images/transport/grpc/protobuf_type_converters.microgen.go
@@ -18,7 +18,7 @@ func PtrFileFileToProto(source *file.File) (*pbfile.File, error) {
 	pbFile := &pbfile.File{
 		Id:       source.ID,
 		Name:     source.Name,
-		Size:     int32(source.Size),
+		Size:     source.Size,
 		MimeType: source.MimeType,
 		Url:      source.URL,
 	}
@@ -32,7 +32,7 @@ func ProtoToPtrFileFile(protoSource *pbfile.File) (*file.File, error) {
 	file := &file.File{
 		ID:       protoSource.Id,
 		Name:     protoSource.Name,
-		Size:     int(protoSource.Size),
+		Size:     protoSource.Size,
 		MimeType: protoSource.MimeType,
 		URL:      protoSource.Url,
 	}
diff --git a/pkg/files/file.go b/pkg/files/file.go
index 95bc2e31..be2157ce 100644
--- a/pkg/files/file.go
+++ b/pkg/files/file.go
@@ -18,7 +18,7 @@ const (
 type File struct {
 	ID       string  `mapstructure:"id,omitempty" json:"id" expr:"id"`                                              // Уникальный идентификатор файла в хранилище
 	Name     string  `mapstructure:"name,omitempty" json:"name" bson:"name,omitempty" expr:"name"`                  // Имя файла
-	Size     int     `mapstructure:"size,omitempty" json:"size" bson:"size,omitempty" expr:"size"`                  // Размер файла
+	Size     uint64  `mapstructure:"size,omitempty" json:"size" bson:"size,omitempty" expr:"size"`                  // Размер файла
 	MimeType string  `mapstructure:"mimeType,omitempty" json:"mimeType" bson:"mimeType,omitempty" expr:"mime_type"` // Mime-type файла
 	URL      string  `mapstructure:"url,omitempty" json:"url" bson:"url,omitempty" expr:"url"`                      // Адрес для загрузки файла
 	Key      string  `mapstructure:"key,omitempty" json:"key" bson:"key,omitempty" expr:"key"`                      // Ключ для хранения файла в хранилище
@@ -47,7 +47,7 @@ func (f *File) SetURLWithTemplate(t *template.Template) error {
 	return nil
 }
 
-func NewFile(name, mimeType string, size int, temp bool) *File {
+func NewFile(name, mimeType string, size uint64, temp bool) *File {
 	i := id.GenerateNewID()
 	if temp {
 		i = fmt.Sprintf("%s%s", TemporaryPrefix, i)
diff --git a/pkg/files/file_test.go b/pkg/files/file_test.go
index 617bed4c..9a67b13c 100644
--- a/pkg/files/file_test.go
+++ b/pkg/files/file_test.go
@@ -69,7 +69,7 @@ func TestFile_InExpr(t *testing.T) {
 	}{
 		{"f.id", map[string]interface{}{"f": &File{ID: "some_id"}}, "some_id", false},
 		{"f.name", map[string]interface{}{"f": &File{Name: "some_name"}}, "some_name", false},
-		{"f.size", map[string]interface{}{"f": &File{Size: 1}}, 1, false},
+		{"f.size", map[string]interface{}{"f": &File{Size: uint64(1)}}, uint64(1), false},
 		{"f.mime_type", map[string]interface{}{"f": &File{MimeType: "some_mime_type"}}, "some_mime_type", false},
 		{"f.url", map[string]interface{}{"f": &File{URL: "some_url"}}, "some_url", false},
 		{"f.key", map[string]interface{}{"f": &File{Key: "some_key"}}, "some_key", false},
diff --git a/pkg/files/transport/grpc/protobuf_type_converters.microgen.go b/pkg/files/transport/grpc/protobuf_type_converters.microgen.go
index 1240f9fc..2a04ddd9 100644
--- a/pkg/files/transport/grpc/protobuf_type_converters.microgen.go
+++ b/pkg/files/transport/grpc/protobuf_type_converters.microgen.go
@@ -96,7 +96,7 @@ func PtrFileToProto(file *files.File) (*pb.File, error) {
 	pbFile := &pb.File{
 		Id:       file.ID,
 		Name:     file.Name,
-		Size:     int32(file.Size),
+		Size:     file.Size,
 		MimeType: file.MimeType,
 		Url:      file.URL,
 	}
@@ -110,7 +110,7 @@ func ProtoToPtrFile(protoFile *pb.File) (*files.File, error) {
 	file := &files.File{
 		ID:       protoFile.Id,
 		Name:     protoFile.Name,
-		Size:     int(protoFile.Size),
+		Size:     protoFile.Size,
 		MimeType: protoFile.MimeType,
 		URL:      protoFile.Url,
 	}
diff --git a/proto/files/files.pb.go b/proto/files/files.pb.go
index 8f93164f..d32da8db 100644
--- a/proto/files/files.pb.go
+++ b/proto/files/files.pb.go
@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.31.0
-// 	protoc        v4.24.3
+// 	protoc-gen-go v1.33.0
+// 	protoc        v5.26.1
 // source: files/files.proto
 
 package files
@@ -28,7 +28,7 @@ type File struct {
 
 	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`                             // Уникальный идентификатор файла в хранилище
 	Name     string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`                         // Имя файла
-	Size     int32  `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`                        // Размер файла
+	Size     uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`                        // Размер файла
 	MimeType string `protobuf:"bytes,4,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"` // Mime-type файла
 	Url      string `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"`                           // Адрес для загрузки файла
 }
@@ -79,7 +79,7 @@ func (x *File) GetName() string {
 	return ""
 }
 
-func (x *File) GetSize() int32 {
+func (x *File) GetSize() uint64 {
 	if x != nil {
 		return x.Size
 	}
@@ -939,7 +939,7 @@ var file_files_files_proto_rawDesc = []byte{
 	0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
 	0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
 	0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
-	0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f,
+	0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f,
 	0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65,
 	0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28,
 	0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0xb5, 0x01, 0x0a, 0x0f, 0x4d, 0x75, 0x6c, 0x74, 0x69,
diff --git a/proto/files/files_grpc.pb.go b/proto/files/files_grpc.pb.go
index 234e2859..65e2ac2b 100644
--- a/proto/files/files_grpc.pb.go
+++ b/proto/files/files_grpc.pb.go
@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
 // - protoc-gen-go-grpc v1.3.0
-// - protoc             v4.24.3
+// - protoc             v5.26.1
 // source: files/files.proto
 
 package files
-- 
GitLab