-
Notifications
You must be signed in to change notification settings - Fork 103
[5기 최정은] Shorten-URL 과제 제출합니다. #68
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
base: JeongeunChoi
Are you sure you want to change the base?
Changes from 1 commit
d7def34
14f5576
bb9a605
37dc9c3
06f74a8
a59b5e4
6cf971e
be2d0e5
4e624a2
fee5af2
2f35454
bea61ca
f510a9a
c95d11f
4f037a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package com.springboot.springbooturlshortner.domain; | ||
|
|
||
| import com.springboot.springbooturlshortner.exception.UrlException; | ||
| import com.springboot.springbooturlshortner.exception.UrlExceptionCode; | ||
| import jakarta.persistence.*; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.extern.slf4j.Slf4j; | ||
|
|
||
| import java.util.regex.Pattern; | ||
|
|
||
| @Entity | ||
| @Table(name = "urls") | ||
| @NoArgsConstructor | ||
| @Getter | ||
| public class Url { | ||
|
|
||
| private static final String ORIGIN_URL_PATTERN = "^(https?://).*"; | ||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "indexGenerator") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mysql로 사용하는데 SEQUENCE 전략으로 설정하신 이유가 있나요? |
||
| @SequenceGenerator(name = "indexGenerator", initialValue = 10000) | ||
| private Long id; | ||
| @Column(name = "originUrl") | ||
| private String originUrl; | ||
|
Comment on lines
+24
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. originUrl는 유니크가 보장되지 않아도 되는건가요? 여러개의 originUrl에 대한 값이 생길 수 있을 것 같네요. |
||
| public Url(String originUrl) { | ||
| this.originUrl = originUrl; | ||
| } | ||
|
Comment on lines
28
to
47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 정상적으로 동작하는게 맞나요? 😄
|
||
| } | ||
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.
생성/수정 일시는 따로 필요없을까요?