Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Kotlin으로 변경 #150

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Kotlin으로 변경 #150

wants to merge 1 commit into from

Conversation

Yo0oN
Copy link
Collaborator

@Yo0oN Yo0oN commented Jul 20, 2021

common 패키지의 코드들만 Kotlin으로 변경해보았고, 기존 코드와 구분하기 위해 뒤에 KT라는 이름을 붙여주었습니다!

1차 변경 완료
코드 확인 후 틀린부분 수정 예정
@Yo0oN Yo0oN added In Progress Ongoing Tasks Asking for review Asking for code review labels Jul 20, 2021
@Yo0oN Yo0oN requested review from f-lab-dev and Jane096 July 20, 2021 18:02
@Yo0oN Yo0oN self-assigned this Jul 20, 2021
Comment on lines +5 to +9
companion object {
@JvmStatic val MASTER = "master"

@JvmStatic val SLAVE = "slave"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굳이 @JvmStatic을 붙여줄 필요가 있을까요? 상수를 정의하는데에 있어 어떻게 하는게 나을지 고민해보시면 좋겠습니다

Comment on lines +8 to +15
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>()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도 마찬가지입니다. 상수 정의에 대해 코틀린에서 지원하는게 뭐뭐가 있는지 여태까지 언어에 대해 공부했던것들을 다 종합해서 고민해주세요

Comment on lines +12 to +16
return if (TransactionSynchronizationManager.isCurrentTransactionReadOnly()) {
SLAVE
} else {
MASTER
}
Copy link
Member

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{
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 다 생성자 주입이 가능한데 너무 자동변환에 의존하고있는게 아닌가 싶네요.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Asking for review Asking for code review In Progress Ongoing Tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants