- 
                Notifications
    You must be signed in to change notification settings 
- Fork 105
[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
          
     Open
      
      
            JeongeunChoi
  wants to merge
  15
  commits into
  prgrms-be-devcourse:JeongeunChoi
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
JeongeunChoi:JeongeunChoi
  
      
      
   
  
    
  
  
  
 
  
      
    base: JeongeunChoi
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.
          
          
  
     Open
                    Changes from 1 commit
      Commits
    
    
            Show all changes
          
          
            15 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      d7def34
              
                init: 프로젝트 초기 설정
              
              
                JeongeunChoi 14f5576
              
                feat: Url 엔터티 생성
              
              
                JeongeunChoi bb9a605
              
                feat: UrlRepository 생성
              
              
                JeongeunChoi 37dc9c3
              
                feat: Base62 인코딩 디코딩 알고리즘 구현
              
              
                JeongeunChoi 06f74a8
              
                feat: 단축 url 생성 서비스 로직 구현
              
              
                JeongeunChoi a59b5e4
              
                feat: 단축 url을 기존 url 반환하는 서비스 로직 구현
              
              
                JeongeunChoi 6cf971e
              
                feat: 요청 수 정보 저장 기능 추가
              
              
                JeongeunChoi be2d0e5
              
                feat: 단축 url 생성 및 반환 요청을 위한 컨트롤러 및 결과 출력 html 추가
              
              
                JeongeunChoi 4e624a2
              
                feat: url 관련 예외 코드 및 커스텀 예외 생성
              
              
                JeongeunChoi fee5af2
              
                feat: 유효하지 않은 기존 url 예외 처리 추가
              
              
                JeongeunChoi 2f35454
              
                feat: 존재하지 않는 단축 url 예외 처리 추가
              
              
                JeongeunChoi bea61ca
              
                feat: 단축 url 생성 요청 dto 추가
              
              
                JeongeunChoi f510a9a
              
                feat: 예외 처리 핸들러 추가 및 출력 html 추가
              
              
                JeongeunChoi c95d11f
              
                test: UrlController 테스트 코드 추가
              
              
                JeongeunChoi 4f037a5
              
                test: UrlService 테스트 코드 추가
              
              
                JeongeunChoi 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
There are no files selected for viewing
        
          
          
            28 changes: 28 additions & 0 deletions
          
          28 
        
  src/main/java/com/springboot/springbooturlshortner/domain/Url.java
  
  
      
      
   
        
      
      
    
  
    
      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
    
  
  
    
              | 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; | ||
| } | ||
| } | ||
  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.
생성/수정 일시는 따로 필요없을까요?