-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor/#372] 범위지정 함수 구현 통일 #373
Merged
Merged
Conversation
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
github-actions
bot
added
config
설정 파일과 관련된 내용을 다룰 때 사용됩니다
refactor
기존 기능에 대해 개선할 때 사용됩니다.
labels
Aug 29, 2024
belljun3395
commented
Aug 29, 2024
Comment on lines
+19
to
+28
private var key: SecretKeySpec = KeyGenerator.getInstance(algorithm).apply { | ||
init(keySize) | ||
}.run { | ||
SecretKeySpec(secretKey.toByteArray(), [email protected]) | ||
} | ||
private var encodeCipher: Cipher = Cipher.getInstance(transformation).apply { | ||
init(Cipher.ENCRYPT_MODE, key, IvParameterSpec([email protected]())) | ||
} | ||
private var decodeCipher: Cipher = Cipher.getInstance(transformation).apply { | ||
init(Cipher.DECRYPT_MODE, key, IvParameterSpec([email protected]())) |
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.
Comment on lines
-38
to
+51
val originDownloadUrl = putDocumentService.execute(documentName, document)?.let { res -> | ||
val source = res.`object` | ||
GetUrlInDto(source).let { query -> | ||
getUrlService.execute(query) | ||
}.let { dto -> | ||
InsertDocumentIfoCommand( | ||
path = documentName, | ||
url = dto.url | ||
).let { command -> | ||
documentDao.insertDocumentIfo(command) ?: throw InsertException("document.insertfail.record") | ||
} | ||
dto.url | ||
} | ||
} ?: throw ExternalIntegrationException("external.document.presignedfail") | ||
val originDownloadUrl = | ||
putDocumentService.execute(documentName, document) | ||
?.`object` | ||
?.let { source -> | ||
getUrlService.execute(GetUrlInDto(source)).also { dto -> | ||
documentDao.insertDocumentIfo( | ||
InsertDocumentIfoCommand( | ||
path = documentName, | ||
url = dto.url | ||
) | ||
) ?: throw InsertException("document.insertfail.record") | ||
} | ||
.let { savedDocument -> | ||
savedDocument.url | ||
} | ||
} ?: throw ExternalIntegrationException("external.document.presignedfail") |
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.
기존과 달라진 점은 범위지정함수의 반환을 명시적으로 구분한 것이 달라진 점입니다.
?.`object`
object 확인
?.let { source ->
getUrlService.execute(GetUrlInDto(source)).also { dto ->
documentDao.insertDocumentIfo(
InsertDocumentIfoCommand(
path = documentName,
url = dto.url
)
) ?: throw InsertException("document.insertfail.record")
}
getUrlService.execute 결과 반환
.let { savedDocument ->
savedDocument.url
}
성공 반환에서 url만 추출하여 반환
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎫 연관 이슈
resolved: #372
💁♂️ PR 내용
🙏 작업
범위지정 함수 사용 구분
자신을 반환하는 경우
다른 값을 반환하는 경우
run(this): 자신의 프로퍼티를 반환하는 경우
let(it): 자신을 파라미터로 활용하여 람다를 수행한 결과를 반환하는 경우
query, dto에 사용한 let 제거 -> 바로 넘기는 것으로 수정
query, command suffix가 붙지 않는 객체 이름 통일
🙈 PR 참고 사항
📸 스크린샷
🤖 테스트 체크리스트