diff --git a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/dto/request/CheckAuthCodeData.kt b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/dto/request/CheckAuthCodeData.kt new file mode 100644 index 00000000..d97a58d6 --- /dev/null +++ b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/dto/request/CheckAuthCodeData.kt @@ -0,0 +1,15 @@ +package team.comit.simtong.domain.auth.dto.request + +/** + * + * 인증 코드 확인 요청 정보를 전달하는 CheckAuthCodeData + * + * @author Chokyunghyeon + * @date 2023/01/14 + * @version 1.2.5 + **/ +data class CheckAuthCodeData( + val email: String, + + val code: String +) \ No newline at end of file diff --git a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/dto/request/SendAuthCodeData.kt b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/dto/request/SendAuthCodeData.kt new file mode 100644 index 00000000..c6e46130 --- /dev/null +++ b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/dto/request/SendAuthCodeData.kt @@ -0,0 +1,13 @@ +package team.comit.simtong.domain.auth.dto.request + +/** + * + * 인증 코드 전송 요청 정보를 전달하는 SendAuthCodeData + * + * @author Chokyunghyeon + * @date 2023/01/14 + * @version 1.2.5 + **/ +data class SendAuthCodeData( + val email: String +) \ No newline at end of file diff --git a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCase.kt b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCase.kt index af53bf70..5f9d543a 100644 --- a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCase.kt +++ b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCase.kt @@ -1,5 +1,6 @@ package team.comit.simtong.domain.auth.usecase +import team.comit.simtong.domain.auth.dto.request.CheckAuthCodeData import team.comit.simtong.domain.auth.exception.AuthExceptions import team.comit.simtong.domain.auth.model.AuthCodeLimit import team.comit.simtong.domain.auth.spi.CommandAuthCodeLimitPort @@ -21,16 +22,16 @@ class CheckAuthCodeUseCase( private val queryAuthCodePort: QueryAuthCodePort ) { - fun execute(email: String, code: String) { - val authCode = queryAuthCodePort.queryAuthCodeByEmail(email) + fun execute(request: CheckAuthCodeData) { + val authCode = queryAuthCodePort.queryAuthCodeByEmail(request.email) ?: throw AuthExceptions.RequiredNewEmailAuthentication() - if (!authCode.code.match(code)) { + if (!authCode.code.match(request.code)) { throw AuthExceptions.DifferentAuthCode() } commandAuthCodeLimitPort.save( - AuthCodeLimit.certified(email) + AuthCodeLimit.certified(request.email) ) } } \ No newline at end of file diff --git a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCase.kt b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCase.kt index 8820da58..d83b5dd1 100644 --- a/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCase.kt +++ b/simtong-application/src/main/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCase.kt @@ -1,5 +1,6 @@ package team.comit.simtong.domain.auth.usecase +import team.comit.simtong.domain.auth.dto.request.SendAuthCodeData import team.comit.simtong.domain.auth.model.AuthCode import team.comit.simtong.domain.auth.model.AuthCodeLimit import team.comit.simtong.domain.auth.spi.CommandAuthCodeLimitPort @@ -24,18 +25,18 @@ class SendAuthCodeUseCase( private val sendEmailPort: SendEmailPort ) { - fun execute(email: String) { - val authCodeLimit = queryAuthCodeLimitPort.queryAuthCodeLimitByEmail(email) - ?: AuthCodeLimit.issue(email) + fun execute(request: SendAuthCodeData) { + val authCodeLimit = queryAuthCodeLimitPort.queryAuthCodeLimitByEmail(request.email) + ?: AuthCodeLimit.issue(request.email) commandAuthCodeLimitPort.save( authCodeLimit.increaseCount() ) val authCode = commandAuthCodePort.save( - AuthCode.issue(email) + AuthCode.issue(request.email) ) - sendEmailPort.sendAuthCode(authCode.code.value, email) + sendEmailPort.sendAuthCode(authCode.code.value, request.email) } } \ No newline at end of file diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageListWebResponse.kt b/simtong-application/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageListResponse.kt similarity index 72% rename from simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageListWebResponse.kt rename to simtong-application/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageListResponse.kt index 052038b6..39ded664 100644 --- a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageListWebResponse.kt +++ b/simtong-application/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageListResponse.kt @@ -2,12 +2,12 @@ package team.comit.simtong.domain.file.dto.response /** * - * 다중 이미지 업로드 요청 결과를 전송하는 UploadImageListWebResponse + * 다중 이미지 업로드 요청 결과를 전송하는 UploadImageListResponse * * @author Chokyunghyeon * @date 2022/09/21 - * @version 1.0.0 + * @version 1.2.5 **/ -data class UploadImageListWebResponse( +data class UploadImageListResponse( val filePathList: List ) \ No newline at end of file diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageWebResponse.kt b/simtong-application/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageResponse.kt similarity index 73% rename from simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageWebResponse.kt rename to simtong-application/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageResponse.kt index 61a52df9..23765621 100644 --- a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageWebResponse.kt +++ b/simtong-application/src/main/kotlin/team/comit/simtong/domain/file/dto/response/UploadImageResponse.kt @@ -2,12 +2,12 @@ package team.comit.simtong.domain.file.dto.response /** * - * 단일 이미지 업로드 요청 결과를 전송하는 UploadImageWebResponse + * 단일 이미지 업로드 요청 결과를 전송하는 UploadImageResponse * * @author Chokyunghyeon * @date 2022/09/21 - * @version 1.0.0 + * @version 1.2.5 **/ -data class UploadImageWebResponse( +data class UploadImageResponse( val filePath: String ) \ No newline at end of file diff --git a/simtong-application/src/main/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCase.kt b/simtong-application/src/main/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCase.kt index c4ec9e7d..d1880d91 100644 --- a/simtong-application/src/main/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCase.kt +++ b/simtong-application/src/main/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCase.kt @@ -1,5 +1,7 @@ package team.comit.simtong.domain.file.usecase +import team.comit.simtong.domain.file.dto.response.UploadImageListResponse +import team.comit.simtong.domain.file.dto.response.UploadImageResponse import team.comit.simtong.domain.file.spi.UploadFilePort import team.comit.simtong.global.annotation.UseCase import java.io.File @@ -10,18 +12,20 @@ import java.io.File * * @author Chokyunghyeon * @date 2022/09/20 - * @version 1.0.0 + * @version 1.2.5 **/ @UseCase class UploadImageUseCase( private val uploadFilePort: UploadFilePort ) { - fun execute(file: File): String { + fun execute(file: File): UploadImageResponse { return uploadFilePort.upload(file) + .let(::UploadImageResponse) } - fun execute(files: List): List { + fun execute(files: List): UploadImageListResponse { return uploadFilePort.upload(files) + .let(::UploadImageListResponse) } } \ No newline at end of file diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCaseTests.kt index 5d16429f..e8215114 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/CheckAuthCodeUseCaseTests.kt @@ -6,6 +6,7 @@ import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import team.comit.simtong.domain.auth.dto.request.CheckAuthCodeData import team.comit.simtong.domain.auth.exception.AuthExceptions import team.comit.simtong.domain.auth.model.AuthCode import team.comit.simtong.domain.auth.model.Code @@ -36,7 +37,7 @@ class CheckAuthCodeUseCaseTests { ) } - private val differentAuthCodeStub by lazy { + private val differentAuthCodeStub: AuthCode by lazy { AuthCode( key = email, code = Code.of("654321"), @@ -44,6 +45,8 @@ class CheckAuthCodeUseCaseTests { ) } + private val requestStub = CheckAuthCodeData(email, code) + @BeforeEach fun setUp() { checkAuthCodeUseCase = CheckAuthCodeUseCase( @@ -60,7 +63,7 @@ class CheckAuthCodeUseCaseTests { // when & then assertDoesNotThrow { - checkAuthCodeUseCase.execute(email, code) + checkAuthCodeUseCase.execute(requestStub) } } @@ -72,7 +75,7 @@ class CheckAuthCodeUseCaseTests { // when & then assertThrows { - checkAuthCodeUseCase.execute(email, code) + checkAuthCodeUseCase.execute(requestStub) } } @@ -84,7 +87,7 @@ class CheckAuthCodeUseCaseTests { // when & then assertThrows { - checkAuthCodeUseCase.execute(email, code) + checkAuthCodeUseCase.execute(requestStub) } } diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt index 627a33ee..d1cbf967 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/auth/usecase/SendAuthCodeUseCaseTests.kt @@ -8,6 +8,7 @@ import org.mockito.BDDMockito.given import org.mockito.BDDMockito.willDoNothing import org.mockito.kotlin.any import org.springframework.boot.test.mock.mockito.MockBean +import team.comit.simtong.domain.auth.dto.request.SendAuthCodeData import team.comit.simtong.domain.auth.exception.AuthExceptions import team.comit.simtong.domain.auth.model.AuthCode import team.comit.simtong.domain.auth.model.AuthCodeLimit @@ -65,6 +66,8 @@ class SendAuthCodeUseCaseTests { ) } + private val requestStub = SendAuthCodeData(email) + @BeforeEach fun setUp() { sendAuthCodeUseCase = SendAuthCodeUseCase( @@ -88,7 +91,7 @@ class SendAuthCodeUseCaseTests { // when & then assertDoesNotThrow { - sendAuthCodeUseCase.execute(email) + sendAuthCodeUseCase.execute(requestStub) } } @@ -100,7 +103,7 @@ class SendAuthCodeUseCaseTests { // when & then assertThrows { - sendAuthCodeUseCase.execute(email) + sendAuthCodeUseCase.execute(requestStub) } } @@ -112,7 +115,7 @@ class SendAuthCodeUseCaseTests { // when & then assertThrows { - sendAuthCodeUseCase.execute(email) + sendAuthCodeUseCase.execute(requestStub) } } diff --git a/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt b/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt index 1642d217..35bb5fe9 100644 --- a/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt +++ b/simtong-application/src/test/kotlin/team/comit/simtong/domain/file/usecase/UploadImageUseCaseTests.kt @@ -42,7 +42,7 @@ class UploadImageUseCaseTests { val response = uploadImageUseCase.execute(fileStub) // then - assertEquals(response, filePathStub) + assertEquals(response.filePath, filePathStub) } @@ -57,7 +57,7 @@ class UploadImageUseCaseTests { // when val response = uploadImageUseCase.execute(filesStub) - assertEquals(response, filePathListStub) + assertEquals(response.filePathList, filePathListStub) } } \ No newline at end of file diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/WebAdminAdapter.kt b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/WebAdminAdapter.kt index f05bd2b6..7227a40c 100644 --- a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/WebAdminAdapter.kt +++ b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/WebAdminAdapter.kt @@ -5,9 +5,8 @@ import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController -import team.comit.simtong.domain.admin.dto.request.SignInWebRequest +import team.comit.simtong.domain.admin.dto.AdminSignInRequest import team.comit.simtong.domain.auth.dto.TokenResponse -import team.comit.simtong.domain.user.dto.request.AdminSignInData import team.comit.simtong.domain.user.dto.response.QueryAdminInfoResponse import team.comit.simtong.domain.user.usecase.AdminSignInUseCase import team.comit.simtong.domain.user.usecase.QueryAdminInfoUseCase @@ -29,13 +28,8 @@ class WebAdminAdapter( ) { @PostMapping("/tokens") - fun signIn(@Valid @RequestBody request: SignInWebRequest): TokenResponse { - return adminSignInUseCase.execute( - AdminSignInData( - employeeNumber = request.employeeNumber.value, - password = request.password.value - ) - ) + fun signIn(@Valid @RequestBody request: AdminSignInRequest): TokenResponse { + return adminSignInUseCase.execute(request.toData()) } @GetMapping("/information") diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/dto/AdminSignInRequest.kt b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/dto/AdminSignInRequest.kt new file mode 100644 index 00000000..1f9d59fc --- /dev/null +++ b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/dto/AdminSignInRequest.kt @@ -0,0 +1,30 @@ +package team.comit.simtong.domain.admin.dto + +import org.hibernate.validator.constraints.Range +import team.comit.simtong.domain.user.dto.request.AdminSignInData +import team.comit.simtong.domain.user.model.EmployeeNumber +import javax.validation.constraints.NotBlank + +/** + * + * 관리자가 로그인을 요청하는 AdminSignInRequest + * + * @author kimbeomjin + * @author Chokyunghyeon + * @date 2023/01/01 + * @version 1.2.5 + **/ +data class AdminSignInRequest( + + @field:Range(min = EmployeeNumber.MIN_VALUE, max = EmployeeNumber.MAX_VALUE) + val employeeNumber: Int, + + @field:NotBlank + val password: String +) { + + fun toData() = AdminSignInData( + employeeNumber = employeeNumber, + password = password + ) +} \ No newline at end of file diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/dto/request/SignInWebRequest.kt b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/dto/request/SignInWebRequest.kt deleted file mode 100644 index e5a0a699..00000000 --- a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/dto/request/SignInWebRequest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package team.comit.simtong.domain.admin.dto.request - -import org.hibernate.validator.constraints.Range -import team.comit.simtong.domain.user.model.EmployeeNumber -import team.comit.simtong.domain.user.model.Password -import javax.validation.constraints.NotBlank - -/** - * - * 관리자가 로그인을 요청하는 SignInWebRequest - * - * @author kimbeomjin - * @author Chokyunghyeon - * @date 2023/01/01 - * @version 1.2.3 - **/ -data class SignInWebRequest( - - @Range(min = EmployeeNumber.MIN_VALUE, max = EmployeeNumber.MAX_VALUE) - val employeeNumber: EmployeeNumber, - - @field:NotBlank - val password: Password -) \ No newline at end of file diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/dto/response/.gitkeep b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/admin/dto/response/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/WebEmailAdapter.kt b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/WebEmailAdapter.kt index 39b86b34..a41a0230 100644 --- a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/WebEmailAdapter.kt +++ b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/WebEmailAdapter.kt @@ -7,8 +7,8 @@ import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController import team.comit.simtong.domain.auth.usecase.CheckAuthCodeUseCase import team.comit.simtong.domain.auth.usecase.SendAuthCodeUseCase -import team.comit.simtong.domain.email.dto.request.CheckAuthCodeWebRequest -import team.comit.simtong.domain.email.dto.request.SendAuthCodeWebRequest +import team.comit.simtong.domain.email.dto.CheckAuthCodeRequest +import team.comit.simtong.domain.email.dto.SendAuthCodeRequest import javax.validation.Valid /** @@ -27,13 +27,13 @@ class WebEmailAdapter( ) { @PostMapping("/code") - fun sendAuthCode(@Valid @RequestBody request: SendAuthCodeWebRequest) { - sendAuthCodeUseCase.execute(request.email) + fun sendAuthCode(@Valid @RequestBody request: SendAuthCodeRequest) { + sendAuthCodeUseCase.execute(request.toData()) } @GetMapping - fun checkAuthCode(@Valid request: CheckAuthCodeWebRequest) { - checkAuthCodeUseCase.execute(request.email, request.code) + fun checkAuthCode(@Valid request: CheckAuthCodeRequest) { + checkAuthCodeUseCase.execute(request.toData()) } } \ No newline at end of file diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/request/CheckAuthCodeWebRequest.kt b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/CheckAuthCodeRequest.kt similarity index 50% rename from simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/request/CheckAuthCodeWebRequest.kt rename to simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/CheckAuthCodeRequest.kt index af02f173..697efc71 100644 --- a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/request/CheckAuthCodeWebRequest.kt +++ b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/CheckAuthCodeRequest.kt @@ -1,18 +1,19 @@ -package team.comit.simtong.domain.email.dto.request +package team.comit.simtong.domain.email.dto import org.hibernate.validator.constraints.Length +import team.comit.simtong.domain.auth.dto.request.CheckAuthCodeData import javax.validation.constraints.Email import javax.validation.constraints.NotBlank /** * - * 이메일 인증 코드 확인을 요청하는 CheckAuthCodeWebRequest + * 이메일 인증 코드 확인을 요청하는 CheckAuthCodeRequest * * @author Chokyunghyeon * @date 2022/09/24 - * @version 1.0.0 + * @version 1.2.5 **/ -data class CheckAuthCodeWebRequest( +data class CheckAuthCodeRequest( @field:NotBlank @field:Email val email: String, @@ -20,4 +21,10 @@ data class CheckAuthCodeWebRequest( @field:NotBlank @field:Length(min = 6, max = 6) val code: String -) \ No newline at end of file +) { + + fun toData() = CheckAuthCodeData( + email = email, + code = code + ) +} \ No newline at end of file diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/SendAuthCodeRequest.kt b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/SendAuthCodeRequest.kt new file mode 100644 index 00000000..34a6266e --- /dev/null +++ b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/SendAuthCodeRequest.kt @@ -0,0 +1,24 @@ +package team.comit.simtong.domain.email.dto + +import team.comit.simtong.domain.auth.dto.request.SendAuthCodeData +import javax.validation.constraints.Email +import javax.validation.constraints.NotBlank + +/** + * + * 이메일 인증 코드 전송을 요청하는 SendEmailRequest + * + * @author Chokyunghyeon + * @date 2022/09/24 + * @version 1.2.5 + **/ +data class SendAuthCodeRequest( + @field:NotBlank + @field:Email + val email: String +) { + + fun toData() = SendAuthCodeData( + email = email + ) +} \ No newline at end of file diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/request/SendAuthCodeWebRequest.kt b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/request/SendAuthCodeWebRequest.kt deleted file mode 100644 index 64c4feb0..00000000 --- a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/request/SendAuthCodeWebRequest.kt +++ /dev/null @@ -1,18 +0,0 @@ -package team.comit.simtong.domain.email.dto.request - -import javax.validation.constraints.Email -import javax.validation.constraints.NotBlank - -/** - * - * 이메일 인증 코드 전송을 요청하는 SendEmailWebRequest - * - * @author Chokyunghyeon - * @date 2022/09/24 - * @version 1.0.0 - **/ -data class SendAuthCodeWebRequest( - @field:NotBlank - @field:Email - val email: String -) \ No newline at end of file diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/response/.gitkeep b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/email/dto/response/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/WebFileAdapter.kt b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/WebFileAdapter.kt index c7871f60..69708db5 100644 --- a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/WebFileAdapter.kt +++ b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/WebFileAdapter.kt @@ -6,10 +6,10 @@ import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController import org.springframework.web.multipart.MultipartFile -import team.comit.simtong.domain.file.dto.response.UploadImageListWebResponse -import team.comit.simtong.domain.file.dto.response.UploadImageWebResponse import team.comit.simtong.domain.file.converter.ExcelFileConverter import team.comit.simtong.domain.file.converter.ImageFileConverter +import team.comit.simtong.domain.file.dto.response.UploadImageListResponse +import team.comit.simtong.domain.file.dto.response.UploadImageResponse import team.comit.simtong.domain.file.usecase.RegisterEmployeeCertificateUseCase import team.comit.simtong.domain.file.usecase.UploadImageUseCase @@ -19,7 +19,7 @@ import team.comit.simtong.domain.file.usecase.UploadImageUseCase * * @author Chokyunghyeon * @date 2022/09/21 - * @version 1.0.0 + * @version 1.2.5 **/ @RestController @RequestMapping("/files") @@ -30,21 +30,17 @@ class WebFileAdapter( @PostMapping @ResponseStatus(HttpStatus.CREATED) - fun uploadSingleImage(file: MultipartFile): UploadImageWebResponse { - return UploadImageWebResponse( - uploadImageUseCase.execute( - file.let(ImageFileConverter::transferTo) - ) + fun uploadSingleImage(file: MultipartFile): UploadImageResponse { + return uploadImageUseCase.execute( + file.let(ImageFileConverter::transferTo) ) } @PostMapping("/list") @ResponseStatus(HttpStatus.CREATED) - fun uploadMultipleImage(files: List): UploadImageListWebResponse { - return UploadImageListWebResponse( - uploadImageUseCase.execute( - files.let(ImageFileConverter::transferToList) - ) + fun uploadMultipleImage(files: List): UploadImageListResponse { + return uploadImageUseCase.execute( + files.let(ImageFileConverter::transferToList) ) } diff --git a/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/dto/request/.gitkeep b/simtong-presentation/src/main/kotlin/team/comit/simtong/domain/file/dto/request/.gitkeep deleted file mode 100644 index e69de29b..00000000