コード例 #1
0
 @Override
 public void removeClub(int clubNo, int comNo, boolean forcingRemove) {
   //
   if (clubDao.readClub(clubNo) == null) {
     throw NamooClubExceptionFactory.createRuntime("존재하지 않는 클럽입니다.");
   }
   if (forcingRemove) {
     memberDao.deleteAllClubMember(clubNo);
     memberDao.deleteAllClubManager(clubNo);
     memberDao.deleteClubKingManger(clubNo);
     clubDao.deleteClub(clubNo);
   } else {
     throw NamooClubExceptionFactory.createRuntime("멤버부터 탈퇴시키세요.");
   }
 }
コード例 #2
0
 @Override
 public List<ClubManager> findAllClubManager(int clubNo) {
   //
   Club club = clubDao.readClub(clubNo);
   if (club == null) {
     throw NamooClubExceptionFactory.createRuntime("클럽이 존재하지 않습니다.");
   }
   return memberDao.readAllClubManagers(clubNo);
 }
コード例 #3
0
 @Override
 public void withdrawalClub(int clubNo, String email) {
   //
   Club club = clubDao.readClub(clubNo);
   if (club == null) {
     throw NamooClubExceptionFactory.createRuntime("클럽이 존재하지 않습니다.");
   }
   memberDao.deleteClubMember(clubNo, email);
 }
コード例 #4
0
 @Override
 public int countMembers(int clubNo) {
   //
   Club club = clubDao.readClub(clubNo);
   if (club == null) {
     throw NamooClubExceptionFactory.createRuntime("클럽이 존재하지 않습니다.");
   }
   return memberDao.readAllClubMembers(clubNo).size();
 }
コード例 #5
0
  @Override
  public ClubMember findClubMember(int clubNo, String email) {
    //
    Club club = clubDao.readClub(clubNo);
    if (club == null) {
      throw NamooClubExceptionFactory.createRuntime("클럽이 존재하지 않습니다.");
    }

    return memberDao.readClubMember(clubNo, email);
  }
コード例 #6
0
  @Override
  public void joinAsMember(int clubNo, String email) {
    //
    Club club = clubDao.readClub(clubNo);
    if (club == null) {
      throw NamooClubExceptionFactory.createRuntime("클럽이 존재하지 않습니다.");
    }

    memberDao.addClubMember(new ClubMember(clubNo, new SocialPerson(email, "qwer")));
  }
コード例 #7
0
  @Override
  public Club registClub(
      int categoryNo, int communityNo, String clubName, String description, String email) {
    //
    if (isExistClubByName(communityNo, clubName)) {
      throw NamooClubExceptionFactory.createRuntime("이미 존재하는 클럽입니다.");
    }

    Club club =
        new Club(categoryNo, communityNo, clubName, description, new SocialPerson(email, "asdf"));
    int clubNo = clubDao.createClub(communityNo, club);

    SocialPerson person = userDao.readUser(email);

    memberDao.addKingManager(new ClubKingManager(clubNo, person));
    return club;
  }