| |
---|
| | favoritedMap.get(accountId).get(bookId).remove(otherAccountId); |
---|
| | } |
---|
| | |
---|
| | |
---|
| | // //delete |
---|
| | // //accountIdが本(bookId)を消した時、otherAccountIdが消える |
---|
| | // public void removeFavoritedByBookId(String accountId, int bookId) { |
---|
| | // for (String otherAccountId: favoritedMap.keySet()) { |
---|
| | // favoritedMap.get(accountId).remove(bookId); |
---|
| | // } |
---|
| | // } |
---|
| | // |
---|
| | // //delete |
---|
| | // //accountIdが消えた時、bookIdとotherAccountIdが消える |
---|
| | // public void removeFavoritedByAccountId(String accountId) { |
---|
| | // favoritedMap.remove(accountId); |
---|
| | // } |
---|
| | |
---|
| | |
---|
| | //favorites |
---|
| | |
---|
| | //get |
---|
| | //いいねした人の一覧を返す: accountIdの本(bookId)にいいねしたotherAccountIdとその本の一覧 |
---|
| |
---|
| | public void removeFavorites(String accountId, String otherAccountId, Integer bookId) { |
---|
| | favoritesMap.get(accountId).get(otherAccountId).remove(bookId); |
---|
| | } |
---|
| | |
---|
| | //delete |
---|
| | //アカウントが消去されたときに一緒に消す: すべて消える |
---|
| | public void removeFavoriteById(String accountId) { |
---|
| | for (String otherAccountId : favoritesMap.get(accountId).keySet()) { //favoritedの削除の処理 |
---|
| | for (Integer bookId : favoritesMap.get(accountId).get(otherAccountId)) { |
---|
| | favoritedMap.get(otherAccountId).get(bookId).remove(accountId); |
---|
| | |
---|
| | // accountを削除したいとき |
---|
| | public void removeFavoriteById(String accountId) { // accountIdはamika1107 |
---|
| | favoritedMap.remove(accountId); // tedのアカウントから下全部消す |
---|
| | for (String otherAccountId : favoritesMap.get(accountId).keySet()) { |
---|
| | favoritesMap.get(accountId).remove(otherAccountId); // tesのotherから下全部 |
---|
| | } |
---|
| | |
---|
| | for (Integer bookId : favoritedMap.get(accountId).keySet()) { |
---|
| | for (String otherAccountId : favoritedMap.get(accountId).get(bookId)) { |
---|
| | favoritedMap.get(accountId).get(bookId).remove(otherAccountId); |
---|
| | } |
---|
| | } |
---|
| | favoritesMap.remove(accountId); //favoritesの削除の処理 |
---|
| | favoritedMap.remove(accountId); |
---|
| | favoritesMap.remove(accountId); |
---|
| | } |
---|
| | |
---|
| | //delete |
---|
| | //本が消されたときに一緒に消す |
---|
| | public void removeFavoriteByBookID(String accountId, Integer bookId) { |
---|
| | for (String otherAccountId : favoritedMap.get(accountId).get(bookId)) { //favoritesの処理 |
---|
| | favoritesMap.get(otherAccountId).get(accountId).remove(bookId); |
---|
| | // bookIdを削除したいとき |
---|
| | public void removeFavoriteByBookID(String accountId, Integer bookId) { // accountIdはamika1107 |
---|
| | for (String otherAccountId : favoritedMap.get(accountId).get(bookId)){ |
---|
| | favoritesMap.get(otherAccountId).get(accountId).remove(bookId); // tesのbookId を削除 |
---|
| | } |
---|
| | favoritedMap.get(accountId).remove(bookId); //favoritedの処理 |
---|
| | favoritedMap.get(accountId).remove(bookId); // tedのbookIdを消したいとき |
---|
| | } |
---|
| | |
---|
| | } |
---|
| | |
---|
| | |
---|
| | |
---|
| | |