-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from 0702Yoon/main
MemberSerive에 있던 mail, jwt, affiliation 기능 분리
- Loading branch information
Showing
34 changed files
with
275 additions
and
323 deletions.
There are no files selected for viewing
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
14 changes: 14 additions & 0 deletions
14
src/main/java/com/example/bigbrotherbe/domain/affiliation/service/AffiliationService.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,14 @@ | ||
package com.example.bigbrotherbe.domain.affiliation.service; | ||
|
||
import com.example.bigbrotherbe.domain.member.dto.response.AffiliationResponse; | ||
import java.util.List; | ||
|
||
public interface AffiliationService { | ||
boolean checkExistAffiliationById(Long affiliationId); | ||
|
||
List<AffiliationResponse> getColleges(); | ||
|
||
List<AffiliationResponse> getDepartments(String councilName); | ||
|
||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...main/java/com/example/bigbrotherbe/domain/affiliation/service/AffiliationServiceImpl.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,37 @@ | ||
package com.example.bigbrotherbe.domain.affiliation.service; | ||
|
||
import com.example.bigbrotherbe.domain.affiliation.component.AffiliationManger; | ||
import com.example.bigbrotherbe.domain.member.dto.response.AffiliationResponse; | ||
import com.example.bigbrotherbe.domain.member.entity.enums.AffiliationCode; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
@Service | ||
public class AffiliationServiceImpl implements AffiliationService{ | ||
private final AffiliationManger affiliationManger; | ||
@Override | ||
public boolean checkExistAffiliationById(Long affiliationId) { | ||
return affiliationManger.existsById(affiliationId); | ||
} | ||
|
||
|
||
@Override | ||
public List<AffiliationResponse> getColleges() { | ||
return Arrays.stream(AffiliationCode.values()) | ||
.filter(code -> code.getCouncilType().equals("단과대")) | ||
.map(code -> AffiliationResponse.fromAffiliationResponse(code.getVal(), code.getName())) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
@Override | ||
public List<AffiliationResponse> getDepartments(String councilName) { | ||
return AffiliationCode.getDepartmentsByCollegeName(councilName); | ||
} | ||
|
||
} |
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.