Exemple #1
0
 private void validateDuplicateMember(Member member) {
   List<Member> findMembers = memberRepository.findByName(member.getName());
   if (!findMembers.isEmpty()) {
     throw new IllegalStateException("이미 존재하는 회원입니다.");
   }
 }
Exemple #2
0
 /** 전체 회원 조회 */
 public List<Member> findMembers() {
   return memberRepository.findAll();
 }
Exemple #3
0
  /** 회원 가입 */
  public Long join(Member member) {

    validateDuplicateMember(member); // 중복 회원 검증
    memberRepository.save(member);
    return member.getId();
  }