Skip to content

Commit

Permalink
refactor: ErrorCode를 static import 하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook02 committed Jul 19, 2024
1 parent e080cf3 commit 2d3f282
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

import static com.gdschongik.gdsc.global.common.constant.EmailConstant.HONGIK_UNIV_MAIL_DOMAIN;
import static com.gdschongik.gdsc.global.common.constant.RegexConstant.HONGIK_EMAIL;
import static com.gdschongik.gdsc.global.exception.ErrorCode.*;

import com.gdschongik.gdsc.domain.member.domain.Member;
import com.gdschongik.gdsc.global.annotation.DomainService;
import com.gdschongik.gdsc.global.exception.CustomException;
import com.gdschongik.gdsc.global.exception.ErrorCode;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.util.Optional;

@DomainService
public class HongikUnivEmailValidator {

public void validate(String email, Optional<Member> optionalMember) {
if (!email.contains(HONGIK_UNIV_MAIL_DOMAIN)) {
throw new CustomException(ErrorCode.UNIV_EMAIL_DOMAIN_MISMATCH);
throw new CustomException(UNIV_EMAIL_DOMAIN_MISMATCH);
}

if (!email.matches(HONGIK_EMAIL)) {
Expand Down

0 comments on commit 2d3f282

Please sign in to comment.