Skip to content

8주차 미션 [루가]#19

Open
ochyeon wants to merge 52 commits into
mainfrom
luga/week8
Open

8주차 미션 [루가]#19
ochyeon wants to merge 52 commits into
mainfrom
luga/week8

Conversation

@ochyeon
Copy link
Copy Markdown
Collaborator

@ochyeon ochyeon commented May 21, 2026

📌 구현 결과

  1. Spring Security 적용하여 회원가입 API 구현
  • build.gradle에 의존성 추가

  • User Entity에 password, role 추가

  • password는 8자 이상, role은 USER, ADMIN

  • UserService에 BCrypt 적용 (passwordEncoder)

  • global에 SecurityConfig 추가 -> UserService로 Bean 주입

  • 구현 결과 : MySQL WorkBench에서 테스트 진행

BCrypt 암호화 정상 적용 확인
  1. 회원가입 API는 Public으로, 나머지는 Private으로 설정
  • global에 AuthErrorCode 생성 : 4001(인증 필요), 4003(권한 없음)

  • 4001, 4003에 대한 EntryPoint & Handler 추가

  • SecurityConfig에 ExceptionHandling 추가 & 응답 형식 통일

  • 구현 결과 : Swagger에서 Try out
    [회원 가입 : Public API -> 정상적으로 가입되는 것을 확인함]

회원가입 성공 (Public API)

[Private API -> 리뷰 목록 확인 API를 활용하여 테스트, 4001 에러 코드 확인함]
인증 확인 (Private API)

❓ 리뷰 요청

🤔 질문

💬 기타 공유 사항

[7주차 미션 수정 사항]

  • 별점 정렬 시 grade & id 중복 cursor 적용
  • sort null 검증 및 기본값 추가

ochyeon and others added 30 commits April 9, 2026 06:01
…(record 사용, 엔드포인트 수정 및 스웨거 명세 추가)
Copy link
Copy Markdown
Member

@yangjiae12 yangjiae12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

회원가입을 기존에 구현해두신 것 같은데 8주차 미션 요구사항에 맞춰 수정하면 좋을 것 같습니다~

public record SignupReqDto (
@NotBlank String name,
@NotBlank @Email String email,
@NotBlank @Size(min = 0, message = "비밀번호는 8자 이상이어야 합니다.") String password,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

비밀번호 검증에서 @Size(min = 0)으로 되어 있어 메시지의 “8자 이상” 조건과 실제 검증 조건이 맞지 않는 것 같습니다. min = 8로 수정하면 좋을 것 같습니다!

Comment on lines +22 to +24
@Transactional
public UserResDto.SignupResDto signup(UserReqDto.SignupReqDto request) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

회원가입 요구사항에 약관 동의가 포함되므로 현재 요청 DTO와 서비스 로직에 약관동의 관련 로직을 추가하면 좋겠습니다!

Comment on lines +36 to +38
@Transactional
public UserResDto.AddFoodPreferenceResDto addFoodPreference(
Long userId, UserReqDto.AddFoodPreferenceReqDto request) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SignupReqDto에 음식 리스트를 포함하고 회원가입 트랜잭션 안에서 함께 저장하는 방식도 고려하면 좋을 것 같습니다.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants