diff --git a/images/transport/grpc/protobuf_type_converters.microgen.go b/images/transport/grpc/protobuf_type_converters.microgen.go index 48a13510667582f7858cbc04ff517598eb17772d..51f6d68668be2c416501fadbe14dbaeead5308df 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 95bc2e31fe1c555b031c997211f7ce3b443c4771..be2157ce8f7faff8d84b95f3901703266ec14f79 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 617bed4c09ef95ab58874d856a36c5584abd4589..9a67b13c8861d4eaa75cee6cdaca8255e25be432 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 1240f9fc2e59251a6792fd04214455c6c75bb050..2a04ddd9eda172864842c2839d8c0437d0f14bc4 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 8f93164f9b2f1957fd62aca0fe29a7cdc62d4b29..d32da8db1cc05365b96d715c5cc87ea065be6479 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 234e28599a99f74e704121aeda9e82a9f37005b4..65e2ac2b544533a072a8ca55ac00b854f73427a0 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