Skip to content

Commit

Permalink
[Refactor] 학교 데이터베이스 관련 문제로 임시 로그인 조치 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
hen715 committed Jul 23, 2024
1 parent ee1ab05 commit 8aed0e8
Showing 1 changed file with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,15 @@ public List<MemberResponseDto> getAllMember(){

@Transactional
public TokenDto schoolLogin(LoginDto loginDto){
//서버 관련 문제로 일시적 관리자 로그인 추가
if(memberRepository.existsByStudentId(loginDto.getStudentId()) && memberRepository.findByStudentId(loginDto.getStudentId()).get().getRoles().get(0).equals("ROLE_ADMIN")){
Member member = memberRepository.findByStudentId(loginDto.getStudentId()).get();
return login(member);
if (!schoolLoginRepository.loginCheck(loginDto.getStudentId(), loginDto.getPassword())) {
throw new MyException(MyErrorCode.STUDENT_LOGIN_ERROR);
}
else {
if (!schoolLoginRepository.loginCheck(loginDto.getStudentId(), loginDto.getPassword())) {
throw new MyException(MyErrorCode.STUDENT_LOGIN_ERROR);
}
if (!memberRepository.existsByStudentId(loginDto.getStudentId())) {
createMember(loginDto.getStudentId());
}
Member member = memberRepository.findByStudentId(loginDto.getStudentId()).orElseThrow(() -> new MyException(MyErrorCode.USER_NOT_FOUND));
return login(member);
if (!memberRepository.existsByStudentId(loginDto.getStudentId())) {
createMember(loginDto.getStudentId());
}
Member member = memberRepository.findByStudentId(loginDto.getStudentId()).orElseThrow(() -> new MyException(MyErrorCode.USER_NOT_FOUND));
return login(member);

}
@Transactional
public void createMember(String studentId){
Expand Down

0 comments on commit 8aed0e8

Please sign in to comment.