-
Notifications
You must be signed in to change notification settings - Fork 12
Kotlin으로 변경 #150
base: develop
Are you sure you want to change the base?
Kotlin으로 변경 #150
Conversation
1차 변경 완료 코드 확인 후 틀린부분 수정 예정
companion object { | ||
@JvmStatic val MASTER = "master" | ||
|
||
@JvmStatic val SLAVE = "slave" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳이 @JvmStatic
을 붙여줄 필요가 있을까요? 상수를 정의하는데에 있어 어떻게 하는게 나을지 고민해보시면 좋겠습니다
companion object { | ||
val RESPONSE_ENTITY_CONFLICT = ResponseEntity.status(HttpStatus.CONFLICT).build<HttpStatus>() | ||
val RESPONSE_ENTITY_OK = ResponseEntity.status(HttpStatus.OK).build<HttpStatus>() | ||
val RESPONSE_ENTITY_NO_CONTENT = ResponseEntity.status(HttpStatus.NO_CONTENT).build<HttpStatus>() | ||
val RESPONSE_ENTITY_BAD_REQUEST = ResponseEntity.status(HttpStatus.BAD_REQUEST).build<HttpStatus>() | ||
val RESPONSE_ENTITY_BAD_REQUEST_NO_USER = ResponseEntity.status(HttpStatus.BAD_REQUEST).body("미가입 회원입니다.") | ||
val RESPONSE_ENTITY_NOT_FOUND = ResponseEntity.status(HttpStatus.NOT_FOUND).build<HttpStatus>() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 마찬가지입니다. 상수 정의에 대해 코틀린에서 지원하는게 뭐뭐가 있는지 여태까지 언어에 대해 공부했던것들을 다 종합해서 고민해주세요
return if (TransactionSynchronizationManager.isCurrentTransactionReadOnly()) { | ||
SLAVE | ||
} else { | ||
MASTER | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거는 =
을 사용하면 return을 생략 가능해보입니다
|
||
@Log4j2 | ||
@Component | ||
class S3ImageUploaderKT : ImageUploaderKT{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ktlint 도입을 고민해주세요~
private lateinit var amazonS3: AmazonS3 | ||
|
||
@Value("\${aws.s3.bucket}") | ||
private lateinit var bucket: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 다 생성자 주입이 가능한데 너무 자동변환에 의존하고있는게 아닌가 싶네요.
common 패키지의 코드들만 Kotlin으로 변경해보았고, 기존 코드와 구분하기 위해 뒤에 KT라는 이름을 붙여주었습니다!