@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("멤버부터 탈퇴시키세요."); } }
@Override public List<ClubManager> findAllClubManager(int clubNo) { // Club club = clubDao.readClub(clubNo); if (club == null) { throw NamooClubExceptionFactory.createRuntime("클럽이 존재하지 않습니다."); } return memberDao.readAllClubManagers(clubNo); }
@Override public void withdrawalClub(int clubNo, String email) { // Club club = clubDao.readClub(clubNo); if (club == null) { throw NamooClubExceptionFactory.createRuntime("클럽이 존재하지 않습니다."); } memberDao.deleteClubMember(clubNo, email); }
@Override public int countMembers(int clubNo) { // Club club = clubDao.readClub(clubNo); if (club == null) { throw NamooClubExceptionFactory.createRuntime("클럽이 존재하지 않습니다."); } return memberDao.readAllClubMembers(clubNo).size(); }
@Override public ClubMember findClubMember(int clubNo, String email) { // Club club = clubDao.readClub(clubNo); if (club == null) { throw NamooClubExceptionFactory.createRuntime("클럽이 존재하지 않습니다."); } return memberDao.readClubMember(clubNo, email); }
@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"))); }
@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; }