Skip to content

Commit

Permalink
Merge pull request #165 from survey-mate/feat/164
Browse files Browse the repository at this point in the history
feat: 예외 처리 추가
  • Loading branch information
JinhyeokFang authored Feb 18, 2024
2 parents 1fe552f + d0bded2 commit 049c487
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public enum Status {
SURVEY_NOT_FOUND(HttpStatus.NOT_FOUND, "SURVEY404", "설문조사를 찾을 수 없습니다."),
WRONG_PERIOD_VALUE(HttpStatus.BAD_REQUEST, "SURVEY4000", "잘못된 설문조사 기간입니다."),
BAD_SURVEY_FORM_LINK(HttpStatus.BAD_REQUEST, "SURVEY4001", "잘못된 설문조사 링크입니다."),
WRONG_REGISTRANT(HttpStatus.FORBIDDEN, "SURVEY403", "설문조사를 만든 사용자가 아닙니다."),
WRONG_REGISTRANT(HttpStatus.FORBIDDEN, "SURVEY4031", "설문조사를 만든 사용자가 아닙니다."),
NON_STUDENT_REGISTRANT(HttpStatus.FORBIDDEN, "SURVEY4032", "설문조사는 학생만 생성 가능합니다."),
ALREADY_ANSWERED(HttpStatus.CONFLICT, "SURVEY409", "이미 응답한 설문조사입니다."),

MEMBER_NOT_FOUND(HttpStatus.NOT_FOUND, "MEMBER404", "해당 아이디는 존재하지 않습니다."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import uk.jinhy.survey_mate_api.auth.domain.entity.Member;
import uk.jinhy.survey_mate_api.common.response.Status;
import uk.jinhy.survey_mate_api.common.response.exception.GeneralException;
import uk.jinhy.survey_mate_api.statement.application.dto.StatementServiceDTO;
import uk.jinhy.survey_mate_api.statement.application.service.StatementService;
import uk.jinhy.survey_mate_api.survey.application.dto.SurveyCommandServiceDTO;
Expand All @@ -18,6 +20,9 @@ public class SurveyServiceFacadeImpl implements SurveyServiceFacade {

@Transactional
public Survey createSurvey(Member registrant, SurveyCommandServiceDTO.CreateSurveyDTO dto) {
if (!registrant.isStudent()) {
throw new GeneralException(Status.WRONG_REGISTRANT);
}
StatementServiceDTO.PayPointDTO payPointDTO = StatementServiceDTO
.PayPointDTO
.builder()
Expand Down

0 comments on commit 049c487

Please sign in to comment.