[5기 손가현] Shorten-URL 과제 제출합니다.#72
Open
hyun2371 wants to merge 14 commits intoprgrms-be-devcourse:hyun2371from
Open
[5기 손가현] Shorten-URL 과제 제출합니다.#72hyun2371 wants to merge 14 commits intoprgrms-be-devcourse:hyun2371from
hyun2371 wants to merge 14 commits intoprgrms-be-devcourse:hyun2371from
Conversation
ghost
approved these changes
Dec 23, 2023
ghost
left a comment
There was a problem hiding this comment.
과제 고생하셨습니다~!!
질문 주신 부분들은 해당 부분에 답글 달았습니다!
Comment on lines
+25
to
+27
| Url savedUrl = getSavedUrl(request.originUrl()); | ||
|
|
||
| savedUrl.increaseRequestCount(); |
There was a problem hiding this comment.
질문주신 orElseGet 으로 처리해도 괜찮을 것 같습니다. 다만 개선하면 좋을 포인트가 있습니다.
- 트랜잭션 범위를 줄여도 괜찮을 것 같습니다.
- 위 경우대로 값을 불러오면 처음 생성한 url 도 요청수가 +1 되서 나오게 됩니다.
| @InjectMocks | ||
| private UrlService service; | ||
|
|
||
| @DisplayName("Base62인코딩으로 shortenUrl을 생성할 수 있다.") |
There was a problem hiding this comment.
테스트 작성해주신 부분은 좋지만 추가되면 좋을 부분이 있습니다.
테스트만 봤을 때는 요구사항을 만족하는지 알 수가 없습니다.
- 8글자 이내로 생성되었는지?
- 요청 수가 저장되었는지?
This file contains hidden or 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
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.
📌 과제 설명
원본 url을 shortUrl로 변환해주는 애플리케이션입니다.
요구사항
각 요구사항을 모두 충족할 수 있도록 노력해봅시다.
구현 내용
구현 이미지
사용자가 url을 넣어주면 shortUrl로 변환합니다.
해당 shortUrl 클릭시 사용자가 붙여넣은 url로 이동됩니다.
✅ PR 포인트 & 궁금한 점
optional.orElseGet(()->repository.save(urlEntity))을 사용하는게 더 나은 방법일지 궁금합니다.