Skip to content
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기 임수진] SprintBoot URL Shortener 구현 미션 제출합니다. #66

Open
wants to merge 17 commits into
base: suzzingV
Choose a base branch
from

Conversation

suzzingV
Copy link

📌 과제 설명

  • URL 입력폼 제공 및 결과 출력
  • URL Shortening Key는 8 Character 이내로 생성
  • 단축된 URL 요청시 원래 URL로 리다이렉트
  • 단축된 URL에 대한 요청 수 정보저장 (optional)
  • Shortening Key를 생성하는 알고리즘 2개 이상 제공하며 애플리케이션 실행중 동적으로 변경 가능 (optional)

👩‍💻 요구 사항과 구현 내용

short url을 생성하는 알고리즘

  • sha 256 해싱 -> base 62 인코딩
  • sequence 해싱 -> base 62 인코딩

controller

  • 요청 값을 받고 응답값을 반환하는 controller을 넣었습니다.

domain

  • Url 엔티티를 담았습니다.

dto

  • url의 응답 dto, 요청 dto를 담았습니다.

exception

  • custom exception을 담았습니다.

handler

  • global handler exception을 담았습니다.

repository

  • jpa 리포지토리를 담았습니다.

service

  • url의 비즈니스 로직을 구현한 service를 담았습니다.
    #utils
  • 해싱과 인코딩에 필요한 클래스들을 모았습니다.

✅ PR 포인트 & 궁금한 점

유효성 검사를 service 로직에서 하는 것이 좋다고 해서 service에 @Valid 를 사용해 유효성 검사를 해봤는데, service에서 유효성 검사를 할 땐 이렇게 어노테이션을 사용하기보다 validator을 구현해 쓰는 것이 좋은지 궁금합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant