Skip to content

Conversation

@JangIkhwan
Copy link
Collaborator

@JangIkhwan JangIkhwan commented Jan 4, 2026

Related issue 🛠

Work Description 📝

  • PM님과 논의한 결과 프로필 이미지 값은 프론트에서 관리하는 방식으로 변경되어서 프로필 이미지 관련 로직을 제거했습니다.
    • 프로필 수정 API (PATCH /users/me/profile-image)가 삭제되었습니다.
    • 회원정보 등록 API (POST /users)의 요청에서 프로필 이미지 관련 정보를 포함하지 않도록 수정했습니다. Multipart로 받는 요청을 json으로 받도록 수정했습니다.
    • 또한 프로필 조회 API (GET /users/me)의 응답에서 프로필 이미지를 삭제했습니다.
  • 그리고 이슈 #148에서 회원 정보 등록 API에서 리프레시 토큰을 발급하도록 수정하는 걸 누락했음을 알게 되어서, 이와 관련해서 기능 수정 및 리팩토링을 진행했습니다.

Screenshot 📸

Uncompleted Tasks 😅

To Reviewers 📢

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 만료된 토큰 갱신 API 추가 - 리프레시 토큰으로 새 액세스 토큰 발급 가능
    • 보호 중인 보고서 무작위 조회 기능 추가 - S3 저장 이미지 포함
    • 게스트 계정 확인 기능 추가 - 현재 사용자의 게스트 여부 조회 가능
    • 보고서 카드에 생성 날짜 표시
  • 기능 제거

    • 프로필 이미지 변경 기능 제거

✏️ Tip: You can customize this high-level summary in your review settings.

- BREAKING CHANGE : 프로필 수정 API를 삭제. 프론트에서는 프로필 수정 기능을 제거해야함
- BREAKING CHANGE : 응답에서 profileImage 필드를 삭제. 프론트에서 수정 필요
- 생성자의 인자에서 프로필 이미지를 제거
- BREAKING CHANGE : 요청에서 profileImageFile과 defaultProfileImageName 제거. 프론트 수정 필요.
- 필요한 모킹 수정
- 리프레시 토큰 반환 여부 검증 추가
@coderabbitai
Copy link

coderabbitai bot commented Jan 4, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

토큰 재발급 API와 Redis 기반 리프레시 토큰 관리를 구현하고, 프로필 이미지 기능을 제거하며, 보호 보고서의 S3 조회 및 createdAt 필드를 추가하고, 인증 서비스를 리팩토링합니다.

Changes

Cohort / File(s) Summary
토큰 재발급 및 발급 기능
src/main/java/com/kuit/findyou/domain/auth/dto/ReissueToken*
src/main/java/com/kuit/findyou/domain/auth/service/IssueTokenService*
src/main/java/com/kuit/findyou/domain/auth/service/ReissueTokenService*
src/main/java/com/kuit/findyou/domain/auth/repository/RedisRefreshToken*
토큰 재발급 요청/응답 DTO, 리프레시 토큰 발급/검증 서비스, Redis 기반 리프레시 토큰 저장소 인터페이스/구현 추가
인증 서비스 리팩토링
src/main/java/com/kuit/findyou/domain/auth/service/LoginService*
src/main/java/com/kuit/findyou/domain/auth/service/AuthServiceFacade.java
src/main/java/com/kuit/findyou/domain/auth/controller/AuthController.java
AuthService → LoginService 이름 변경, 토큰 발급 로직 IssueTokenService로 위임, AuthServiceFacade 도입으로 서비스 계층 통합, 새로운 reissueToken 엔드포인트 추가
로그인/등록 응답 확장
src/main/java/com/kuit/findyou/domain/auth/dto/response/KakaoLoginResponse.java
src/main/java/com/kuit/findyou/domain/auth/dto/response/GuestLoginResponse.java
src/main/java/com/kuit/findyou/domain/user/dto/response/RegisterUserResponse.java
모든 로그인/등록 응답에 refreshToken 필드 추가, 토큰 생성 방식 변경
프로필 이미지 기능 제거
src/main/java/com/kuit/findyou/domain/user/service/change_profileImage/*
src/main/java/com/kuit/findyou/domain/user/dto/request/RegisterUserRequest.java
src/main/java/com/kuit/findyou/domain/user/dto/response/GetUserProfileResponse.java
src/main/java/com/kuit/findyou/domain/user/model/User.java
src/main/java/com/kuit/findyou/domain/user/controller/UserController.java
ChangeProfileImageService 및 구현 삭제, 관련 엔드포인트 제거, RegisterUserRequest에서 프로필 이미지 필드 제거, GetUserProfileResponse 간소화
게스트 체크 기능 추가
src/main/java/com/kuit/findyou/domain/user/dto/response/CheckGuestResponse.java
src/main/java/com/kuit/findyou/domain/user/controller/UserController.java
src/main/java/com/kuit/findyou/domain/user/service/query/QueryUserService*
src/main/java/com/kuit/findyou/domain/user/service/facade/UserServiceFacade.java
CheckGuestResponse 신규 DTO, 게스트 여부 확인 엔드포인트 및 서비스 추가
등록 프로세스 개선
src/main/java/com/kuit/findyou/domain/user/service/register/RegisterUserServiceImpl.java
프로필 이미지 로직 제거, IssueTokenService로 토큰 관리 통합
보호 보고 S3 조회 기능
src/main/java/com/kuit/findyou/domain/report/service/retrieve/ProtectingReportRetrieveWithS3Service*
src/main/java/com/kuit/findyou/domain/report/controller/ReportController.java
어제자 보호 보고서를 무작위로 조회하고 S3에 업로드하여 반환하는 신규 엔드포인트/서비스
Report 생성 시간 정보 추가
src/main/java/com/kuit/findyou/domain/report/dto/response/Card.java
src/main/java/com/kuit/findyou/domain/report/dto/response/ReportProjection.java
src/main/java/com/kuit/findyou/domain/report/repository/*Repository.java
src/main/java/com/kuit/findyou/domain/report/factory/CardFactory.java
src/main/java/com/kuit/findyou/domain/report/service/detail/strategy/ProtectingReportDetailStrategy.java
createdAt 필드를 모든 Report 관련 DTO, Repository 쿼리, 팩토리에 추가
파일 업로드 확장
src/main/java/com/kuit/findyou/global/infrastructure/ImageUploader.java
src/main/java/com/kuit/findyou/global/infrastructure/S3ImageUploader.java
byte\[\] 기반 파일 업로드 메서드 오버로드 추가 (기존 MultipartFile 방식 유지)
JWT 및 토큰 설정
src/main/java/com/kuit/findyou/global/jwt/util/JwtUtil.java
src/main/java/com/kuit/findyou/global/config/SecurityConfig.java
src/main/resources/application.yml
src/test/resources/application-test.yml
리프레시 토큰 생성 메서드 추가, 토큰 만료 설정 구조 개선, 새 엔드포인트 보안 규칙 추가
예외 및 문서화
src/main/java/com/kuit/findyou/global/common/response/status/BaseExceptionResponseStatus.java
src/main/java/com/kuit/findyou/global/common/swagger/SwaggerResponseDescription.java
REFRESH_TOKEN_NOT_FOUND 예외 상수 추가, Swagger 문서화 업데이트
인프라 구성
src/main/java/com/kuit/findyou/global/config/WebConfig.java
RestTemplate 빈 추가 (외부 이미지 다운로드용)
테스트 업데이트
src/test/java/com/kuit/findyou/domain/auth/controller/AuthControllerTest.java
src/test/java/com/kuit/findyou/domain/auth/service/LoginServiceTest.java
src/test/java/com/kuit/findyou/domain/auth/service/ReissueTokenServiceImplTest.java
토큰 재발급 테스트 추가, 기존 로그인 테스트 리팩토링, Redis 테스트 환경 통합
Report 테스트 업데이트
src/test/java/com/kuit/findyou/domain/report/controller/ReportControllerTest.java
src/test/java/com/kuit/findyou/domain/report/service/retrieve/ProtectingReportRetrieveWithS3ServiceImplTest.java
src/test/java/com/kuit/findyou/domain/report/factory/CardFactoryTest.java
S3 조회 기능 테스트 추가, createdAt 필드 검증, 이미지 업로드 모킹
User 테스트 정리
src/test/java/com/kuit/findyou/domain/user/controller/UserControllerTest.java
src/test/java/com/kuit/findyou/domain/user/service/register/RegisterUserServiceTest.java
src/test/java/com/kuit/findyou/domain/user/service/query/QueryUserServiceTest.java
src/test/java/com/kuit/findyou/domain/user/service/*
프로필 이미지 관련 테스트 제거, 등록 프로세스 테스트 추가, JSON 기반 요청으로 전환, 게스트 체크 테스트 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant AuthController
    participant AuthServiceFacade
    participant ReissueTokenService
    participant JwtUtil
    participant RedisRefreshTokenRepository
    participant UserRepository
    
    rect rgb(200, 220, 230)
    note over Client,UserRepository: Token Reissue Flow
    Client->>AuthController: POST /reissue/token<br/>(ReissueTokenRequest)
    AuthController->>AuthServiceFacade: reissueToken(request)
    AuthServiceFacade->>ReissueTokenService: reissueToken(request)
    ReissueTokenService->>JwtUtil: extractUserId(refreshToken)
    JwtUtil-->>ReissueTokenService: userId
    ReissueTokenService->>RedisRefreshTokenRepository: findByUserId(userId)
    RedisRefreshTokenRepository-->>ReissueTokenService: Optional<storedToken>
    alt Token Valid & Stored
        ReissueTokenService->>UserRepository: findById(userId)
        UserRepository-->>ReissueTokenService: User
        ReissueTokenService->>JwtUtil: createAccessJwt(userId, role)
        JwtUtil-->>ReissueTokenService: newAccessToken
        ReissueTokenService->>JwtUtil: createRefreshJwt(userId)
        JwtUtil-->>ReissueTokenService: newRefreshToken
        ReissueTokenService->>RedisRefreshTokenRepository: save(userId, newRefreshToken)
        ReissueTokenService-->>AuthServiceFacade: ReissueTokenResponse
        AuthServiceFacade-->>AuthController: ReissueTokenResponse
        AuthController-->>Client: 200 OK<br/>(accessToken, refreshToken)
    else Token Expired/Invalid
        ReissueTokenService-->>AuthController: CustomException(EXPIRED_JWT)
        AuthController-->>Client: 401 Unauthorized
    else Token Not Matched
        ReissueTokenService-->>AuthController: CustomException(REFRESH_TOKEN_NOT_FOUND)
        AuthController-->>Client: 404 Not Found
    end
    end
Loading
sequenceDiagram
    participant Client
    participant ReportController
    participant ProtectingReportRetrieveWithS3ServiceImpl
    participant ProtectingReportRepository
    participant RestTemplate
    participant ImageUploader
    participant ProtectingReportDetailStrategy
    
    rect rgb(230, 220, 200)
    note over Client,ProtectingReportDetailStrategy: Random Protecting Reports with S3 Retrieval
    Client->>ReportController: GET /api/v2/reports/protecting-reports/random-s3?count=X
    ReportController->>ProtectingReportRetrieveWithS3ServiceImpl: getRandomProtectingReportsWithS3(count)
    ProtectingReportRetrieveWithS3ServiceImpl->>ProtectingReportRepository: findByDate(yesterday)
    ProtectingReportRepository-->>ProtectingReportRetrieveWithS3ServiceImpl: List<ProtectingReport>
    loop For each report (up to count)
        loop For each image URL
            ProtectingReportRetrieveWithS3ServiceImpl->>RestTemplate: getForObject(originalImageUrl)
            RestTemplate-->>ProtectingReportRetrieveWithS3ServiceImpl: byte[] imageContent
            alt Image Download Success
                ProtectingReportRetrieveWithS3ServiceImpl->>ImageUploader: upload(bytes, filename, contentType)
                ImageUploader-->>ProtectingReportRetrieveWithS3ServiceImpl: s3Url
            else Image Download Failed
                ProtectingReportRetrieveWithS3ServiceImpl->>ProtectingReportRetrieveWithS3ServiceImpl: log error & skip
            end
        end
        ProtectingReportRetrieveWithS3ServiceImpl->>ProtectingReportDetailStrategy: toDetailDto(report, s3Urls, false)
        ProtectingReportDetailStrategy-->>ProtectingReportRetrieveWithS3ServiceImpl: ProtectingReportDetailResponseDTO
    end
    ProtectingReportRetrieveWithS3ServiceImpl-->>ReportController: List<ProtectingReportDetailResponseDTO>
    alt Results Not Empty
        ReportController-->>Client: 200 OK<br/>(BaseResponse<List<DTO>>)
    else Results Empty
        ReportController-->>Client: 204 No Content
    end
    end
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~90+ minutes

Possibly related issues

  • [Feat!] 프로필 수정 기능 삭제 #159 — 프로필 이미지 편집 기능 제거 관련으로, ChangeProfileImageService 삭제, UserController 엔드포인트 제거, 관련 DTO/테스트 제거 등이 직접 구현되어 있습니다.
  • [Feat] 토큰 재발급 API 구현 #148 — 토큰 재발급 API 구현 관련으로, ReissueTokenService, Redis 리프레시 토큰 저장소, 관련 DTO 및 컨트롤러 엔드포인트가 직접 구현되어 있습니다.

Possibly related PRs

Suggested reviewers

  • ksg1227
  • JJUYAAA

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning 대부분의 변경사항이 #148과 #159의 범위 내에 있습니다. 다만 ReportController의 새로운 S3 관련 엔드포인트와 Report 응답에 createdAt 필드 추가는 링크된 이슈와 무관합니다. ReportController의 getRandomProtectingReportsWithS3 엔드포인트와 Card/ReportProjection의 createdAt 필드 추가 관련 변경사항은 별도 이슈로 분리하거나 범위 설명을 추가하세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.81% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경 내용의 주요 포인트를 정확하게 반영하고 있습니다. 프로필 수정 기능 제거와 회원정보 등록 API의 리프레시 토큰 반환이 명확하게 표시되어 있습니다.
Linked Issues check ✅ Passed PR이 #148(토큰 재발급 API 구현)의 요구사항을 충족합니다. 토큰 재발급 API, 토큰 이슈 서비스, 리프레시 토큰 관리, 관련 테스트와 Swagger 문서가 모두 구현되었습니다.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JangIkhwan JangIkhwan changed the base branch from main to develop January 4, 2026 13:13
@github-actions
Copy link

github-actions bot commented Jan 4, 2026

Test Results

372 tests   372 ✅  56s ⏱️
 94 suites    0 💤
 94 files      0 ❌

Results for commit 0fbf3b8.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

📊 JaCoCo Coverage

Overall Project 83.05% 🍏
Files changed 100% 🍏

File Coverage
RegisterUserServiceImpl.java 100% 🍏
QueryUserServiceImpl.java 100% 🍏
UserServiceFacade.java 100% 🍏
LoginServiceImpl.java 100% 🍏
IssueTokenServiceImpl.java 100% 🍏
UserController.java 97.37% 🍏

@JangIkhwan JangIkhwan force-pushed the feat/#159-remove-profile-image-function branch from 7d4fbe1 to fab1d9e Compare January 4, 2026 14:22
@JangIkhwan JangIkhwan requested review from JJUYAAA and ksg1227 and removed request for JJUYAAA January 4, 2026 14:36
Copy link
Collaborator

@ksg1227 ksg1227 left a comment

Choose a reason for hiding this comment

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

확인했습니당

@JangIkhwan JangIkhwan merged commit 2b5aae6 into develop Jan 7, 2026
4 checks passed
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.

[Feat] 토큰 재발급 API 구현

3 participants