-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: 스터디 랭킹 목록 반환시 페이지네이션을 반환한다. #222 * refactor: 책임 분리 #222 * fix: 생성자 주입을 추가한다. * refactor: MemberTeam의 빌더는 항상 isDelete=fasle로 한다. * test: 수정된 코드에 맞춰 테스트 수정 #222
- Loading branch information
Showing
9 changed files
with
102 additions
and
84 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/main/java/doore/member/application/convenience/StudyRoleConvenience.java
This file contains 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,28 @@ | ||
package doore.member.application.convenience; | ||
|
||
import static doore.member.domain.StudyRoleType.*; | ||
|
||
import doore.member.domain.StudyRole; | ||
import doore.member.domain.repository.StudyRoleRepository; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@Transactional | ||
@RequiredArgsConstructor | ||
public class StudyRoleConvenience { | ||
private final StudyRoleRepository studyRoleRepository; | ||
|
||
public void assignStudyLeaderRole(final Long studyId, final Long memberId) { | ||
studyRoleRepository.save(StudyRole.builder() | ||
.studyRoleType(ROLE_스터디장) | ||
.studyId(studyId) | ||
.memberId(memberId) | ||
.build()); | ||
} | ||
|
||
public Long findStudyLeaderId(final Long studyId) { | ||
return studyRoleRepository.findLeaderIdByStudyId(studyId); | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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.