diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/AuthService.kt b/src/main/kotlin/com/vacgom/backend/application/auth/AuthService.kt index 8b43055..5a6509f 100644 --- a/src/main/kotlin/com/vacgom/backend/application/auth/AuthService.kt +++ b/src/main/kotlin/com/vacgom/backend/application/auth/AuthService.kt @@ -1,8 +1,8 @@ package com.vacgom.backend.application.auth -import com.vacgom.backend.application.auth.dto.AuthResponse -import com.vacgom.backend.application.auth.dto.MemberResponse -import com.vacgom.backend.application.auth.dto.TokenResponse +import com.vacgom.backend.application.auth.dto.response.AuthResponse +import com.vacgom.backend.application.auth.dto.response.MemberResponse +import com.vacgom.backend.application.auth.dto.response.TokenResponse import com.vacgom.backend.domain.auth.constants.Role.ROLE_TEMP_USER import com.vacgom.backend.domain.auth.oauth.constants.ProviderType import com.vacgom.backend.domain.member.Member diff --git a/src/main/kotlin/com/vacgom/backend/application/member/MemberService.kt b/src/main/kotlin/com/vacgom/backend/application/auth/VacgomSignupService.kt similarity index 51% rename from src/main/kotlin/com/vacgom/backend/application/member/MemberService.kt rename to src/main/kotlin/com/vacgom/backend/application/auth/VacgomSignupService.kt index a9dfeff..54ca060 100644 --- a/src/main/kotlin/com/vacgom/backend/application/member/MemberService.kt +++ b/src/main/kotlin/com/vacgom/backend/application/auth/VacgomSignupService.kt @@ -1,28 +1,32 @@ -package com.vacgom.backend.application.member +package com.vacgom.backend.application.auth -import com.vacgom.backend.application.auth.dto.AuthResponse -import com.vacgom.backend.application.auth.dto.MemberResponse -import com.vacgom.backend.application.auth.dto.TokenResponse -import com.vacgom.backend.application.member.dto.request.SignUpRequest +import com.vacgom.backend.application.auth.dto.request.SignUpRequest +import com.vacgom.backend.application.auth.dto.response.AuthResponse +import com.vacgom.backend.application.auth.dto.response.MemberResponse +import com.vacgom.backend.application.auth.dto.response.TokenResponse import com.vacgom.backend.domain.auth.constants.Role import com.vacgom.backend.domain.member.HealthProfile import com.vacgom.backend.domain.member.MemberDetails import com.vacgom.backend.domain.member.Nickname +import com.vacgom.backend.domain.vaccine.Inoculation +import com.vacgom.backend.domain.vaccine.constants.Vaccination import com.vacgom.backend.exception.member.MemberError import com.vacgom.backend.exception.member.NicknameError import com.vacgom.backend.global.exception.error.BusinessException import com.vacgom.backend.global.security.jwt.JwtFactory import com.vacgom.backend.infrastructure.member.persistence.HealthProfileRepository import com.vacgom.backend.infrastructure.member.persistence.MemberRepository +import com.vacgom.backend.infrastructure.vaccine.persistence.InoculationRepository import jakarta.transaction.Transactional import org.springframework.stereotype.Service import java.util.* @Service @Transactional -class MemberService( +class VacgomSignupService( private val memberRepository: MemberRepository, private val healthProfileRepository: HealthProfileRepository, + private val inoculationRepository: InoculationRepository, private val jwtFactory: JwtFactory ) { fun validateNickname(id: String) { @@ -35,23 +39,37 @@ class MemberService( memberId: UUID, request: SignUpRequest ): AuthResponse { + val (nickname, healthConditions) = request.memberInfo + val (name, birthday, sex, vaccines) = request.vaccinationInfo + val member = memberRepository.findById(memberId).orElseThrow { BusinessException(MemberError.NOT_FOUND) } - val nickname = Nickname(request.nickname) - val memberDetails = MemberDetails(request.name, request.birthday, request.sex) + val validatedNickname = Nickname(nickname) + val memberDetails = MemberDetails(name, birthday, sex) - member.updateNickname(nickname) + member.updateNickname(validatedNickname) member.updateMemberDetails(memberDetails) member.updateRole(Role.ROLE_USER) - val healthConditions = request.healthConditions.stream() + val healthProfiles = healthConditions.stream() .map { condition -> HealthProfile(member, condition) }.toList() - healthProfileRepository.saveAll(healthConditions) + healthProfileRepository.saveAll(healthProfiles) val memberResponse = MemberResponse(member.id!!, member.role) val tokenResponse = TokenResponse(jwtFactory.createAccessToken(member)) + val inoculations = vaccines.stream() + .map { vaccine -> + val (vaccineType, inoculationOrder, inoculationOrderString, date, agency, vaccineName, vaccineBrandName, lotNumber) + = vaccine + val vaccination = Vaccination.getVaccinationByName(vaccineType) + Inoculation(vaccination, inoculationOrder, inoculationOrderString, date, agency, vaccineName, vaccineBrandName, lotNumber, member) + }.toList() + + inoculationRepository.saveAll(inoculations) + member.addInoculations(inoculations) + return AuthResponse(memberResponse, tokenResponse) } } diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/dto/ResourceIdResponse.kt b/src/main/kotlin/com/vacgom/backend/application/auth/dto/ResourceIdResponse.kt deleted file mode 100644 index cf7d3e2..0000000 --- a/src/main/kotlin/com/vacgom/backend/application/auth/dto/ResourceIdResponse.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.vacgom.backend.application.auth.dto - -data class ResourceIdResponse( - val id: Long -) diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/MemberInfoRequest.kt b/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/MemberInfoRequest.kt new file mode 100644 index 0000000..0d5cc5a --- /dev/null +++ b/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/MemberInfoRequest.kt @@ -0,0 +1,8 @@ +package com.vacgom.backend.application.auth.dto.request + +import com.vacgom.backend.domain.member.constants.HealthCondition + +data class MemberInfoRequest( + val nickname: String, + val healthConditions: MutableList +) diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/SignUpRequest.kt b/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/SignUpRequest.kt new file mode 100644 index 0000000..00fa1b4 --- /dev/null +++ b/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/SignUpRequest.kt @@ -0,0 +1,6 @@ +package com.vacgom.backend.application.auth.dto.request + +data class SignUpRequest( + val memberInfo: MemberInfoRequest, + val vaccinationInfo: VaccinationInfoRequest +) diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/VaccinationInfoRequest.kt b/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/VaccinationInfoRequest.kt new file mode 100644 index 0000000..48ba52f --- /dev/null +++ b/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/VaccinationInfoRequest.kt @@ -0,0 +1,8 @@ +package com.vacgom.backend.application.auth.dto.request + +data class VaccinationInfoRequest( + val name: String, + val birth: String, + val sex: String, + val vaccineList: MutableList +) diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/Vaccines.kt b/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/Vaccines.kt new file mode 100644 index 0000000..c845093 --- /dev/null +++ b/src/main/kotlin/com/vacgom/backend/application/auth/dto/request/Vaccines.kt @@ -0,0 +1,14 @@ +package com.vacgom.backend.application.auth.dto.request + +import java.time.LocalDate + +data class Vaccines( + val vaccineType: String, //DTap + val inoculationOrder: Long, // 4 + val inoculationOrderString: String, // 4차(추가) + val date: LocalDate, // 2024-03-21 + val agency: String, // 광명시보건소 + val vaccineName: String?, // 보령정제피디티백신 + val vaccineBrandName: String?, // (주)보령바이오파마 + val lotNumber: String?, //AC14B097BB +) diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/dto/AuthResponse.kt b/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/AuthResponse.kt similarity index 62% rename from src/main/kotlin/com/vacgom/backend/application/auth/dto/AuthResponse.kt rename to src/main/kotlin/com/vacgom/backend/application/auth/dto/response/AuthResponse.kt index 88c21f4..f6a7497 100644 --- a/src/main/kotlin/com/vacgom/backend/application/auth/dto/AuthResponse.kt +++ b/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/AuthResponse.kt @@ -1,4 +1,4 @@ -package com.vacgom.backend.application.auth.dto +package com.vacgom.backend.application.auth.dto.response data class AuthResponse( val member: MemberResponse, diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/dto/MemberResponse.kt b/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/MemberResponse.kt similarity index 72% rename from src/main/kotlin/com/vacgom/backend/application/auth/dto/MemberResponse.kt rename to src/main/kotlin/com/vacgom/backend/application/auth/dto/response/MemberResponse.kt index 777344f..5422b2b 100644 --- a/src/main/kotlin/com/vacgom/backend/application/auth/dto/MemberResponse.kt +++ b/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/MemberResponse.kt @@ -1,4 +1,4 @@ -package com.vacgom.backend.application.auth.dto +package com.vacgom.backend.application.auth.dto.response import com.vacgom.backend.domain.auth.constants.Role import java.util.* diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/dto/OauthTokenResponse.kt b/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/OauthTokenResponse.kt similarity index 81% rename from src/main/kotlin/com/vacgom/backend/application/auth/dto/OauthTokenResponse.kt rename to src/main/kotlin/com/vacgom/backend/application/auth/dto/response/OauthTokenResponse.kt index 9a39430..83764af 100644 --- a/src/main/kotlin/com/vacgom/backend/application/auth/dto/OauthTokenResponse.kt +++ b/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/OauthTokenResponse.kt @@ -1,4 +1,4 @@ -package com.vacgom.backend.application.auth.dto +package com.vacgom.backend.application.auth.dto.response import com.fasterxml.jackson.databind.PropertyNamingStrategies import com.fasterxml.jackson.databind.annotation.JsonNaming diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/ResourceIdResponse.kt b/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/ResourceIdResponse.kt new file mode 100644 index 0000000..6aeac75 --- /dev/null +++ b/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/ResourceIdResponse.kt @@ -0,0 +1,5 @@ +package com.vacgom.backend.application.auth.dto.response + +data class ResourceIdResponse( + val id: Long +) diff --git a/src/main/kotlin/com/vacgom/backend/application/auth/dto/TokenResponse.kt b/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/TokenResponse.kt similarity index 52% rename from src/main/kotlin/com/vacgom/backend/application/auth/dto/TokenResponse.kt rename to src/main/kotlin/com/vacgom/backend/application/auth/dto/response/TokenResponse.kt index 6951055..07545c0 100644 --- a/src/main/kotlin/com/vacgom/backend/application/auth/dto/TokenResponse.kt +++ b/src/main/kotlin/com/vacgom/backend/application/auth/dto/response/TokenResponse.kt @@ -1,4 +1,4 @@ -package com.vacgom.backend.application.auth.dto +package com.vacgom.backend.application.auth.dto.response data class TokenResponse( diff --git a/src/main/kotlin/com/vacgom/backend/application/member/dto/request/SignUpRequest.kt b/src/main/kotlin/com/vacgom/backend/application/member/dto/request/SignUpRequest.kt deleted file mode 100644 index 9459c7f..0000000 --- a/src/main/kotlin/com/vacgom/backend/application/member/dto/request/SignUpRequest.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.vacgom.backend.application.member.dto.request - -import com.vacgom.backend.domain.member.constants.HealthCondition - -data class SignUpRequest( - val name: String, - val birthday: String, - val sex: String, - val healthConditions: MutableList, - val nickname: String -) diff --git a/src/main/kotlin/com/vacgom/backend/domain/auth/oauth/OauthConnector.kt b/src/main/kotlin/com/vacgom/backend/domain/auth/oauth/OauthConnector.kt index 36022e1..bededa0 100644 --- a/src/main/kotlin/com/vacgom/backend/domain/auth/oauth/OauthConnector.kt +++ b/src/main/kotlin/com/vacgom/backend/domain/auth/oauth/OauthConnector.kt @@ -1,7 +1,7 @@ package com.vacgom.backend.domain.auth.oauth -import com.vacgom.backend.application.auth.dto.OauthTokenResponse -import com.vacgom.backend.application.auth.dto.ResourceIdResponse +import com.vacgom.backend.application.auth.dto.response.OauthTokenResponse +import com.vacgom.backend.application.auth.dto.response.ResourceIdResponse import com.vacgom.backend.domain.auth.oauth.constants.ProviderType interface OauthConnector { diff --git a/src/main/kotlin/com/vacgom/backend/domain/member/Member.kt b/src/main/kotlin/com/vacgom/backend/domain/member/Member.kt index 363e977..6b4eeec 100644 --- a/src/main/kotlin/com/vacgom/backend/domain/member/Member.kt +++ b/src/main/kotlin/com/vacgom/backend/domain/member/Member.kt @@ -30,8 +30,8 @@ class Member( @OneToMany(mappedBy = "member") val inoculations: MutableList = mutableListOf() - fun addInoculation(inoculation: Inoculation) { - inoculations.add(inoculation) + fun addInoculations(inoculations: List) { + this.inoculations.addAll(inoculations) } fun updateMemberDetails(memberDetails: MemberDetails) { diff --git a/src/main/kotlin/com/vacgom/backend/domain/member/MemberDetails.kt b/src/main/kotlin/com/vacgom/backend/domain/member/MemberDetails.kt index 42bcf73..6e814b8 100644 --- a/src/main/kotlin/com/vacgom/backend/domain/member/MemberDetails.kt +++ b/src/main/kotlin/com/vacgom/backend/domain/member/MemberDetails.kt @@ -21,6 +21,6 @@ class MemberDetails( constructor(name: String, birthday: String, sex: String) : this( name, LocalDate.parse(birthday, DateTimeFormatter.ofPattern("yyyy-MM-dd")), - Sex.valueOf(sex) + Sex.getSexByValue(sex) ) } diff --git a/src/main/kotlin/com/vacgom/backend/domain/member/constants/Sex.kt b/src/main/kotlin/com/vacgom/backend/domain/member/constants/Sex.kt index d61ebf3..1813b33 100644 --- a/src/main/kotlin/com/vacgom/backend/domain/member/constants/Sex.kt +++ b/src/main/kotlin/com/vacgom/backend/domain/member/constants/Sex.kt @@ -1,6 +1,18 @@ package com.vacgom.backend.domain.member.constants -enum class Sex { - MALE, - FEMALE +import com.vacgom.backend.exception.member.MemberError +import com.vacgom.backend.global.exception.error.BusinessException + +enum class Sex( + val value: String +) { + MALE("M"), + FEMALE("F"); + + companion object { + fun getSexByValue(value: String): Sex { + return entries.find { it.value == value } + ?: throw BusinessException(MemberError.INVALID_SEX_REQUESTED) + } + } } diff --git a/src/main/kotlin/com/vacgom/backend/domain/vaccine/Inoculation.kt b/src/main/kotlin/com/vacgom/backend/domain/vaccine/Inoculation.kt index 0773353..e941c05 100644 --- a/src/main/kotlin/com/vacgom/backend/domain/vaccine/Inoculation.kt +++ b/src/main/kotlin/com/vacgom/backend/domain/vaccine/Inoculation.kt @@ -22,9 +22,9 @@ class Inoculation( ) val date: LocalDate, val agency: String, - val vaccineName: String, - val vaccineBrandName: String, - val lotNumber: String, + val vaccineName: String?, + val vaccineBrandName: String?, + val lotNumber: String?, @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "member_id") @@ -34,5 +34,5 @@ class Inoculation( @Id @GenericGenerator(name = "uuid2", strategy = "uuid2") @Column(columnDefinition = "BINARY(16)", name = "vaccine_id") - val id: UUID? = null + val id: UUID = UUID.randomUUID() } diff --git a/src/main/kotlin/com/vacgom/backend/domain/vaccine/constants/Vaccination.kt b/src/main/kotlin/com/vacgom/backend/domain/vaccine/constants/Vaccination.kt index a7a1574..e51cd80 100644 --- a/src/main/kotlin/com/vacgom/backend/domain/vaccine/constants/Vaccination.kt +++ b/src/main/kotlin/com/vacgom/backend/domain/vaccine/constants/Vaccination.kt @@ -1,5 +1,8 @@ package com.vacgom.backend.domain.vaccine.constants +import com.vacgom.backend.exception.vaccine.VaccineError +import com.vacgom.backend.global.exception.error.BusinessException + enum class Vaccination( val diseaseName: String, val vaccineName: String, @@ -9,7 +12,7 @@ enum class Vaccination( BCG("결핵", "BCG(피내용)", 1, 1), HEPB("B형간염", "HepB", 1, 3), DTAP("디프테리아·파상풍·백일해", "DTaP", 1, 5), - TDAP("디프테리아·파상풍·백일해", "DTaP", 6, 6), + TDAP("디프테리아·파상풍·백일해", "Tdap", 6, 6), IPV("폴리오", "IPV", 1, 4), HIB("b형헤모필루스인플루엔자", "Hib", 1, 4), PCV("폐렴구균", "PCV", 1, 4), @@ -22,5 +25,14 @@ enum class Vaccination( HPV("사람유두종바이러스감염증", "HPV", 1, 3), IIV("인플루엔자", "IIV", 1, Long.MAX_VALUE), HPV9("사람유두종바이러스감염증", "HPV9(가다실9)", 1, 3), - COVID19("코로나19", "COVID19", 1, 3) + COVID19("코로나19", "COVID19", 1, 3); + + companion object { + fun getVaccinationByName(vaccineName: String): Vaccination { + return entries.find { it.vaccineName == vaccineName } + ?: throw BusinessException(VaccineError.UNKNOWN_VACCINE_REQUESTED).also { + println("Requested vaccine with name '$vaccineName' is unknown.") + } + } + } } diff --git a/src/main/kotlin/com/vacgom/backend/exception/member/MemberError.kt b/src/main/kotlin/com/vacgom/backend/exception/member/MemberError.kt index 1f8dcd1..165ed87 100644 --- a/src/main/kotlin/com/vacgom/backend/exception/member/MemberError.kt +++ b/src/main/kotlin/com/vacgom/backend/exception/member/MemberError.kt @@ -9,5 +9,6 @@ enum class MemberError( override val status: HttpStatus, override val code: String ) : ErrorCode { - NOT_FOUND("사용자를 찾을 수 없습니다.", HttpStatus.NOT_FOUND, "M_001") + NOT_FOUND("사용자를 찾을 수 없습니다.", HttpStatus.NOT_FOUND, "M_001"), + INVALID_SEX_REQUESTED("사용자를 찾을 수 없습니다.", HttpStatus.NOT_FOUND, "M_002") } diff --git a/src/main/kotlin/com/vacgom/backend/exception/vaccine/VaccineError.kt b/src/main/kotlin/com/vacgom/backend/exception/vaccine/VaccineError.kt new file mode 100644 index 0000000..9304666 --- /dev/null +++ b/src/main/kotlin/com/vacgom/backend/exception/vaccine/VaccineError.kt @@ -0,0 +1,13 @@ +package com.vacgom.backend.exception.vaccine + +import com.vacgom.backend.global.exception.error.ErrorCode +import org.springframework.http.HttpStatus + +enum class VaccineError( + override val message: String, + override val status: HttpStatus, + override val code: String +) : ErrorCode { + UNKNOWN_VACCINE_REQUESTED("확인되지 않은 백신이 요청되었습니다.", HttpStatus.BAD_REQUEST, "VI_001"), +} + diff --git a/src/main/kotlin/com/vacgom/backend/global/security/matcher/CustomRequestMatcher.kt b/src/main/kotlin/com/vacgom/backend/global/security/matcher/CustomRequestMatcher.kt index 81594f8..2560ef2 100644 --- a/src/main/kotlin/com/vacgom/backend/global/security/matcher/CustomRequestMatcher.kt +++ b/src/main/kotlin/com/vacgom/backend/global/security/matcher/CustomRequestMatcher.kt @@ -12,7 +12,7 @@ class CustomRequestMatcher { return OrRequestMatcher( AntPathRequestMatcher("/"), // Actuator Health Checker AntPathRequestMatcher("/api/v1/oauth/**"), // Oauth Login - AntPathRequestMatcher("/api/v1/member/validation") // VacgomId Validation Checker + AntPathRequestMatcher("/api/v1/member/validation"), // VacgomId Validation Checker ) } diff --git a/src/main/kotlin/com/vacgom/backend/infrastructure/auth/oauth/kakao/KakaoConnector.kt b/src/main/kotlin/com/vacgom/backend/infrastructure/auth/oauth/kakao/KakaoConnector.kt index 5cb6694..b90c650 100644 --- a/src/main/kotlin/com/vacgom/backend/infrastructure/auth/oauth/kakao/KakaoConnector.kt +++ b/src/main/kotlin/com/vacgom/backend/infrastructure/auth/oauth/kakao/KakaoConnector.kt @@ -1,7 +1,7 @@ package com.vacgom.backend.infrastructure.auth.oauth.kakao -import com.vacgom.backend.application.auth.dto.OauthTokenResponse -import com.vacgom.backend.application.auth.dto.ResourceIdResponse +import com.vacgom.backend.application.auth.dto.response.OauthTokenResponse +import com.vacgom.backend.application.auth.dto.response.ResourceIdResponse import com.vacgom.backend.domain.auth.oauth.OauthConnector import com.vacgom.backend.domain.auth.oauth.constants.ProviderType import com.vacgom.backend.global.exception.error.BusinessException diff --git a/src/main/kotlin/com/vacgom/backend/infrastructure/vaccine/persistence/InoculationRepository.kt b/src/main/kotlin/com/vacgom/backend/infrastructure/vaccine/persistence/InoculationRepository.kt new file mode 100644 index 0000000..eff7053 --- /dev/null +++ b/src/main/kotlin/com/vacgom/backend/infrastructure/vaccine/persistence/InoculationRepository.kt @@ -0,0 +1,7 @@ +package com.vacgom.backend.infrastructure.vaccine.persistence + +import com.vacgom.backend.domain.vaccine.Inoculation +import org.springframework.data.jpa.repository.JpaRepository +import java.util.* + +interface InoculationRepository : JpaRepository diff --git a/src/main/kotlin/com/vacgom/backend/presentation/auth/OAuthController.kt b/src/main/kotlin/com/vacgom/backend/presentation/auth/OAuthController.kt index 36fba15..42256d2 100644 --- a/src/main/kotlin/com/vacgom/backend/presentation/auth/OAuthController.kt +++ b/src/main/kotlin/com/vacgom/backend/presentation/auth/OAuthController.kt @@ -1,7 +1,7 @@ package com.vacgom.backend.presentation.auth import com.vacgom.backend.application.auth.AuthService -import com.vacgom.backend.application.auth.dto.AuthResponse +import com.vacgom.backend.application.auth.dto.response.AuthResponse import org.springframework.http.HttpStatus import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.* diff --git a/src/main/kotlin/com/vacgom/backend/presentation/member/MemberController.kt b/src/main/kotlin/com/vacgom/backend/presentation/auth/SignUpController.kt similarity index 57% rename from src/main/kotlin/com/vacgom/backend/presentation/member/MemberController.kt rename to src/main/kotlin/com/vacgom/backend/presentation/auth/SignUpController.kt index 537b5cd..339a4c7 100644 --- a/src/main/kotlin/com/vacgom/backend/presentation/member/MemberController.kt +++ b/src/main/kotlin/com/vacgom/backend/presentation/auth/SignUpController.kt @@ -1,8 +1,8 @@ -package com.vacgom.backend.presentation.member +package com.vacgom.backend.presentation.auth -import com.vacgom.backend.application.auth.dto.AuthResponse -import com.vacgom.backend.application.member.MemberService -import com.vacgom.backend.application.member.dto.request.SignUpRequest +import com.vacgom.backend.application.auth.VacgomSignupService +import com.vacgom.backend.application.auth.dto.request.SignUpRequest +import com.vacgom.backend.application.auth.dto.response.AuthResponse import com.vacgom.backend.global.security.annotation.AuthId import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.* @@ -11,12 +11,12 @@ import java.util.* @RestController @RequestMapping("/api/v1/member") -class MemberController( - private val memberService: MemberService +class SignUpController( + private val vacgomSignupService: VacgomSignupService ) { @PostMapping("/validation") fun validateNickname(@RequestParam nickname: String): ResponseEntity { - memberService.validateNickname(nickname) + vacgomSignupService.validateNickname(nickname) return ResponseEntity.ok().build() } @@ -25,7 +25,7 @@ class MemberController( @AuthId memberId: UUID, @RequestBody request: SignUpRequest ): ResponseEntity { - val authResponse = memberService.signUpVacgom(memberId, request) + val authResponse = vacgomSignupService.signUpVacgom(memberId, request) return ResponseEntity.ok(authResponse) } }