StorageService

@Service
class StorageService(s3Client: S3Client, s3Presigner: S3Presigner)(source)

Constructors

Link copied to clipboard
constructor(s3Client: S3Client, s3Presigner: S3Presigner)

Properties

Link copied to clipboard
@Value(value = "${storage.s3.bucket}")
lateinit value var bucketName: String

Functions

Link copied to clipboard
fun generatePresignedUrl(key: String, durationMinutes: Long = 15): String

Gera URL assinada temporária para visualização (GET). O link expira após 'durationMinutes'.

Link copied to clipboard
fun upload(key: String, content: ByteArray, contentType: String)

Upload de arquivo (Bytes) para o Bucket R2.