-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature/17] 자기소개 등록하기 API를 구현한다 (#18)
* feat: 자기소개 등록하기 api를 구현한다 * feat: 코드리뷰 반영 * feat: 코드리뷰 반영
- Loading branch information
1 parent
237ea74
commit 9f6e52b
Showing
13 changed files
with
133 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ottles/user/controller/dto/InterestDto.kt → ...rs/bottles/user/facade/dto/InterestDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ontroller/dto/ProfileChoiceResponseDto.kt → ...er/facade/dto/ProfileChoiceResponseDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../bottles/user/controller/dto/RegionDto.kt → ...ters/bottles/user/facade/dto/RegionDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/com/nexters/bottles/user/facade/dto/RegisterIntroductionRequestDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.nexters.bottles.user.facade.dto | ||
|
||
import com.nexters.bottles.user.domain.QuestionAndAnswer | ||
|
||
data class RegisterIntroductionRequestDto( | ||
val introduction: List<QuestionAndAnswer> | ||
) |
2 changes: 1 addition & 1 deletion
2
...ntroller/dto/RegisterProfileRequestDto.kt → ...r/facade/dto/RegisterProfileRequestDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/kotlin/com/nexters/bottles/user/repository/converter/QuestionAndAnswerConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.nexters.bottles.user.repository.converter | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper | ||
import com.fasterxml.jackson.module.kotlin.kotlinModule | ||
import com.nexters.bottles.user.domain.QuestionAndAnswer | ||
import javax.persistence.AttributeConverter | ||
import javax.persistence.Converter | ||
|
||
@Converter(autoApply = true) | ||
class QuestionAndAnswerConverter : AttributeConverter<List<QuestionAndAnswer>, String> { | ||
|
||
private val objectMapper = ObjectMapper().registerModule(kotlinModule()) | ||
|
||
override fun convertToDatabaseColumn(attribute: List<QuestionAndAnswer>?): String? { | ||
return attribute?.let { objectMapper.writeValueAsString(it) } | ||
} | ||
|
||
override fun convertToEntityAttribute(dbData: String?): List<QuestionAndAnswer>? { | ||
return dbData?.let { | ||
objectMapper.readValue( | ||
it, | ||
objectMapper.typeFactory.constructCollectionType(List::class.java, QuestionAndAnswer::class.java) | ||
) | ||
} | ||
} | ||
} |
6 changes: 2 additions & 4 deletions
6
src/main/kotlin/com/nexters/bottles/user/repository/converter/UserProfileSelectConverter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters