Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
f40680a
test : test 초기 세팅 실패...
Due-IT Apr 30, 2025
b26f57d
test : 실패하는 테스트코드 주석처리
Due-IT May 1, 2025
1eebdc0
test : 메트릭 관련 테스트 코드 작성
Due-IT May 1, 2025
8c4b123
refactor : 테스트시 clubId는 testClubId로 통일
Due-IT May 1, 2025
fdaec60
feat : socialLinks 구현
Due-IT May 1, 2025
430dfa5
fix : null대신 Map.of()를 사용하여 NPE 방지
Due-IT May 1, 2025
53f162e
test : 특정 동아리의 주간 방문자수 조회
Due-IT May 2, 2025
b6c7ddf
test : 특정 동아리의 월간 방문자수 조회
Due-IT May 2, 2025
e154747
test : getDailyRanking() 테스트 코드 작성
Due-IT May 2, 2025
8b6fdca
test : getDailyActiveUser() 테스트 코드 작성
Due-IT May 2, 2025
78d781e
refactor: User Collection과 UserInformation Collection 병합
Zepelown May 3, 2025
a03eb87
feat: 단위 테스트와 통합 테스트 분리를 위한 어노테이션 추가
Zepelown May 3, 2025
0c883d5
refactor: null을 정확히 검증하기 위해서 @NotBlank 변경 및 테스트하기 위한 메서드 반환값 설정
Zepelown May 3, 2025
6fe33cc
구글 드라이브 이미지 업로드 기능 구현
May 3, 2025
5c1739d
구글 드라이브 이미지 업로드 기능 구현
May 3, 2025
7ddff6b
구글 드라이브 이미지 업로드 기능 구현
May 3, 2025
e3c7d12
구글 드라이브 이미지 업로드 기능 구현
May 3, 2025
135b2e3
구글 드라이브 이미지 업로드 기능 구현
May 3, 2025
793c11f
Merge pull request #363 from Moadong/feat/#362-social-links
Zepelown May 3, 2025
5a8081e
refactor : 테스트시 사용되는clubId를 testClubId -> club-1 형식으로 변경
Due-IT May 4, 2025
67b4342
test : 모집 스케줄링 성공 테스트 코드 작성
Due-IT May 4, 2025
ddd39ea
test : cancelScheduledTask() 테스트 작성
Due-IT May 4, 2025
1bd03f2
test : updateRecruitmentStatus()테스트 코드 작성
Due-IT May 4, 2025
44eb918
merge : merge with develop
Due-IT May 4, 2025
bc6cf7a
refactor :develop의 변경사항을 반영하여 RecruitmentStatus -> ClubRecruitmentSta…
Due-IT May 4, 2025
aecaa78
PR 테스트 인증 json파일 관련 에러 해결
May 4, 2025
f413416
feat: 회원가입 시 아이디와 비밀번호가 같은 지 점검 기능 추가
Zepelown May 5, 2025
7305dfc
fix: 비밀번호 검증이 제대로 되지 않던 문제 해결
Zepelown May 5, 2025
096c103
[feature] 구글 드라이브 업로드 기능 구현
PororoAndFriends May 6, 2025
bd6ad7e
ClubSearchService 테스트 코드 작성
May 7, 2025
372b78d
ClubSearchService 테스트 코드 작성
May 7, 2025
4330166
test : 플레이키리 현상 제거를 위해 시스템 기본 시간대를 사용하지 않음
Due-IT May 8, 2025
86eef41
Merge branch 'develop/be' of https://github.com/Moadong/moadong into …
Due-IT May 8, 2025
596c098
Merge pull request #373 from Moadong/test/#360-test-due
Due-IT May 8, 2025
a116b02
test: 로그인과 회원가입 테스트 추가
Zepelown May 8, 2025
e3472eb
test: 클럽 생성 및 약력 업데이트 테스트 코드 추가
Zepelown May 8, 2025
d4ac223
Merge branch 'develop/be' into refactor/#368-collection-merge-and-test
Zepelown May 8, 2025
cf4669e
media 관련 테스트코드 작성
May 8, 2025
95bbbd6
refactor: UserFixture의 createUserDetails() 변수 일관성 유지
Zepelown May 9, 2025
d869022
fix : 시간은 KST를 기준으로 활용
Due-IT May 9, 2025
b6fd42e
test: form -> social links 로 변경에 따라 코드 병합을 위한 주석 처리
Zepelown May 10, 2025
1a267ae
Merge branch 'refactor/#368-collection-merge-and-test' of https://git…
Zepelown May 10, 2025
b357485
test: socialLinks 반영
Zepelown May 10, 2025
ee3ad32
테스트 관련 리뷰 사항 반영
May 10, 2025
07088d6
fix : Aisa -> Asia 오타 수정
Due-IT May 10, 2025
fcd17ec
refactor: TestTypeConstants를 테스트 패키지로 이동
Zepelown May 10, 2025
71c6d2f
test: Request 관련 메서드 분리
Zepelown May 10, 2025
93862da
Merge pull request #386 from Moadong/test/#370-test_code_gyu
Zepelown May 10, 2025
65e64b5
chore: Validator 주석 추가
Zepelown May 10, 2025
1761642
Merge pull request #394 from Moadong/fix/#393-replace-localdate-to-zo…
Due-IT May 11, 2025
7e56421
fix : 기존 스케줄러 설정 제거
Due-IT May 13, 2025
0d47e8f
fix : null 예외처리
Due-IT May 13, 2025
9c27303
fix : 스케줄러 기능 구현
Due-IT May 13, 2025
e13ff04
test : 모집상태 ALWAYS이면 변경 발생하지 않음
Due-IT May 13, 2025
252b491
test : 모집시작전_14일이내면_UPCOMING
Due-IT May 13, 2025
499953b
test : 모집기간중이면 OPEN
Due-IT May 13, 2025
3736417
test : 모집마감 이후면 CLOSED
Due-IT May 13, 2025
94fcf7f
test : 시작 또는 종료날짜가 null이면 CLOSED
Due-IT May 13, 2025
01b5897
feat: 지원서 없을때 에러코드 추가
lepitaaar May 14, 2025
dada4c9
feat: 지원서 질문 타입 추가
lepitaaar May 14, 2025
a1561fb
feat: 지원서 생성, 수정 API 추가
lepitaaar May 14, 2025
6a2db6a
feat: 동아리 지원 API 추가
lepitaaar May 14, 2025
e1eeaaf
fix: api 명세와 통일
lepitaaar May 14, 2025
66a1f31
refactor: ClubApplyAnswer rename Answer
lepitaaar May 14, 2025
29325a1
fix: api 명세 통일
lepitaaar May 14, 2025
9971091
Merge pull request #385 from Moadong/refactor/#368-collection-merge-a…
Zepelown May 15, 2025
7cc95a4
refactor: 에러 코드 분리
lepitaaar May 17, 2025
6567d0a
refactor: dto 직접 주입 삭제, 엔티티 분리
lepitaaar May 17, 2025
e807524
refactor: update와 create 미리 분리
lepitaaar May 17, 2025
1c4755d
refactor: ClubApplyQuestion 분할
lepitaaar May 17, 2025
9d16c44
cloudflare 이미지 업로드 기능 추가
May 17, 2025
0bcf9fb
refactor: dto 엔티티 직접 참조 삭제
lepitaaar May 19, 2025
78abab0
feat: 검증에 사용할 에러코드 추가
lepitaaar May 19, 2025
e93fc59
refactor: api 명세와 통일
lepitaaar May 19, 2025
e6a7f34
feat: 검증 과정 추가
lepitaaar May 19, 2025
46884ad
refactor: api 명세 통일
lepitaaar May 19, 2025
cad6de3
feat: 검증 추가
lepitaaar May 19, 2025
ffb8ccc
Merge pull request #401 from Moadong/fix/#399-scheduler
Due-IT May 19, 2025
1aa49e3
refactor: create과 edit 로직 미리 분리
lepitaaar May 19, 2025
dfd152e
feat: 지원서 불러오기 응답 dto 추가
lepitaaar May 19, 2025
c473f73
refactor: 제한 10글자에서 20글자로 변경
lepitaaar May 19, 2025
dd01b9f
refactor: 에러코드 메시지 수정
lepitaaar May 19, 2025
db71eec
feat: 수정시 editedAt 시간 업데이트
lepitaaar May 19, 2025
9c1e24b
refactor: 제한 길이 변경
lepitaaar May 19, 2025
0085593
refactor: 객관식 요소 null 체킹
lepitaaar May 19, 2025
61756cd
refactor: api 설명 오타 수정
lepitaaar May 19, 2025
b958462
feat: 지원서 없을때 에러코드 추가
lepitaaar May 14, 2025
9a0c759
feat: 지원서 질문 타입 추가
lepitaaar May 14, 2025
59d14e2
feat: 지원서 생성, 수정 API 추가
lepitaaar May 14, 2025
36cedf1
feat: 동아리 지원 API 추가
lepitaaar May 14, 2025
ce3a1e0
fix: api 명세와 통일
lepitaaar May 14, 2025
61dbcb0
refactor: ClubApplyAnswer rename Answer
lepitaaar May 14, 2025
838277f
fix: api 명세 통일
lepitaaar May 14, 2025
060cf30
refactor: 에러 코드 분리
lepitaaar May 17, 2025
d37cd5c
refactor: dto 직접 주입 삭제, 엔티티 분리
lepitaaar May 17, 2025
97be0bf
refactor: update와 create 미리 분리
lepitaaar May 17, 2025
329bfb8
refactor: ClubApplyQuestion 분할
lepitaaar May 17, 2025
2505382
refactor: dto 엔티티 직접 참조 삭제
lepitaaar May 19, 2025
24e743b
feat: 검증에 사용할 에러코드 추가
lepitaaar May 19, 2025
4045aa3
refactor: api 명세와 통일
lepitaaar May 19, 2025
88dc703
feat: 검증 과정 추가
lepitaaar May 19, 2025
126d542
refactor: api 명세 통일
lepitaaar May 19, 2025
ce9532e
feat: 검증 추가
lepitaaar May 19, 2025
3d8d291
refactor: create과 edit 로직 미리 분리
lepitaaar May 19, 2025
7a961df
feat: 지원서 불러오기 응답 dto 추가
lepitaaar May 19, 2025
ab1d6bf
refactor: 제한 10글자에서 20글자로 변경
lepitaaar May 19, 2025
60efce2
refactor: 에러코드 메시지 수정
lepitaaar May 19, 2025
ba29008
feat: 수정시 editedAt 시간 업데이트
lepitaaar May 19, 2025
eb2aa7c
refactor: 제한 길이 변경
lepitaaar May 19, 2025
4c083fc
refactor: 객관식 요소 null 체킹
lepitaaar May 19, 2025
fba2532
refactor: api 설명 오타 수정
lepitaaar May 19, 2025
b7342a2
Merge remote-tracking branch 'origin/feature/#382-club-application-sa…
lepitaaar May 19, 2025
135fb54
fix : 없어진 의존성 제거
Due-IT May 19, 2025
106963e
feat: 지원서 없을때 에러코드 추가
lepitaaar May 14, 2025
cd8d200
feat: 지원서 질문 타입 추가
lepitaaar May 14, 2025
9705172
feat: 지원서 생성, 수정 API 추가
lepitaaar May 14, 2025
d1d9bc5
feat: 동아리 지원 API 추가
lepitaaar May 14, 2025
f708e12
fix: api 명세와 통일
lepitaaar May 14, 2025
7052c46
refactor: ClubApplyAnswer rename Answer
lepitaaar May 14, 2025
4e5a834
fix: api 명세 통일
lepitaaar May 14, 2025
96244f4
refactor: 에러 코드 분리
lepitaaar May 17, 2025
63eb1a0
refactor: dto 직접 주입 삭제, 엔티티 분리
lepitaaar May 17, 2025
754a997
refactor: update와 create 미리 분리
lepitaaar May 17, 2025
35cbd39
refactor: ClubApplyQuestion 분할
lepitaaar May 17, 2025
0f878d3
refactor: dto 엔티티 직접 참조 삭제
lepitaaar May 19, 2025
7ab5869
feat: 검증에 사용할 에러코드 추가
lepitaaar May 19, 2025
929aa80
refactor: api 명세와 통일
lepitaaar May 19, 2025
3252065
feat: 검증 과정 추가
lepitaaar May 19, 2025
53ab3ba
refactor: api 명세 통일
lepitaaar May 19, 2025
5287186
feat: 검증 추가
lepitaaar May 19, 2025
deda997
refactor: create과 edit 로직 미리 분리
lepitaaar May 19, 2025
8e54ef9
feat: 지원서 불러오기 응답 dto 추가
lepitaaar May 19, 2025
1df9d49
refactor: 제한 10글자에서 20글자로 변경
lepitaaar May 19, 2025
9abfff3
refactor: 에러코드 메시지 수정
lepitaaar May 19, 2025
51911f3
feat: 수정시 editedAt 시간 업데이트
lepitaaar May 19, 2025
b432c1b
refactor: 제한 길이 변경
lepitaaar May 19, 2025
deaf819
refactor: 객관식 요소 null 체킹
lepitaaar May 19, 2025
7748b9f
refactor: api 설명 오타 수정
lepitaaar May 19, 2025
04fb0eb
feat: 지원서 질문 타입 추가
lepitaaar May 14, 2025
b256731
refactor: dto 엔티티 직접 참조 삭제
lepitaaar May 19, 2025
873584f
Merge remote-tracking branch 'origin/feature/#382-club-application-sa…
lepitaaar May 19, 2025
a41465e
파일 확장자 검증 및 파일 리사이징 기능 구현
May 19, 2025
3399010
주석 제거
May 19, 2025
987b059
주석 제거
May 19, 2025
a4cbf47
주석 제거
May 19, 2025
5499319
refactor: title로 변경
lepitaaar May 19, 2025
476e50b
refactor: stream to for-loop
lepitaaar May 19, 2025
dd81a72
feat: status 추가
lepitaaar May 21, 2025
b1d9601
refactor: 에러 코드 변경
lepitaaar May 21, 2025
a79977b
refactor: getOrCreateClubQuestion 이름 변경
lepitaaar May 21, 2025
e8ca199
Merge pull request #406 from Moadong/feature/#382-club-application-save
Zepelown May 21, 2025
7eecc55
fix: 비밀번호 검증 롤백
Zepelown Jun 1, 2025
6b63016
Merge pull request #456 from Moadong/fix/#455/password-validation
PororoAndFriends Jun 1, 2025
69e2df0
fix: 잘못된 비밀번호 검증 로직과 잘못된 비밀번호 테스트 수정
Zepelown Jun 1, 2025
b7b2aad
Merge pull request #425 from Moadong/feature/#424-cloudflare
Zepelown Jun 3, 2025
2e36e93
Merge pull request #467 from Moadong/fix/#455/password-validation
Zepelown Jun 4, 2025
228f7a6
이미지 저장소 cloudflare로 고정
Jun 6, 2025
a5c6a16
[feature] 이미지 저장소 cloudflare로 고정
PororoAndFriends Jun 6, 2025
4ea79f5
hotfix : Aggregation에서 하드코딩된 필드명 수정
Due-IT Jun 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ out/


application.properties
moadong.json
moadong.json
44 changes: 43 additions & 1 deletion backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,53 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'


testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// google drive
implementation 'com.google.api-client:google-api-client:2.0.0'
implementation 'com.google.oauth-client:google-oauth-client-jetty:1.34.1'
implementation 'com.google.apis:google-api-services-drive:v3-rev20220815-2.0.0'

// S3
implementation platform('software.amazon.awssdk:bom:2.25.8')
implementation 'software.amazon.awssdk:s3'
implementation 'software.amazon.awssdk:auth'

// resize tool
implementation 'net.coobird:thumbnailator:0.4.14'
implementation 'org.springframework:spring-test'

Comment on lines +51 to +64
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

새로운 의존성들이 잘 구성되어 있습니다.

Google Drive API, AWS S3, Thumbnailator 등의 의존성이 기능별로 잘 분류되어 추가되었습니다. 주석을 통한 그룹화도 명확합니다.

다만, 의존성 버전이 최신인지 확인해주세요. 특히 보안 업데이트가 있는지 검토가 필요할 수 있습니다.


🏁 Script executed:

#!/bin/bash
# 주요 의존성들의 최신 버전 확인
echo "Google API Client 최신 버전 확인:"
curl -s "https://search.maven.org/solrsearch/select?q=g:com.google.api-client+AND+a:google-api-client&rows=1&wt=json" | jq -r '.response.docs[0].latestVersion'

echo "AWS SDK BOM 최신 버전 확인:"
curl -s "https://search.maven.org/solrsearch/select?q=g:software.amazon.awssdk+AND+a:bom&rows=1&wt=json" | jq -r '.response.docs[0].latestVersion'

echo "Thumbnailator 최신 버전 확인:"
curl -s "https://search.maven.org/solrsearch/select?q=g:net.coobird+AND+a:thumbnailator&rows=1&wt=json" | jq -r '.response.docs[0].latestVersion'

Length of output: 654


의존성 버전 업데이트 필요

다음 주요 라이브러리들이 현재 코드에 지정된 버전보다 최신 버전이 릴리즈되어 있으니 업데이트를 권장합니다:

  • backend/build.gradle (51–64행)
    • com.google.api-client:google-api-client
    – 현재: 2.0.0 → 최신: 2.8.0
    • software.amazon.awssdk:bom
    – 현재: 2.25.8 → 최신: 2.31.57
    • net.coobird:thumbnailator
    – 현재: 0.4.14 → 최신: 0.4.20
  • 추가로 아래 의존성들도 최신 릴리즈 여부를 검토해주세요
    • com.google.oauth-client:google-oauth-client-jetty (현재 1.34.1)
    • com.google.apis:google-api-services-drive (현재 v3-rev20220815-2.0.0)

추천 변경 예시:

- implementation 'com.google.api-client:google-api-client:2.0.0'
+ implementation 'com.google.api-client:google-api-client:2.8.0'

- implementation platform('software.amazon.awssdk:bom:2.25.8')
+ implementation platform('software.amazon.awssdk:bom:2.31.57')

- implementation 'net.coobird:thumbnailator:0.4.14'
+ implementation 'net.coobird:thumbnailator:0.4.20'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// google drive
implementation 'com.google.api-client:google-api-client:2.0.0'
implementation 'com.google.oauth-client:google-oauth-client-jetty:1.34.1'
implementation 'com.google.apis:google-api-services-drive:v3-rev20220815-2.0.0'
// S3
implementation platform('software.amazon.awssdk:bom:2.25.8')
implementation 'software.amazon.awssdk:s3'
implementation 'software.amazon.awssdk:auth'
// resize tool
implementation 'net.coobird:thumbnailator:0.4.14'
implementation 'org.springframework:spring-test'
// google drive
implementation 'com.google.api-client:google-api-client:2.8.0'
implementation 'com.google.oauth-client:google-oauth-client-jetty:1.34.1'
implementation 'com.google.apis:google-api-services-drive:v3-rev20220815-2.0.0'
// S3
implementation platform('software.amazon.awssdk:bom:2.31.57')
implementation 'software.amazon.awssdk:s3'
implementation 'software.amazon.awssdk:auth'
// resize tool
implementation 'net.coobird:thumbnailator:0.4.20'
implementation 'org.springframework:spring-test'
🤖 Prompt for AI Agents
In backend/build.gradle between lines 51 and 64, update the versions of key
dependencies to their latest releases to ensure security and feature
improvements. Change com.google.api-client:google-api-client from 2.0.0 to
2.8.0, software.amazon.awssdk:bom from 2.25.8 to 2.31.57, and
net.coobird:thumbnailator from 0.4.14 to 0.4.20. Also review and update if
possible the versions of com.google.oauth-client:google-oauth-client-jetty and
com.google.apis:google-api-services-drive to their latest stable versions.
Adjust the version numbers in the implementation lines accordingly.

}

tasks.named('test') {
//전체 테스트
test {
description = 'Runs the total tests.'
useJUnitPlatform()
}

//유닛 테스트
task unitTest(type: Test) {
group = 'verification'
description = 'Runs the unit tests.'
useJUnitPlatform{
includeTags 'UnitTest'
excludeTags 'IntegrationTest'

}
}

//통합 테스트
task integrationTest(type: Test) {
group = 'verification'
description = 'Runs the integration tests.'
useJUnitPlatform{
includeTags 'IntegrationTest'
excludeTags 'UnitTest'
}
}
2 changes: 2 additions & 0 deletions backend/src/main/java/moadong/MoadongApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@RequiredArgsConstructor
@EnableScheduling
public class MoadongApplication {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package moadong.club.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import moadong.club.payload.request.ClubApplicationCreateRequest;
import moadong.club.payload.request.ClubApplicationEditRequest;
import moadong.club.payload.request.ClubApplyRequest;
import moadong.club.service.ClubApplyService;
import moadong.global.payload.Response;
import moadong.user.annotation.CurrentUser;
import moadong.user.payload.CustomUserDetails;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/club/{clubId}")
@AllArgsConstructor
@Tag(name = "Club_Apply", description = "클럽 지원서 API")
public class ClubApplyController {

private final ClubApplyService clubApplyService;

@PostMapping("/application")
@Operation(summary = "클럽 지원서 생성", description = "클럽 지원서를 생성합니다")
@PreAuthorize("isAuthenticated()")
@SecurityRequirement(name = "BearerAuth")
public ResponseEntity<?> createClubApplication(@PathVariable String clubId,
@CurrentUser CustomUserDetails user,
@RequestBody @Validated ClubApplicationCreateRequest request) {
clubApplyService.createClubApplication(clubId, user, request);
return Response.ok("success create application");
}

@PutMapping("/application")
@Operation(summary = "클럽 지원서 수정", description = "클럽 지원서를 수정합니다")
@PreAuthorize("isAuthenticated()")
@SecurityRequirement(name = "BearerAuth")
public ResponseEntity<?> editClubApplication(@PathVariable String clubId,
@CurrentUser CustomUserDetails user,
@RequestBody @Validated ClubApplicationEditRequest request) {
clubApplyService.editClubApplication(clubId, user, request);
return Response.ok("success edit application");
}

@GetMapping("/apply")
@Operation(summary = "클럽 지원서 불러오기", description = "클럽 지원서를 불러옵니다")
public ResponseEntity<?> getClubApplication(@PathVariable String clubId) {
return clubApplyService.getClubApplication(clubId);
}
Comment on lines +49 to +53
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

인증 요구사항 불일치

지원서 조회(/apply GET)와 지원 제출(/apply POST)에 인증이 필요하지 않도록 설정되어 있습니다. 이는 보안상 위험할 수 있습니다.

지원서 조회와 제출에도 적절한 인증이 필요한지 검토해야 합니다:

@GetMapping("/apply")
@Operation(summary = "클럽 지원서 불러오기", description = "클럽 지원서를 불러옵니다")
+@PreAuthorize("isAuthenticated()")
+@SecurityRequirement(name = "BearerAuth")
public ResponseEntity<?> getClubApplication(@PathVariable String clubId) {

@PostMapping("/apply")
@Operation(summary = "클럽 지원", description = "클럽에 지원합니다")
+@PreAuthorize("isAuthenticated()")
+@SecurityRequirement(name = "BearerAuth")
public ResponseEntity<?>  applyToClub(@PathVariable String clubId,
+                                     @CurrentUser CustomUserDetails user,
                                      @RequestBody @Validated ClubApplyRequest request) {

Also applies to: 55-61

🤖 Prompt for AI Agents
In backend/src/main/java/moadong/club/controller/ClubApplyController.java around
lines 49 to 53 and 55 to 61, the GET and POST endpoints for /apply currently do
not enforce authentication, which poses a security risk. Review the security
requirements and add appropriate authentication annotations or checks to these
methods to ensure only authorized users can access or submit club applications.


@PostMapping("/apply")
@Operation(summary = "클럽 지원", description = "클럽에 지원합니다")
public ResponseEntity<?> applyToClub(@PathVariable String clubId,
@RequestBody @Validated ClubApplyRequest request) {
clubApplyService.applyToClub(clubId, request);
return Response.ok("success apply");
}
Comment on lines +57 to +61
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

클럽 지원 시 사용자 정보 누락

클럽 지원 시 어떤 사용자가 지원했는지 식별할 수 있는 정보가 전달되지 않습니다.

지원자 정보를 서비스 레이어에 전달해야 합니다:

public ResponseEntity<?>  applyToClub(@PathVariable String clubId,
+                                     @CurrentUser CustomUserDetails user,
                                      @RequestBody @Validated ClubApplyRequest request) {
-    clubApplyService.applyToClub(clubId, request);
+    clubApplyService.applyToClub(clubId, user, request);
    return Response.ok("success apply");
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public ResponseEntity<?> applyToClub(@PathVariable String clubId,
@RequestBody @Validated ClubApplyRequest request) {
clubApplyService.applyToClub(clubId, request);
return Response.ok("success apply");
}
public ResponseEntity<?> applyToClub(@PathVariable String clubId,
@CurrentUser CustomUserDetails user,
@RequestBody @Validated ClubApplyRequest request) {
clubApplyService.applyToClub(clubId, user, request);
return Response.ok("success apply");
}
🤖 Prompt for AI Agents
In backend/src/main/java/moadong/club/controller/ClubApplyController.java around
lines 57 to 61, the applyToClub method does not pass any user identification
information to the service layer, making it impossible to know who is applying.
Modify the method to obtain the current user's information (e.g., from security
context or session) and pass this user info along with the clubId and request to
the clubApplyService.applyToClub method to ensure the applicant is properly
identified.


}
12 changes: 11 additions & 1 deletion backend/src/main/java/moadong/club/entity/Club.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import jakarta.persistence.Id;
import jakarta.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import moadong.club.enums.ClubRecruitmentStatus;
import moadong.club.enums.ClubState;
import moadong.club.payload.request.ClubRecruitmentInfoUpdateRequest;
import moadong.club.payload.request.ClubInfoRequest;
import moadong.club.payload.request.ClubRecruitmentInfoUpdateRequest;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

Expand Down Expand Up @@ -41,16 +43,19 @@ public class Club {

private String userId;

private Map<String, String> socialLinks;

@Field("recruitmentInformation")
private ClubRecruitmentInformation clubRecruitmentInformation;

public Club() {
this.name = "";
this.category = "";
this.division = "";
this.state = ClubState.UNAVAILABLE;
this.clubRecruitmentInformation = ClubRecruitmentInformation.builder().build();
}

public Club(String userId) {
this.name = "";
this.category = "";
Expand All @@ -74,6 +79,7 @@ public void update(ClubInfoRequest request) {
this.category = request.category();
this.division = request.division();
this.state = ClubState.AVAILABLE;
this.socialLinks = request.socialLinks();
this.clubRecruitmentInformation.update(request);
}

Expand All @@ -88,4 +94,8 @@ public void updateLogo(String logo) {
public void updateFeedImages(List<String> feedImages) {
this.clubRecruitmentInformation.updateFeedImages(feedImages);
}

public void updateRecruitmentStatus(ClubRecruitmentStatus clubRecruitmentStatus) {
this.clubRecruitmentInformation.updateRecruitmentStatus(clubRecruitmentStatus);
}
}
38 changes: 38 additions & 0 deletions backend/src/main/java/moadong/club/entity/ClubApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package moadong.club.entity;

import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import moadong.club.enums.ApplicationStatus;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;

@Document("club_applications")
@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
public class ClubApplication {
Comment on lines +18 to +22
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

MongoDB 엔티티에 기본 생성자가 필요할 수 있습니다.

MongoDB의 역직렬화를 위해 @NoArgsConstructor 어노테이션 추가를 고려해보세요.

 @Document("club_applications")
+@NoArgsConstructor
 @AllArgsConstructor
 @Getter
 @Builder(toBuilder = true)
 public class ClubApplication {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Document("club_applications")
@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
public class ClubApplication {
@Document("club_applications")
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
public class ClubApplication {
🤖 Prompt for AI Agents
In backend/src/main/java/moadong/club/entity/ClubApplication.java around lines
18 to 22, the class lacks a no-argument constructor which is necessary for
MongoDB deserialization. Add the Lombok annotation @NoArgsConstructor to the
class to provide a default constructor, ensuring proper deserialization by
MongoDB.


@Id
private String id;

private String questionId;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

지원서에 사용자 정보가 누락되었습니다.

클럽 지원서에는 지원한 사용자의 정보가 포함되어야 합니다. userId 또는 applicantId 필드 추가를 고려해주세요.

 private String questionId;
+
+private String userId; // 지원자 ID 추가 필요
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private String questionId;
private String questionId;
private String userId; // 지원자 ID 추가 필요
🤖 Prompt for AI Agents
In backend/src/main/java/moadong/club/entity/ClubApplication.java at line 27,
the ClubApplication entity lacks user information. Add a field such as userId or
applicantId to represent the applicant's identity. Define this field with an
appropriate data type (e.g., String or Long) and include necessary annotations
if using JPA or similar frameworks to map the relationship or column properly.


@Enumerated(EnumType.STRING)
@Builder.Default
ApplicationStatus status = ApplicationStatus.SUBMITTED;

@Builder.Default
private List<ClubQuestionAnswer> answers = new ArrayList<>();

@Builder.Default
LocalDateTime createdAt = ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package moadong.club.entity;

import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import moadong.club.enums.ClubApplicationQuestionType;

import java.util.List;

@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
public class ClubApplicationQuestion {
Comment on lines +13 to +16
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

직렬화를 위한 기본 생성자 추가를 권장합니다.

JSON 직렬화/역직렬화나 MongoDB 매핑을 위해 기본 생성자가 필요할 수 있습니다.

+@NoArgsConstructor
 @AllArgsConstructor
 @Getter
 @Builder(toBuilder = true)
 public class ClubApplicationQuestion {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
public class ClubApplicationQuestion {
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
public class ClubApplicationQuestion {
// existing fields and methods
}
🤖 Prompt for AI Agents
In backend/src/main/java/moadong/club/entity/ClubApplicationQuestion.java around
lines 13 to 16, add a no-argument default constructor to the class to support
JSON serialization/deserialization and MongoDB mapping. This can be done by
adding an explicit public default constructor or using Lombok's
@NoArgsConstructor annotation to generate it automatically.

💡 Verification agent

🧩 Analysis chain

엔티티의 사용 목적을 명확히 해주세요.

이 클래스가 독립적인 MongoDB 엔티티인지 임베디드 객체인지 명확하지 않습니다. 만약 독립적인 엔티티라면 @Document 어노테이션이, 임베디드 객체라면 관련 문서화가 필요합니다.

다음 스크립트로 이 클래스의 사용처를 확인해보겠습니다:


🏁 Script executed:

#!/bin/bash
# ClubApplicationQuestion 클래스의 사용처 확인
rg -A 3 -B 3 "ClubApplicationQuestion"

Length of output: 13581


🏁 Script executed:

#!/bin/bash
# Check for JPA @Entity annotations
rg "@Entity" -n src/main/java
# Check for MongoDB @Document annotations
rg "@Document" -n src/main/java
# Check for repository interfaces
rg "interface .*Repository" -n src/main/java

Length of output: 270


🏁 Script executed:

#!/bin/bash
# Spring Data 리포지토리 인터페이스 확인
rg -n "@Repository" -n backend
rg -n "interface .*Repository" -n backend
rg -n "MongoRepository" -n backend
rg -n "JpaRepository" -n backend

# 엔티티 및 MongoDB Document 어노테이션 확인
rg -n "@Entity" -n backend
rg -n "@Document" -n backend

Length of output: 3381


임베디드 서브도큐먼트임을 명시해주세요.

현재 ClubApplicationQuestion 클래스는 별도 리포지토리나 @Document 없이
ClubApplicationClubQuestion 도큐먼트 내부에 중첩된(sub-document) 객체로만 사용되고 있습니다.
따라서 루트 도큐먼트용 @Document 어노테이션은 불필요하지만, 이 POJO가 독립 엔티티가 아닌
서브도큐먼트임을 명확히 표시하면 가독성과 유지보수성이 향상됩니다.

  • 파일: backend/src/main/java/moadong/club/entity/ClubApplicationQuestion.java
  • 제안: 클래스 상단에 JavaDoc 또는 주석 추가
    /**
     * MongoDB 서브도큐먼트로 사용되는 질문 구성 객체.
     * ClubApplication, ClubQuestion 문서 내에 중첩되어 저장됩니다.
     */

위 내용을 반영하여 임베디드 객체임을 명시해주세요.

🤖 Prompt for AI Agents
In backend/src/main/java/moadong/club/entity/ClubApplicationQuestion.java around
lines 13 to 16, the class lacks clear indication that it is an embedded
sub-document rather than a standalone MongoDB entity. Add a JavaDoc comment
above the class declaration stating that this class is used as a MongoDB
sub-document embedded within ClubApplication and ClubQuestion documents to
improve code clarity and maintainability.


@NotNull
private Long id;

@NotNull
private String title;

@NotNull
private String description;

@Enumerated(EnumType.STRING)
@NotNull
private ClubApplicationQuestionType type;

@NotNull
private ClubQuestionOption options;

@NotNull
private List<ClubQuestionItem> items;
Comment on lines +18 to +35
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

모든 필드에 @NotNull이 과도하게 적용되었습니다.

모든 필드를 필수로 설정하는 것이 비즈니스 요구사항에 맞는지 검토가 필요합니다. 특히 description 필드는 선택적일 수 있습니다.

 @NotNull
 private String title;

-@NotNull
 private String description; // 설명은 선택적일 수 있음
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@NotNull
private Long id;
@NotNull
private String title;
@NotNull
private String description;
@Enumerated(EnumType.STRING)
@NotNull
private ClubApplicationQuestionType type;
@NotNull
private ClubQuestionOption options;
@NotNull
private List<ClubQuestionItem> items;
@NotNull
private Long id;
@NotNull
private String title;
private String description; // 설명은 선택적일 수 있음
@Enumerated(EnumType.STRING)
@NotNull
private ClubApplicationQuestionType type;
@NotNull
private ClubQuestionOption options;
@NotNull
private List<ClubQuestionItem> items;
🤖 Prompt for AI Agents
In backend/src/main/java/moadong/club/entity/ClubApplicationQuestion.java
between lines 18 and 35, the @NotNull annotation is applied to all fields, which
may be excessive. Review the business requirements and remove the @NotNull
annotation from fields that can be optional, especially the description field,
to reflect correct optionality.


}
6 changes: 4 additions & 2 deletions backend/src/main/java/moadong/club/entity/ClubMetric.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import jakarta.persistence.Id;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
Expand Down Expand Up @@ -30,7 +32,7 @@ public class ClubMetric {

@Builder
public ClubMetric(String clubId, String ip) {
LocalDateTime now = LocalDateTime.now();
LocalDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime();
this.clubId = clubId;
this.ip = ip;
this.inAt = now;
Expand All @@ -39,6 +41,6 @@ public ClubMetric(String clubId, String ip) {
}

public void update() {
this.outAt = LocalDateTime.now();
this.outAt = ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime();
}
}
53 changes: 53 additions & 0 deletions backend/src/main/java/moadong/club/entity/ClubQuestion.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package moadong.club.entity;

import jakarta.persistence.Id;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;

@Document("club_questions")
@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
public class ClubQuestion {

@Id
private String id;

private String clubId;

@NotBlank
@Builder.Default
private String title = "";

@Builder.Default
private List<ClubApplicationQuestion> questions = new ArrayList<>();

@Builder.Default
private LocalDateTime createdAt = ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime();

@Builder.Default
private LocalDateTime editedAt = ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime();
Comment on lines +35 to +38
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

타임존 설정을 외부 설정으로 분리하세요.

하드코딩된 "Asia/Seoul" 타임존을 설정 파일로 외부화하는 것을 권장합니다. 이렇게 하면 다른 지역에서의 배포나 테스트 시 유연성이 향상됩니다.

+@Value("${app.timezone:Asia/Seoul}")
+private String timezone;

-private LocalDateTime createdAt = ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime();
+private LocalDateTime createdAt = ZonedDateTime.now(ZoneId.of(timezone)).toLocalDateTime();

-private LocalDateTime editedAt = ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime();
+private LocalDateTime editedAt = ZonedDateTime.now(ZoneId.of(timezone)).toLocalDateTime();

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In backend/src/main/java/moadong/club/entity/ClubQuestion.java around lines 35
to 38, the timezone "Asia/Seoul" is hardcoded when initializing createdAt and
editedAt. To fix this, externalize the timezone by reading it from a
configuration file or environment variable instead of hardcoding it. Replace the
hardcoded string with a variable that loads the timezone setting from the
external configuration, ensuring flexibility for different deployment regions.


public void updateFormTitle(String title) {
this.title = title;
}

public void updateQuestions(List<ClubApplicationQuestion> newQuestions) {
this.questions.clear();
this.questions.addAll(newQuestions);
}

public void updateEditedAt() {
this.editedAt = ZonedDateTime.now(ZoneId.of("Asia/Seoul")).toLocalDateTime();
}

}
16 changes: 16 additions & 0 deletions backend/src/main/java/moadong/club/entity/ClubQuestionAnswer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package moadong.club.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;

@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
Comment on lines +7 to +9
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

기본 생성자 누락 – 프레임워크 호환성 보강 필요
Lombok @AllArgsConstructor만 선언되어 있어 Jackson/MongoDB 등에서 디폴트 생성자가 없어 역직렬화나 리플렉션 기반 매핑 시 오류가 발생할 수 있습니다.
아래와 같이 @NoArgsConstructor를 추가해주세요.

 import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
 import lombok.Builder;
 import lombok.Getter;

 @AllArgsConstructor
+@NoArgsConstructor
 @Getter
 @Builder(toBuilder = true)
 public class ClubQuestionAnswer { ... }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Builder;
import lombok.Getter;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Builder(toBuilder = true)
public class ClubQuestionAnswer {
// existing fields and methods...
}
🤖 Prompt for AI Agents
In backend/src/main/java/moadong/club/entity/ClubQuestionAnswer.java around
lines 7 to 9, the class uses Lombok's @AllArgsConstructor but lacks a
no-argument constructor, which can cause issues with frameworks like Jackson or
MongoDB that require a default constructor for deserialization and reflection.
Add the Lombok annotation @NoArgsConstructor to the class to provide a default
constructor and ensure compatibility with these frameworks.

public class ClubQuestionAnswer {

private Long id;

private String value;

}
14 changes: 14 additions & 0 deletions backend/src/main/java/moadong/club/entity/ClubQuestionItem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package moadong.club.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;

@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
Comment on lines +7 to +9
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

기본 생성자 누락 – 역직렬화 안정성 확보 필요
Lombok @AllArgsConstructor만 선언되어 있어 JSON 매핑이나 MongoDB 스키마 매핑 시 디폴트 생성자가 없어 실패할 수 있습니다.

 import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
 import lombok.Builder;
 import lombok.Getter;

 @AllArgsConstructor
+@NoArgsConstructor
 @Getter
 @Builder(toBuilder = true)
 public class ClubQuestionItem { ... }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
import lombok.Builder;
import lombok.Getter;
@AllArgsConstructor
+@NoArgsConstructor
@Getter
@Builder(toBuilder = true)
public class ClubQuestionItem {
// existing fields and methods...
}
🤖 Prompt for AI Agents
In backend/src/main/java/moadong/club/entity/ClubQuestionItem.java around lines
7 to 9, the class uses Lombok's @AllArgsConstructor but lacks a default
no-argument constructor, which can cause failures during JSON deserialization or
MongoDB schema mapping. Add Lombok's @NoArgsConstructor annotation to generate a
default constructor to ensure deserialization stability.

public class ClubQuestionItem {

private String value;

}
14 changes: 14 additions & 0 deletions backend/src/main/java/moadong/club/entity/ClubQuestionOption.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package moadong.club.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;

@AllArgsConstructor
@Getter
@Builder(toBuilder = true)
public class ClubQuestionOption {

private Boolean required;

}
Loading