-
Notifications
You must be signed in to change notification settings - Fork 2
feat: 동아리 관리자 권한 위임 기능 추가 #1548
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
dradnats1012
merged 5 commits into
feat/1509-koin-club
from
feat/1527-koin-club-empowerment
May 17, 2025
Merged
Changes from all commits
Commits
Show all changes
5 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
6 changes: 6 additions & 0 deletions
6
src/main/java/in/koreatech/koin/_common/event/ClubCreateEvent.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 in.koreatech.koin._common.event; | ||
|
|
||
| public record ClubCreateEvent( | ||
| String clubName | ||
| ) { | ||
| } |
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
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
16 changes: 16 additions & 0 deletions
16
src/main/java/in/koreatech/koin/domain/club/dto/request/EmpowermentClubManagerRequest.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,16 @@ | ||
| package in.koreatech.koin.domain.club.dto.request; | ||
|
|
||
| import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotEmpty; | ||
|
|
||
| public record EmpowermentClubManagerRequest( | ||
| @Schema(description = "동아리 아이디", example = "1", requiredMode = REQUIRED) | ||
| Integer clubId, | ||
|
|
||
| @Schema(description = "위임받는 사용자의 아이디", example = "example", requiredMode = REQUIRED) | ||
| @NotEmpty(message = "위임받는 사용자의 아이디를 입력해주세요.") | ||
| String changedManagerId | ||
| ) { | ||
| } | ||
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
19 changes: 19 additions & 0 deletions
19
src/main/java/in/koreatech/koin/domain/club/exception/AlreadyManagerException.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,19 @@ | ||
| package in.koreatech.koin.domain.club.exception; | ||
|
|
||
| import in.koreatech.koin._common.exception.custom.KoinException; | ||
|
|
||
| public class AlreadyManagerException extends KoinException { | ||
| private static final String DEFAULT_MESSAGE = "이미 동아리의 관리자입니다."; | ||
|
|
||
| public AlreadyManagerException(String message) { | ||
| super(message); | ||
| } | ||
|
|
||
| public AlreadyManagerException(String message, String detail) { | ||
| super(message, detail); | ||
| } | ||
|
|
||
| public static AlreadyManagerException withDetail(String detail) { | ||
| return new AlreadyManagerException(DEFAULT_MESSAGE, detail); | ||
| } | ||
| } |
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
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
30 changes: 30 additions & 0 deletions
30
src/main/java/in/koreatech/koin/infrastructure/slack/eventlistener/ClubEventListener.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 in.koreatech.koin.infrastructure.slack.eventlistener; | ||
|
|
||
| import static org.springframework.transaction.event.TransactionPhase.AFTER_COMMIT; | ||
|
|
||
| import org.springframework.scheduling.annotation.Async; | ||
| import org.springframework.stereotype.Component; | ||
| import org.springframework.transaction.annotation.Propagation; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
| import org.springframework.transaction.event.TransactionalEventListener; | ||
|
|
||
| import in.koreatech.koin._common.event.ClubCreateEvent; | ||
| import in.koreatech.koin.infrastructure.slack.client.SlackClient; | ||
| import in.koreatech.koin.infrastructure.slack.model.SlackNotificationFactory; | ||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| @Component | ||
| @RequiredArgsConstructor | ||
| @Transactional(propagation = Propagation.REQUIRES_NEW) | ||
| public class ClubEventListener { | ||
|
|
||
| private final SlackClient slackClient; | ||
| private final SlackNotificationFactory slackNotificationFactory; | ||
|
|
||
| @Async | ||
| @TransactionalEventListener(phase = AFTER_COMMIT) | ||
| public void onClubCreateEvent(ClubCreateEvent event){ | ||
| var notification = slackNotificationFactory.generateClubCreateSendNotification(event.clubName()); | ||
| slackClient.sendMessage(notification); | ||
| } | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C
권한 위임 정의서에
현 관리자 아이디, 향후 관리자 아이디를 입력받고 있는 거 같은데 다른 부분일까요??