-
Notifications
You must be signed in to change notification settings - Fork 3
[feature] 개발자 페이지 만들어서 관리 쉽게 ㄱㄱ #1164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,4 +42,6 @@ summary*.html | |
|
|
||
| application.properties | ||
| moadong.json | ||
| firebase.json | ||
| firebase.json | ||
|
|
||
| /.cursor | ||
60 changes: 60 additions & 0 deletions
60
backend/src/main/java/moadong/club/controller/ClubAdminController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| 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 jakarta.validation.Valid; | ||
| import lombok.AllArgsConstructor; | ||
| import moadong.club.payload.request.ClubInfoRequest; | ||
| import moadong.club.payload.request.ClubRecruitmentInfoUpdateRequest; | ||
| import moadong.club.payload.response.ClubListResponse; | ||
| import moadong.club.service.ClubProfileService; | ||
| import moadong.global.payload.Response; | ||
| import moadong.user.annotation.CurrentUser; | ||
| import moadong.user.payload.CustomUserDetails; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.PutMapping; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/api/admin") | ||
| @AllArgsConstructor | ||
| @Tag(name = "Club Admin", description = "동아리 관리자 API (개발자 전용)") | ||
| public class ClubAdminController { | ||
|
|
||
| private final ClubProfileService clubProfileService; | ||
|
|
||
| @GetMapping("/clubs") | ||
| @Operation(summary = "동아리 목록 조회", description = "전체 동아리 목록을 조회합니다. DEVELOPER 역할 필요.") | ||
| @SecurityRequirement(name = "BearerAuth") | ||
| public ResponseEntity<?> getAllClubs() { | ||
| ClubListResponse response = clubProfileService.getAllClubsForAdmin(); | ||
| return Response.ok(response); | ||
| } | ||
|
|
||
| @PutMapping("/club/{clubId}/info") | ||
| @Operation(summary = "동아리 약력 수정 (관리자)", description = "지정한 clubId 동아리의 약력을 수정합니다. DEVELOPER 역할 필요.") | ||
| @SecurityRequirement(name = "BearerAuth") | ||
| public ResponseEntity<?> updateClubInfo( | ||
| @CurrentUser CustomUserDetails user, | ||
| @PathVariable String clubId, | ||
| @RequestBody @Valid ClubInfoRequest request) { | ||
| clubProfileService.updateClubInfoByClubId(clubId, request, user); | ||
| return Response.ok("success update club info"); | ||
| } | ||
|
|
||
| @PutMapping("/club/{clubId}/description") | ||
| @Operation(summary = "동아리 모집정보 수정 (관리자)", description = "지정한 clubId 동아리의 모집정보를 수정합니다. DEVELOPER 역할 필요.") | ||
| @SecurityRequirement(name = "BearerAuth") | ||
| public ResponseEntity<?> updateClubDescription( | ||
| @CurrentUser CustomUserDetails user, | ||
| @PathVariable String clubId, | ||
| @RequestBody ClubRecruitmentInfoUpdateRequest request) { | ||
| clubProfileService.updateClubRecruitmentInfoByClubId(clubId, request, user); | ||
| return Response.ok("success update club description"); | ||
| } | ||
| } | ||
9 changes: 9 additions & 0 deletions
9
backend/src/main/java/moadong/club/payload/response/ClubListResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package moadong.club.payload.response; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record ClubListResponse(List<ClubListResponseItem> clubs) { | ||
|
|
||
| public record ClubListResponseItem(String id, String name, String userId) { | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
backend/src/main/java/moadong/global/controller/DevPortalController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package moadong.global.controller; | ||
|
|
||
| import org.springframework.stereotype.Controller; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
|
|
||
| @Controller | ||
| public class DevPortalController { | ||
|
|
||
| @GetMapping({"/dev", "/dev/"}) | ||
| public String devPortal() { | ||
| return "redirect:/dev/index.html"; | ||
| } | ||
| } |
30 changes: 30 additions & 0 deletions
30
backend/src/main/java/moadong/user/controller/DevAuthController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package moadong.user.controller; | ||
|
|
||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||
| import jakarta.validation.Valid; | ||
| import lombok.AllArgsConstructor; | ||
| import moadong.global.payload.Response; | ||
| import moadong.user.payload.request.DevRegisterRequest; | ||
| import moadong.user.service.UserCommandService; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
| @RequestMapping("/auth/dev") | ||
| @AllArgsConstructor | ||
| @Tag(name = "Dev Auth", description = "개발자 전용 계정 등록 API (시크릿 키 필요)") | ||
| public class DevAuthController { | ||
|
|
||
| private final UserCommandService userCommandService; | ||
|
|
||
| @PostMapping("/register") | ||
| @Operation(summary = "개발자 계정 등록", description = "app.dev-registration-secret과 일치하는 secret을 보내야 합니다. 개발자만 /dev, /api/admin/** 접근 가능.") | ||
| public ResponseEntity<?> registerDeveloper(@RequestBody @Valid DevRegisterRequest request) { | ||
| userCommandService.registerDeveloper(request); | ||
| return Response.ok("success register developer"); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
backend/src/main/java/moadong/user/entity/enums/UserRole.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| package moadong.user.entity.enums; | ||
|
|
||
| public enum UserRole { | ||
| CLUB_ADMIN, | ||
| DEVELOPER | ||
| } |
24 changes: 24 additions & 0 deletions
24
backend/src/main/java/moadong/user/payload/request/DevRegisterRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package moadong.user.payload.request; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
| import moadong.global.annotation.Korean; | ||
| import moadong.global.annotation.Password; | ||
| import moadong.global.annotation.PhoneNumber; | ||
| import moadong.global.annotation.UserId; | ||
|
|
||
| public record DevRegisterRequest( | ||
| @NotBlank | ||
| @UserId | ||
| String userId, | ||
| @NotBlank | ||
| @Password | ||
| String password, | ||
| @NotBlank | ||
| @Korean | ||
| String name, | ||
| @PhoneNumber | ||
| String phoneNumber, | ||
| @NotBlank | ||
| String secret | ||
| ) { | ||
| } | ||
Zepelown marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.