From 6506dbc2c462229aec2989fce608770dff47b32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=ED=95=98=EB=AF=BC?= Date: Thu, 6 Aug 2026 08:46:29 +0900 Subject: [PATCH] =?UTF-8?q?update=20::=20Exchange=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EB=AA=85=EC=B9=AD=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/exchange/controller/ExchangeController.kt | 10 +++++----- .../domain/exchange/service/ExchangeFileService.kt | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/team/darkmoderap/aikon/domain/exchange/controller/ExchangeController.kt b/src/main/kotlin/team/darkmoderap/aikon/domain/exchange/controller/ExchangeController.kt index bc940d3..045c5fc 100644 --- a/src/main/kotlin/team/darkmoderap/aikon/domain/exchange/controller/ExchangeController.kt +++ b/src/main/kotlin/team/darkmoderap/aikon/domain/exchange/controller/ExchangeController.kt @@ -16,14 +16,14 @@ import team.darkmoderap.aikon.domain.exchange.service.ExchangeFileService class ExchangeController( private val exchangeFileService: ExchangeFileService, ) { - @PostMapping("/upload", consumes = [MediaType.MULTIPART_FORM_DATA_VALUE]) + @PostMapping("/avatar", consumes = [MediaType.MULTIPART_FORM_DATA_VALUE]) @ResponseStatus(HttpStatus.NO_CONTENT) - fun uploadIncoming( + fun uploadAvatar( @RequestPart("file") file: MultipartFile, ) { - exchangeFileService.uploadIncoming(file) + exchangeFileService.uploadAvatar(file) } - @GetMapping("/outgoing", produces = [MediaType.IMAGE_PNG_VALUE]) - fun downloadOutgoing(): ByteArray = exchangeFileService.downloadOutgoing() + @GetMapping("/report", produces = [MediaType.IMAGE_PNG_VALUE]) + fun downloadReport(): ByteArray = exchangeFileService.downloadReport() } diff --git a/src/main/kotlin/team/darkmoderap/aikon/domain/exchange/service/ExchangeFileService.kt b/src/main/kotlin/team/darkmoderap/aikon/domain/exchange/service/ExchangeFileService.kt index 20b386b..bb09f23 100644 --- a/src/main/kotlin/team/darkmoderap/aikon/domain/exchange/service/ExchangeFileService.kt +++ b/src/main/kotlin/team/darkmoderap/aikon/domain/exchange/service/ExchangeFileService.kt @@ -15,7 +15,7 @@ class ExchangeFileService( @Qualifier("exchangeS3Client") private val s3Client: S3Client, @Value("\${exchange.minio.bucket}") private val bucket: String, ) { - fun uploadIncoming( + fun uploadAvatar( file: MultipartFile, fileName: String = "Aikon500.png", ) { @@ -23,19 +23,19 @@ class ExchangeFileService( PutObjectRequest .builder() .bucket(bucket) - .key("incoming/$fileName") + .key("avatar/$fileName") .contentType(file.contentType ?: MediaType.APPLICATION_OCTET_STREAM_VALUE) .build() file.inputStream.use { s3Client.putObject(request, RequestBody.fromInputStream(it, file.size)) } } - fun downloadOutgoing(fileName: String = "report500.png"): ByteArray { + fun downloadReport(fileName: String = "report500.png"): ByteArray { val request = GetObjectRequest .builder() .bucket(bucket) - .key("outgoing/$fileName") + .key("report/$fileName") .build() return s3Client.getObjectAsBytes(request).asByteArray()