Skip to content

Commit

Permalink
[feat] #145 온보딩 실패시 알람가도록 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeoongu committed Dec 8, 2024
1 parent 86d1849 commit 169072f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import ussum.homepage.domain.csv_user.StudentCsvRepository;
import ussum.homepage.global.error.exception.GeneralException;
import ussum.homepage.global.error.status.ErrorStatus;
import ussum.homepage.global.external.discord.DiscordUtil;
import ussum.homepage.global.external.discord.dto.EventMessage;
import ussum.homepage.infra.jpa.member.entity.MajorCode;
import ussum.homepage.infra.jpa.member.entity.MemberCode;

Expand All @@ -16,6 +18,7 @@
@RequiredArgsConstructor
public class StudentCsvReader {
private final StudentCsvRepository studentCsvRepository;
private final DiscordUtil discordUtil;

public Optional<StudentCsv> getStudentWithStudentId(Long studentId, OnBoardingRequest request) {
return studentCsvRepository.findByStudentId(studentId)
Expand All @@ -37,11 +40,12 @@ private void checkStudentRight(OnBoardingRequest request, StudentCsv studentCsv)
if (request.getMajorCode().equals(MajorCode.getEnumMajorCodeFromStringMajorCode(studentCsv.getMajor()).getStringMajorCode())){
major = true;
}else{
// 예술창작학부로 들어올시 예외 처리를 하기 위해 일단 이렇게 코드 처리
major = request.getMajorCode().equals("문예창작전공") | studentCsv.getMajor().equals("영화예술전공");
// ����â���кη� ���ý� ���� ó���� �ϱ� ���� �ϴ� �̷��� �ڵ� ó��
major = request.getMajorCode().equals("����â������") | studentCsv.getMajor().equals("��ȭ��������");
}

if(!(name && studentId && groupName && major)){
discordUtil.sendMessage(EventMessage.SIGN_UP_FAIL, "studentId : " + request.getStudentId());
throw new GeneralException(ErrorStatus.INVALID_ONBOARDING_REQUEST);
}
}
Expand Down

0 comments on commit 169072f

Please sign in to comment.