Skip to content

Commit

Permalink
[feature/Inhabas#252] 리뷰 반영:securitycontext 중복제거
Browse files Browse the repository at this point in the history
  • Loading branch information
skytin1004 committed Mar 24, 2024
1 parent d719597 commit e6ed182
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.inhabas.api.auth.domain.error.authException.InvalidAuthorityException;
import com.inhabas.api.domain.myInfo.dto.MyBoardDto;
import com.inhabas.api.domain.myInfo.dto.MyBudgetSupportApplicationDto;
import com.inhabas.api.domain.myInfo.dto.MyCommentDto;
Expand All @@ -31,9 +29,6 @@ public List<MyBoardDto> getMyBoards(Long memberId) {
List<MyBoardDto> myBoardDtoList = new ArrayList<>();

myBoardDtoList.addAll(myInfoRepository.findAllBoardsByMemberId(memberId));
if (SecurityContextHolder.getContext() == null) {
throw new InvalidAuthorityException();
}

return myBoardDtoList;
}
Expand All @@ -46,9 +41,6 @@ public List<MyCommentDto> getMyComments(Long memberId) {
List<MyCommentDto> myCommentDtoList = new ArrayList<>();

myCommentDtoList.addAll(myInfoRepository.findAllCommentsByMemberId(memberId));
if (SecurityContextHolder.getContext() == null) {
throw new InvalidAuthorityException();
}

return myCommentDtoList;
}
Expand All @@ -62,9 +54,6 @@ public List<MyBudgetSupportApplicationDto> getMyBudgetSupportApplications(Long m

budgetSupportApplicationDtoList.addAll(
myInfoRepository.findAllBudgetSupportApplicationsByMemberId(memberId));
if (SecurityContextHolder.getContext() == null) {
throw new InvalidAuthorityException();
}

return budgetSupportApplicationDtoList;
}
Expand Down

0 comments on commit e6ed182

Please sign in to comment.