Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions src/main/java/life/mosu/mosuserver/global/filter/Whitelist.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public enum Whitelist {
SWAGGER_UI("/api/v1/swagger-ui", WhitelistMethod.ALL),
VIRTUAL_ACCOUNT("/api/v1/virtual-account", WhitelistMethod.ALL),
ADMISSION_TICKET("/api/v1/admission-ticket", WhitelistMethod.ALL),
FILE("/api/v1/s3", WhitelistMethod.ALL),

// 정적 리소스
CSS("/api/v1/css", WhitelistMethod.GET),
Expand All @@ -39,6 +40,16 @@ public enum Whitelist {
EVENT("/api/v1/event", WhitelistMethod.GET),
FAQ("/api/v1/faq", WhitelistMethod.GET),
NOTICE("/api/v1/notice", WhitelistMethod.GET),
USER_ID_CHECK("/api/v1/user/check-id", WhitelistMethod.GET),
CUSTOMER_KEY_CHECK("/api/v1/user/customer-key", WhitelistMethod.GET),
EXAM("/api/v1/exam", WhitelistMethod.GET),
EXAM_AREAS("/api/v1/exam/areas", WhitelistMethod.GET),
EXAM_ALL("/api/v1/exam/all", WhitelistMethod.GET),

//USER find-id
USER_FIND_ID("/api/v1/user/me/find-id", WhitelistMethod.POST),
//USER find-password
USER_FIND_PASSWORD("/api/v1/user/me/find-password", WhitelistMethod.POST),
Comment on lines +43 to +52
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

All the newly added enum constants in this block are missing a trailing comma, which will cause a compilation error.

Additionally, there are a few areas for improvement:

  • The paths for exam-related endpoints are incorrect and can be simplified. The ExamController is mapped to /exams (plural), so the whitelist path should reflect that. A single entry for /api/v1/exams is sufficient.
  • The user-related endpoints can be grouped under a single descriptive comment for better organization and consistency.
Suggested change
USER_ID_CHECK("/api/v1/user/check-id", WhitelistMethod.GET),
CUSTOMER_KEY_CHECK("/api/v1/user/customer-key", WhitelistMethod.GET),
EXAM("/api/v1/exam", WhitelistMethod.GET),
EXAM_AREAS("/api/v1/exam/areas", WhitelistMethod.GET),
EXAM_ALL("/api/v1/exam/all", WhitelistMethod.GET),
//USER find-id
USER_FIND_ID("/api/v1/user/me/find-id", WhitelistMethod.POST),
//USER find-password
USER_FIND_PASSWORD("/api/v1/user/me/find-password", WhitelistMethod.POST),
USER_ID_CHECK("/api/v1/user/check-id", WhitelistMethod.GET),
CUSTOMER_KEY_CHECK("/api/v1/user/customer-key", WhitelistMethod.GET),
EXAM("/api/v1/exams", WhitelistMethod.GET),
// 사용자 계정 관련
USER_FIND_ID("/api/v1/user/me/find-id", WhitelistMethod.POST),
USER_FIND_PASSWORD("/api/v1/user/me/find-password", WhitelistMethod.POST),


APPLICATION_GUEST("/api/v1/applications/guest", WhitelistMethod.ALL);
private final String path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ public ResponseEntity<ApiResponseWrapper<Void>> register(
}

@GetMapping("/all")
@PreAuthorize("isAuthenticated() and hasRole('ADMIN')")
public ResponseEntity<ApiResponseWrapper<List<ExamResponse>>> getExams() {
List<ExamResponse> response = examService.getExams();
return ResponseEntity.ok(
ApiResponseWrapper.success(HttpStatus.OK, "전체 시험 정보 조회 성공", response));
}

@GetMapping
@PreAuthorize("isAuthenticated() and hasRole('USER')")
public ResponseEntity<ApiResponseWrapper<List<ExamResponse>>> getByArea(
@RequestParam String areaName
) {
Expand All @@ -55,7 +53,6 @@ public ResponseEntity<ApiResponseWrapper<List<ExamResponse>>> getByArea(
}

@GetMapping("/areas")
@PreAuthorize("isAuthenticated() and hasRole('USER')")
public ResponseEntity<ApiResponseWrapper<List<String>>> getDistinctAreas() {
List<String> response = examService.getDistinctAreas();
return ResponseEntity.ok(
Expand Down