From 38b604501b7ab06899fcc7fd593ff6e117a3d0a2 Mon Sep 17 00:00:00 2001 From: uuuuuuuk Date: Mon, 25 Mar 2024 17:20:06 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20InquiryAdapter=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84=20=EB=B0=8F=20=EB=AC=B8=EC=9D=98=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EA=B8=80=20=EC=9E=91=EC=84=B1=ED=95=98=EA=B8=B0=20api=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=ED=95=A8=EC=88=98=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inquiry/adapter/input/InquiryAdapter.kt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/main/kotlin/andreas311/miso/domain/inquiry/adapter/input/InquiryAdapter.kt diff --git a/src/main/kotlin/andreas311/miso/domain/inquiry/adapter/input/InquiryAdapter.kt b/src/main/kotlin/andreas311/miso/domain/inquiry/adapter/input/InquiryAdapter.kt new file mode 100644 index 00000000..ec86d499 --- /dev/null +++ b/src/main/kotlin/andreas311/miso/domain/inquiry/adapter/input/InquiryAdapter.kt @@ -0,0 +1,26 @@ +package andreas311.miso.domain.inquiry.adapter.input + +import andreas311.miso.common.annotation.RequestController +import andreas311.miso.domain.inquiry.adapter.input.data.WriteInquiryRequest +import andreas311.miso.domain.inquiry.adapter.input.mapper.InquiryDataMapper +import andreas311.miso.domain.inquiry.application.port.input.WriteInquiryUseCase +import org.springframework.http.HttpStatus +import org.springframework.http.ResponseEntity +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RequestPart +import org.springframework.web.multipart.MultipartFile +import javax.validation.Valid + +@RequestController("/inquiry") +class InquiryAdapter( + private val inquiryDataMapper: InquiryDataMapper, + private val writeInquiryUseCase: WriteInquiryUseCase +) { + @PostMapping + fun write( + @RequestPart(value = "file") multipartFile: MultipartFile?, + @RequestPart(value = "inquiry") @Valid writeInquiryRequest: WriteInquiryRequest + ): ResponseEntity = + writeInquiryUseCase.execute(inquiryDataMapper toDto writeInquiryRequest, multipartFile) + .let { ResponseEntity.status(HttpStatus.CREATED).build() } +} \ No newline at end of file