-
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 과제 제출 #40
Open
Hchanghyeon
wants to merge
28
commits into
changhyeonh
Choose a base branch
from
changhyeonh-feature
base: changhyeonh
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.
+1,401
−14
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
e94b801
feat: 입력 폼 페이지 구현
Hchanghyeon 5219f38
build: validation 의존성 추가
Hchanghyeon 443a96a
feat: 분리되어있던 페이지 통합, 프론트엔드 구현
Hchanghyeon 910b678
build: JPA, H2 Database 사용을 위한 yml파일 설정
Hchanghyeon b2e7a79
chore: 페이지를 통합하면서 필요 없는 페이지 삭제
Hchanghyeon ab6fdfe
feat: Url 도메인 구현
Hchanghyeon 6233638
feat: JpaAudting 기능 추가
Hchanghyeon 3fde736
feat: 10진수를 Base62로 변환하는 컨버터 생성
Hchanghyeon 9a77c4f
feat: URL을 검증하는 Validator 구현
Hchanghyeon 5b17cb3
feat: Url Repository 생성 및 Lock과 기본 조회 로직 구현
Hchanghyeon df14a51
feat: Url Service 로직 구현
Hchanghyeon 0ff6b6b
feat: Url Controller 로직 구현
Hchanghyeon 74b2b14
feat: WebConfig로 ViewController 설정
Hchanghyeon 8a92e3a
feat: 예외 처리 구현
Hchanghyeon 5210f20
chore: 불필요한 테스트 코드 삭제
Hchanghyeon 1246112
test: Repository, Domain 테스트 구현
Hchanghyeon 14f5a61
style: class import
Hchanghyeon 3554631
feat: Url 도메인 null 예외처리
Hchanghyeon b4828f1
style: 개행 처리
Hchanghyeon 88552d9
style: 페이지에서 MD5 알고리즘 삭제
Hchanghyeon 413974e
style: 개행 삭제
Hchanghyeon c24d8ca
refactor: IP DTO에서 받지 않도록 변경
Hchanghyeon dd539b5
refactor: unique로 변경
Hchanghyeon de6991e
style: ViewCount로 이름 변경
Hchanghyeon 1ced81b
refactor: 분기문이 아닌 Enum에서 처리
Hchanghyeon 4e45131
refactor: 빈 생성자 삭제
Hchanghyeon 55b4a31
refactor: 비관적 락 적용 삭제
Hchanghyeon 9fd79f2
refactor: column default 값 설정
Hchanghyeon 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: 10진수를 Base62로 변환하는 컨버터 생성
commit 3fde736ae9db4223b0f04a00ab07d9bd18becc45
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/com/programmers/urlshortener/common/converter/Base62Converter.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,22 @@ | ||
package com.programmers.urlshortener.common.converter; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class Base62Converter { | ||
|
||
private static final String ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | ||
private static final int BASE = ALPHABET.length(); | ||
|
||
public static String encode(int value) { | ||
StringBuilder sb = new StringBuilder(); | ||
|
||
while (value != 0) { | ||
sb.append(ALPHABET.charAt(value % BASE)); | ||
value /= BASE; | ||
} | ||
|
||
return sb.reverse().toString(); | ||
} | ||
} |
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.
원본 URL의 값을 DB에 저장하기 때문에 굳이 디코딩할 필요가 없다고 생각되어 만들지 않았습니다.