Skip to content

Comments

[feature] cloudflare 이미지 업로드 기능 구현#502

Closed
PororoAndFriends wants to merge 158 commits intomainfrom
develop/be
Closed

[feature] cloudflare 이미지 업로드 기능 구현#502
PororoAndFriends wants to merge 158 commits intomainfrom
develop/be

Conversation

@PororoAndFriends
Copy link
Collaborator

@PororoAndFriends PororoAndFriends commented Jun 6, 2025

#️⃣연관된 이슈

ex) #424

Summary by CodeRabbit

  • 신규 기능

    • 동아리 지원서 작성, 수정, 조회, 제출을 위한 API 및 서비스가 추가되었습니다.
    • 동아리 지원서 폼 생성, 질문 유형, 답변 검증 등 지원서 관련 기능이 도입되었습니다.
    • 동아리 이미지(로고, 피드) 업로드 및 관리 기능이 Google Drive, AWS S3(Cloudflare) 등 다양한 스토리지로 확장되었습니다.
    • 동아리 소셜 링크 필드가 도입되어 여러 소셜 미디어 정보를 등록할 수 있습니다.
    • 동아리 모집 상태가 자동으로 갱신되는 스케줄러가 추가되었습니다.
  • 개선 및 변경

    • 기존 모집 폼(recruitmentForm) 필드가 소셜 링크(socialLinks)로 대체되었습니다.
    • 지원서, 질문, 답변 등 관련 데이터 구조 및 검증 로직이 강화되었습니다.
    • 비밀번호, 전화번호, 아이디 등 입력값 검증 로직이 개선되었습니다.
    • 동아리 이미지 관리 서비스 구조가 리팩토링되어 다양한 스토리지 구현체를 지원합니다.
  • 버그 수정

    • 시간대 관련 동작이 Asia/Seoul로 일관되게 처리됩니다.
    • 입력값 유효성 검사 및 오류 코드가 세분화되어 안내 메시지가 명확해졌습니다.
  • 테스트

    • 동아리 및 사용자 서비스, 이미지 업로드, 지원서 기능 등 다양한 단위/통합 테스트가 추가되었습니다.
    • 테스트용 Fixture 및 커스텀 어노테이션이 도입되어 테스트 코드 작성이 용이해졌습니다.
  • 기타

    • 불필요한 스케줄러 및 리포지토리 코드가 정리되었습니다.
    • 문서화 및 코드 스타일이 일부 개선되었습니다.

Due-IT and others added 30 commits May 1, 2025 00:40
- 메트릭이 이미 존재한다면 metric.update()를 호출하는지 검증합니다.
- 일일 활성 사용자수를 정확히 계산하는지 검증합니다.
- MetricFixture를 통해 ClubMetric을 mock객체로 정의하여 수정불가능한 값의 반환값을 직접 정의합니다.
- 일부 Club 정보가 누락되어도 null 포함하여 정상 동작해야 합니다.
- 반드시 1개 이상의 동아리를 조회해야 합니다.
- 하루 미만의 사용자수 요청시 빈배열을 반환합니다.
- ip 중복을 제거하여 카운트 합니다
- 하루 미만의 사용자수 요청시 빈배열을 반환합니다.
- ip 중복을 제거하여 카운트 합니다
- 같은 동아리에 대해 기존 스케줄이 존재하면 취소합니다.
- 모집 상태 업데이트를 성공하여 repository를 통해 저장합니다.
- 존재하지 않는 클럽 id에 대해 업데이트를 요청할시 예외를 발생합니다.
[feature] 구글 드라이브 업로드 기능 구현
lepitaaar and others added 23 commits May 19, 2025 15:32
[feature] 동아리 지원서 관련 기능 구현
[feature] cloudflare 이미지 저장 기능 구현
fix: 잘못된 비밀번호 검증 로직과 잘못된 비밀번호 테스트 수정
이미지 저장소 cloudflare로 고정
@netlify
Copy link

netlify bot commented Jun 6, 2025

Deploy Preview for moadong ready!

Name Link
🔨 Latest commit a5c6a16
🔍 Latest deploy log https://app.netlify.com/projects/moadong/deploys/68426b2acd12f000082d01c2
😎 Deploy Preview https://deploy-preview-502--moadong.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100
Accessibility: 69
Best Practices: 100
SEO: 90
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

이 변경사항은 동아리 지원서(Club Application) 기능, 이미지 저장소(Cloudflare, Google Drive, S3) 통합, 모집 일정 상태 자동 갱신, 사용자 정보 구조 개선, 그리고 테스트 환경 분리 및 확장 등 대규모 백엔드 기능 추가 및 리팩토링을 포함합니다. 새로운 엔티티, 서비스, 컨트롤러, 유효성 검사, 예외 코드, 테스트 코드가 다수 도입되었습니다.

Changes

파일/그룹 변경 요약
.gitignore, build.gradle 빌드 및 테스트 환경 개선, 의존성 추가, 테스트 태스크 분리
MoadongApplication.java @EnableScheduling 추가로 스케줄링 기능 활성화
동아리 지원서 관련
club/controller/ClubApplyController.java, club/service/ClubApplyService.java, club/entity/ClubApplication.java, club/entity/ClubApplicationQuestion.java, club/entity/ClubQuestion.java, club/entity/ClubQuestionAnswer.java, club/entity/ClubQuestionItem.java, club/entity/ClubQuestionOption.java, club/repository/ClubApplicationRepository.java, club/repository/ClubQuestionRepository.java, club/payload/request/ClubApplicationCreateRequest.java, club/payload/request/ClubApplicationEditRequest.java, club/payload/request/ClubApplyQuestion.java, club/payload/request/ClubApplyRequest.java, club/payload/response/ClubApplicationResponse.java, club/enums/ApplicationStatus.java, club/enums/ClubApplicationQuestionType.java
동아리 지원서 폼 생성, 수정, 조회, 제출 기능 및 관련 엔티티, 레포지토리, DTO, enum 추가
동아리 엔티티 및 DTO
club/entity/Club.java, club/payload/request/ClubInfoRequest.java, club/payload/dto/ClubDetailedResult.java
socialLinks 필드 추가, 관련 메서드 및 DTO 필드 수정
club/entity/ClubRecruitmentInformation.java, club/service/ClubProfileService.java 모집폼 필드 제거, null 체크 및 포맷팅 개선, 스케줄러 의존성 제거
club/service/RecruitmentStateChecker.java 모집 상태 자동 갱신 스케줄러 컴포넌트 신설
club/service/RecruitmentScheduler.java, global/config/SchedulerConfig.java 기존 모집 스케줄러 및 관련 설정 파일 삭제
club/entity/ClubMetric.java, club/service/ClubMetricService.java 시간대 명시("Asia/Seoul")로 시간 계산 일원화, 입력값 검증 추가
미디어/이미지 서비스
media/controller/ClubImageController.java, media/service/CloudflareImageService.java, media/service/ClubImageService.java, media/service/GcsClubImageService.java, media/service/GoogleDriveClubImageService.java, media/util/ClubImageUtil.java, media/util/GoogleDriveConfig.java, media/util/S3Config.java, media/domain/FileType.java, media/dto/FeedUpdateRequest.java
이미지 저장소 서비스(Cloudflare, Google Drive, S3) 통합 및 유틸, 컨트롤러, 설정, 파일명 유효성 검사, 리사이즈 기능 추가 및 개선
유효성 검사/예외
global/validator/PasswordValidator.java, global/validator/KoreanValidator.java, global/validator/PhoneNumberValidator.java, global/validator/UserIdValidator.java, global/exception/ErrorCode.java
패스워드, 한글, 전화번호, 아이디 유효성 검사 및 예외 코드 추가/주석 보강, 패턴 및 반환값 개선
사용자 엔티티/서비스
user/entity/User.java, user/entity/UserInformation.java, user/payload/request/UserRegisterRequest.java, user/service/UserCommandService.java, user/repository/UserInformationRepository.java
사용자 정보 구조 통합(UserInformation 필드화), 회원가입시 유효성 강화, 패스워드 암호화 개선, 불필요 레포지토리 삭제
테스트/Fixture/유틸
test/java/moadong/club/fixture/*, test/java/moadong/fixture/*, test/java/moadong/util/annotations/*, test/java/moadong/club/service/*, test/java/moadong/media/service/*, test/java/moadong/unit/club/ClubProfileServiceTest.java, test/java/moadong/unit/user/*
동아리/사용자/미디어 관련 Fixture, 테스트 유틸, 단위/통합 테스트 어노테이션, 서비스별 단위/통합 테스트 대거 추가

Sequence Diagram(s)

sequenceDiagram
actor User
participant ClubApplyController
participant ClubApplyService
participant ClubQuestionRepository
participant ClubApplicationRepository

User->>ClubApplyController: POST /api/club/{clubId}/application (생성/수정)
ClubApplyController->>ClubApplyService: createClubApplication / editClubApplication
ClubApplyService->>ClubQuestionRepository: findByClubId
alt 존재하지 않으면
    ClubApplyService->>ClubQuestionRepository: save (신규 생성)
end
ClubApplyService-->>ClubApplyController: 완료

User->>ClubApplyController: GET /api/club/{clubId}/apply
ClubApplyController->>ClubApplyService: getClubApplication
ClubApplyService->>ClubQuestionRepository: findByClubId
ClubApplyService-->>ClubApplyController: ClubApplicationResponse

User->>ClubApplyController: POST /api/club/{clubId}/apply (지원서 제출)
ClubApplyController->>ClubApplyService: applyToClub
ClubApplyService->>ClubQuestionRepository: findByClubId
ClubApplyService->>ClubApplicationRepository: save (지원서 저장)
ClubApplyService-->>ClubApplyController: 완료
Loading
sequenceDiagram
actor System
participant RecruitmentStateChecker
participant ClubRepository

Note over RecruitmentStateChecker: 매 시간마다 스케줄 실행
RecruitmentStateChecker->>ClubRepository: findAll()
loop 각 Club
    RecruitmentStateChecker->>Club: 모집시작/종료일, 상태 확인
    alt 상태 변화 필요
        RecruitmentStateChecker->>Club: 상태 업데이트
        RecruitmentStateChecker->>ClubRepository: save(Club)
    end
end
Loading
sequenceDiagram
actor User
participant ClubImageController
participant ClubImageService (Cloudflare/GoogleDrive)
participant S3/Drive

User->>ClubImageController: POST /logo (로고 업로드)
ClubImageController->>ClubImageService: uploadLogo(clubId, file)
ClubImageService->>S3/Drive: 파일 업로드
S3/Drive-->>ClubImageService: URL 반환
ClubImageService-->>ClubImageController: URL 반환
ClubImageController-->>User: URL 반환
Loading

Possibly related PRs

  • Moadong/moadong#363: socialLinks 필드 추가 및 관련 DTO/엔티티 동기화와 직접적으로 연결됨.
  • Moadong/moadong#467: PasswordValidator의 정규식 및 반환값 수정이 동일하게 적용됨.
  • Moadong/moadong#401: 모집 상태 자동 갱신 로직(RecruitmentStateChecker, 스케줄러 구조 변경 등)과 직접적으로 동일한 변경점 포함.

Suggested labels

✨ Feature, 💾 BE

Suggested reviewers

  • lepitaaar
  • Due-IT

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46ca647 and a5c6a16.

📒 Files selected for processing (68)
  • backend/.gitignore (1 hunks)
  • backend/build.gradle (1 hunks)
  • backend/src/main/java/moadong/MoadongApplication.java (1 hunks)
  • backend/src/main/java/moadong/club/controller/ClubApplyController.java (1 hunks)
  • backend/src/main/java/moadong/club/entity/Club.java (4 hunks)
  • backend/src/main/java/moadong/club/entity/ClubApplication.java (1 hunks)
  • backend/src/main/java/moadong/club/entity/ClubApplicationQuestion.java (1 hunks)
  • backend/src/main/java/moadong/club/entity/ClubMetric.java (3 hunks)
  • backend/src/main/java/moadong/club/entity/ClubQuestion.java (1 hunks)
  • backend/src/main/java/moadong/club/entity/ClubQuestionAnswer.java (1 hunks)
  • backend/src/main/java/moadong/club/entity/ClubQuestionItem.java (1 hunks)
  • backend/src/main/java/moadong/club/entity/ClubQuestionOption.java (1 hunks)
  • backend/src/main/java/moadong/club/entity/ClubRecruitmentInformation.java (3 hunks)
  • backend/src/main/java/moadong/club/enums/ApplicationStatus.java (1 hunks)
  • backend/src/main/java/moadong/club/enums/ClubApplicationQuestionType.java (1 hunks)
  • backend/src/main/java/moadong/club/payload/dto/ClubDetailedResult.java (3 hunks)
  • backend/src/main/java/moadong/club/payload/request/ClubApplicationCreateRequest.java (1 hunks)
  • backend/src/main/java/moadong/club/payload/request/ClubApplicationEditRequest.java (1 hunks)
  • backend/src/main/java/moadong/club/payload/request/ClubApplyQuestion.java (1 hunks)
  • backend/src/main/java/moadong/club/payload/request/ClubApplyRequest.java (1 hunks)
  • backend/src/main/java/moadong/club/payload/request/ClubInfoRequest.java (2 hunks)
  • backend/src/main/java/moadong/club/payload/response/ClubApplicationResponse.java (1 hunks)
  • backend/src/main/java/moadong/club/repository/ClubApplicationRepository.java (1 hunks)
  • backend/src/main/java/moadong/club/repository/ClubQuestionRepository.java (1 hunks)
  • backend/src/main/java/moadong/club/service/ClubApplyService.java (1 hunks)
  • backend/src/main/java/moadong/club/service/ClubMetricService.java (7 hunks)
  • backend/src/main/java/moadong/club/service/ClubProfileService.java (3 hunks)
  • backend/src/main/java/moadong/club/service/RecruitmentScheduler.java (0 hunks)
  • backend/src/main/java/moadong/club/service/RecruitmentStateChecker.java (1 hunks)
  • backend/src/main/java/moadong/global/config/SchedulerConfig.java (0 hunks)
  • backend/src/main/java/moadong/global/exception/ErrorCode.java (1 hunks)
  • backend/src/main/java/moadong/global/validator/KoreanValidator.java (1 hunks)
  • backend/src/main/java/moadong/global/validator/PasswordValidator.java (1 hunks)
  • backend/src/main/java/moadong/global/validator/PhoneNumberValidator.java (1 hunks)
  • backend/src/main/java/moadong/global/validator/UserIdValidator.java (1 hunks)
  • backend/src/main/java/moadong/media/controller/ClubImageController.java (2 hunks)
  • backend/src/main/java/moadong/media/domain/FileType.java (1 hunks)
  • backend/src/main/java/moadong/media/dto/FeedUpdateRequest.java (1 hunks)
  • backend/src/main/java/moadong/media/service/CloudflareImageService.java (1 hunks)
  • backend/src/main/java/moadong/media/service/ClubImageService.java (1 hunks)
  • backend/src/main/java/moadong/media/service/GcsClubImageService.java (6 hunks)
  • backend/src/main/java/moadong/media/service/GoogleDriveClubImageService.java (1 hunks)
  • backend/src/main/java/moadong/media/util/ClubImageUtil.java (1 hunks)
  • backend/src/main/java/moadong/media/util/GoogleDriveConfig.java (1 hunks)
  • backend/src/main/java/moadong/media/util/S3Config.java (1 hunks)
  • backend/src/main/java/moadong/user/entity/User.java (1 hunks)
  • backend/src/main/java/moadong/user/entity/UserInformation.java (1 hunks)
  • backend/src/main/java/moadong/user/payload/request/UserRegisterRequest.java (1 hunks)
  • backend/src/main/java/moadong/user/repository/UserInformationRepository.java (0 hunks)
  • backend/src/main/java/moadong/user/service/UserCommandService.java (5 hunks)
  • backend/src/test/java/moadong/club/fixture/ClubFixture.java (1 hunks)
  • backend/src/test/java/moadong/club/fixture/MetricFixture.java (1 hunks)
  • backend/src/test/java/moadong/club/service/ClubMetricServiceTest.java (1 hunks)
  • backend/src/test/java/moadong/club/service/ClubSearchServiceTest.java (1 hunks)
  • backend/src/test/java/moadong/club/service/RecruitmentStateCheckerTest.java (1 hunks)
  • backend/src/test/java/moadong/fixture/ClubFixture.java (1 hunks)
  • backend/src/test/java/moadong/fixture/ClubRequestFixture.java (1 hunks)
  • backend/src/test/java/moadong/fixture/UserFixture.java (1 hunks)
  • backend/src/test/java/moadong/fixture/UserRequestFixture.java (1 hunks)
  • backend/src/test/java/moadong/media/service/GoogleDriveClubImageServiceFeedTest.java (1 hunks)
  • backend/src/test/java/moadong/media/service/GoogleDriveClubImageServiceLogoTest.java (1 hunks)
  • backend/src/test/java/moadong/unit/club/ClubProfileServiceTest.java (1 hunks)
  • backend/src/test/java/moadong/unit/user/PasswordValidatorTest.java (1 hunks)
  • backend/src/test/java/moadong/unit/user/UserLoginTest.java (1 hunks)
  • backend/src/test/java/moadong/unit/user/UserRegisterTest.java (1 hunks)
  • backend/src/test/java/moadong/util/annotations/IntegrationTest.java (1 hunks)
  • backend/src/test/java/moadong/util/annotations/TestTypeConstants.java (1 hunks)
  • backend/src/test/java/moadong/util/annotations/UnitTest.java (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

4 participants