-
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
[5기 조인수] Shorten URL 과제 PR입니다. #71
Open
ZZAMBAs
wants to merge
42
commits into
prgrms-be-devcourse:ZZAMBAs
Choose a base branch
from
ZZAMBAs:main
base: ZZAMBAs
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+935
−0
Open
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
8a638f9
Initial commit
ZZAMBAs 476b930
Feat: short url에 대한 도메인 클래스와 스키마를 추가한다.
ZZAMBAs 7ddf83f
Feat: ShortUrlRepository를 추가한다.
ZZAMBAs f545f35
Feat: int 값을 6자리 BASE62 문자열로 인코딩하는 UrlTransformer를 추가한다.
ZZAMBAs 9e9b702
Feat: ShortUrl에 빌더 패턴을 추가한다.
ZZAMBAs c9891ae
Feat: UrlTransformer를 인터페이스 형식으로 변경하고 BASE62 기반 구현체를 추가한다.
ZZAMBAs ee7e781
Feat: Url 처리 관련 예외, 에러코드 클래스를 추가한다.
ZZAMBAs 77d1b9e
Chore: MySQL을 사용하도록 빌드 파일과 yml 파일의 내용을 수정한다.
ZZAMBAs 960b602
Fix: 일부 잘못된 환경 설정, visitCount를 더하는 쿼리를 제대로 수정한다.
ZZAMBAs 6b261f9
Feat: 코드를 가독성 좋게 수정하고 ShortUrl에서 방문 카운트를 올리는 메서드를 추가한다.
ZZAMBAs 7643d3c
Feat: URL 저장, 가져오기를 구현한 서비스를 추가한다.
ZZAMBAs 41e8704
Test: 테스트용 yml 파일을 생성한다.
ZZAMBAs c26e7e5
Fix: 랜덤 정수가 음수가 되지 않도록 수정한다.
ZZAMBAs 7d638e7
Feat: null은 쿼리에 포함시키지 않도록 하고 originalUrl에 getter를 추가한다.
ZZAMBAs 9172394
Test: shortUrlService의 기능을 테스트하는 코드를 추가한다.
ZZAMBAs 2b83465
Feat: saveOriginalUrl()에서 이미 저장된 original Url은 바로 반환하도록 한다.
ZZAMBAs 4f9300b
Test: 이미 저장된 url에 대해 같은 url을 반환하는 테스트를 추가한다.
ZZAMBAs 2853a6d
Rename: 패키지를 세분화한다.
ZZAMBAs 027c909
Feat: 최초 페이지를 생성한다.
ZZAMBAs b41f1de
Feat: 빠른 탐색을 위해 인덱싱을 추가한다.
ZZAMBAs 9970d68
Feat: DTO를 추가하고 적용한다.
ZZAMBAs d069253
Test: DTO에 맞게 테스트 코드를 수정하고, short url 방문 시 업데이트 되는지 확인하는 테스트를 추가한다.
ZZAMBAs c0c134c
Feat: 변환 URL을 보여주는 페이지를 추가한다.
ZZAMBAs df62215
Feat: ShortUrl 관련 공통 상수를 관리하는 클래스를 추가한다.
ZZAMBAs 9dc80e2
Feat: ShortUrl 관련 공통 메서드를 관리하는 클래스를 추가한다.
ZZAMBAs da170d3
Feat: HTTP 프로토콜을 제거하여 DB 저장 공간을 절약한다.
ZZAMBAs 1093c0c
Feat: favicon.ico를 불러오지 않도록 하는 MVC 설정을 추가한다.
ZZAMBAs e51224f
Feat: ShortUrl 처리 컨트롤러를 추가한다.
ZZAMBAs 7077d58
Feat: ShortUrl 복사 기능을 추가한다.
ZZAMBAs 3853796
Feat: 잘못된 요청 혹은 서버 예외에 대한 컨트롤러 처리를 추가한다.
ZZAMBAs 237dc39
Feat: 변환 URL 정보에 원본 URL도 나타나도록 한다.
ZZAMBAs 2f4e65b
Feat: originalUrl을 고유하도록 컬럼 속성을 추가한다.
ZZAMBAs db1d232
Refactor: stream을 이용하여 간략화한다.
ZZAMBAs d30ee0b
feat: 예외 처리를 위한 Controller를 따로 생성한다.
ZZAMBAs ff371c7
Refactor: 에러 코드를 HTTP와 강결합되지 않도록 자체 코드로 수정한다.
ZZAMBAs 9ea0a29
Refactor: BASE62의 62를 상수로 관리한다.
ZZAMBAs 3a248f5
Chore: 상수 네이밍을 통일한다.
ZZAMBAs 507ebba
Rename: 이미 클래스 명에 URL임이 명시되어 있기에 더 직관적인 메서드 명으로 변경한다.
ZZAMBAs 8081b48
Chore: 일부 코드를 다듬는다.
ZZAMBAs 817e9eb
Refactor: 메서드 내부로 랜덤 정수 만드는 로직을 포함시킨다.
ZZAMBAs bc3dbb5
Refactor: 리다이렉트 서버가 변경될 것을 생각해 상수화한다.
ZZAMBAs 0a15a04
Chore: 사용하지 않는 import 문을 정리한다.
ZZAMBAs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Feat: ShortUrl 관련 공통 메서드를 관리하는 클래스를 추가한다.
commit 9dc80e23f6e425b7e2bd22de4ac70ebcbba6dd42
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/main/java/org/prgms/springbooturlshortener/domain/shorturl/common/ShortUrlUtil.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.prgms.springbooturlshortener.domain.shorturl.common; | ||
|
||
public class ShortUrlUtil { | ||
public static String deleteProtocol(String originalUrl) { | ||
for (String protocol: ShortUrlConstant.PROTOCOLS) { | ||
if (originalUrl.startsWith(protocol)) { | ||
originalUrl = originalUrl.replace(protocol, ""); | ||
} | ||
} | ||
|
||
return originalUrl; | ||
} | ||
} |
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.
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.
stream을 통해서 표현해봐도 좋을 것 같네요.
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.
수정해 보겠습니다!