-
Notifications
You must be signed in to change notification settings - Fork 106
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
[4기 한승원] URL Shortener 과제 PR입니다. #48
base: seungwon
Are you sure you want to change the base?
Conversation
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.
승원님 코드 잘 봤습니다! 깔끔하게 코드 잘 짜신 것 같고, 리뷰 드리면서 제가 많이 배워가는 것 같습니다 ㅎㅎ 바쁜 일정에 과제 하시느라 고생 많으셨어요~ 👍
|
||
private String originalUrl; |
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.
엔티티에도 originalUrl에 nullable=false 처리를 해주시는 건 어떨까요?!
private String originalUrl; | |
@Column(nullable = false) | |
private String originalUrl; |
UrlValidator validator = new UrlValidator(); | ||
|
||
return validator.isValid(url); |
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.
UrlValidator로 유효성 검사 하는 방법도 있군요 ! 배워갑니다 👍
private final Bucket bucket = Bucket.builder() | ||
.addLimit(Bandwidth.simple(CAPACITY, Duration.ofMinutes(DURATION))) | ||
.build(); |
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.
Bucket4j로 처리율을 제한하셨군요 👍
Optional<Url> findByShortUrlKey(@Param("shortUrlKey") String shortUrlKey); | ||
|
||
int countByOriginalUrl(@Param("originalUrl") String originalUrl); |
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.
Optional<Url> findByShortUrlKey(@Param("shortUrlKey") String shortUrlKey); | |
int countByOriginalUrl(@Param("originalUrl") String originalUrl); | |
Optional<Url> findByShortUrlKey(String shortUrlKey); | |
int countByOriginalUrl(String originalUrl); |
@param을 제거해도 문제 없을 것 같습니다 ㅎㅎ
📌 과제 설명
사용자가 입력한 url에 대해 더 짧은 형태인 단축 url을 제공하는 서비스 입니다
👩💻 요구 사항과 구현 내용
https://shortenworld.kro.krScreen.Recording.2023-10-09.at.10.54.46.PM.mov