@Test @DataSet("BaobaoTao.DataSet.xls") public void removeTopic() { forumService.removeTopic(1); Topic topicDb = forumService.getTopicByTopicId(1); assertNull(topicDb); }
public void removeTopic(int topicId) { Topic topic = topicDao.get(topicId); Board board = boardDao.get(topic.getBoardId()); board.setTopicNum(board.getTopicNum() - 1); User user = topic.getUser(); user.setCredit(user.getCredit() - 50); topicDao.remove(topic); postDao.deleteTopicPosts(topicId); }
ForumService { public void removeTopic(int topicId) { Topic topic = topicDao.get(topicId); Board board = boardDao.get(topic.getBoardId()); board.setTopicNum(board.getTopicNum() - 1); User user = topic.getUser(); user.setCredit(user.getCredit() - 50); topicDao.remove(topic); postDao.deleteTopicPosts(topicId); } }
ForumService { public void removeTopic(int topicId) { Topic topic = topicDao.get(topicId); Board board = boardDao.get(topic.getBoardId()); board.setTopicNum(board.getTopicNum() - 1); User user = topic.getUser(); user.setCredit(user.getCredit() - 50); topicDao.remove(topic); postDao.deleteTopicPosts(topicId); }  }
ForumService { public void removeTopic(int topicId) { Topic topic = topicDao.get(topicId); Board board = boardDao.get(topic.getBoardId()); board.setTopicNum(board.getTopicNum() - 1); User user = topic.getUser(); user.setCredit(user.getCredit() - 50); topicDao.remove(topic); postDao.deleteTopicPosts(topicId); }  void addTopic(Topic topic); void removeTopic(int topicId); void addPost(Post post); void removePost(int postId); void addBoard(Board board); void removeBoard(int boardId); void makeDigestTopic(int topicId); List<Board> getAllBoards(); Page getPagedTopics(int boardId,int pageNo,int pageSize); Page getPagedPosts(int topicId,int pageNo,int pageSize); Page queryTopicByTitle(String title,int pageNo,int pageSize); Board getBoardById(int boardId); Topic getTopicByTopicId(int topicId); Post getPostByPostId(int postId); void addBoardManager(int boardId,String userName); void updateTopic(Topic topic); void updatePost(Post post); }
ForumService { public void removeTopic(int topicId) { Topic topic = topicDao.get(topicId); Board board = boardDao.get(topic.getBoardId()); board.setTopicNum(board.getTopicNum() - 1); User user = topic.getUser(); user.setCredit(user.getCredit() - 50); topicDao.remove(topic); postDao.deleteTopicPosts(topicId); }  void addTopic(Topic topic); void removeTopic(int topicId); void addPost(Post post); void removePost(int postId); void addBoard(Board board); void removeBoard(int boardId); void makeDigestTopic(int topicId); List<Board> getAllBoards(); Page getPagedTopics(int boardId,int pageNo,int pageSize); Page getPagedPosts(int topicId,int pageNo,int pageSize); Page queryTopicByTitle(String title,int pageNo,int pageSize); Board getBoardById(int boardId); Topic getTopicByTopicId(int topicId); Post getPostByPostId(int postId); void addBoardManager(int boardId,String userName); void updateTopic(Topic topic); void updatePost(Post post);  }