Merge branch 'master' of http://nitta-lab-www.is.konan-u.ac.jp/gitbucket/git/nitta-lab-2024/CitrusServer into RefactorAccountDelete
# Conflicts:
#	src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java
commit 243c8dc55c5edb0be590f0c9b3f7e181d87ea5a4
2 parents de1827d + c053d44
h-yamamoto authored on 6 Jun
Showing 11 changed files
View
6
build.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.5'
id 'io.spring.dependency-management' version '1.1.4'
id 'org.springframework.boot' version '2.6.7'
id 'io.spring.dependency-management' version '1.1.0'
id 'war'
}
 
group = 'org.ntlab'
version = '0.0.1-SNAPSHOT'
 
java {
sourceCompatibility = '21'
sourceCompatibility = '17'
}
 
repositories {
mavenCentral()
View
54
src/main/java/org/ntlab/citrusserver/repositories/FavoriteManager.java
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を消したいとき
}
 
}
 
 
View
src/main/java/org/ntlab/citrusserver/repositories/PublicBookManager.java
View
src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java
View
src/main/java/org/ntlab/citrusserver/resources/BooksRest.java
View
src/main/java/org/ntlab/citrusserver/resources/FavoritedRest.java
View
src/main/java/org/ntlab/citrusserver/resources/FavoritesRest.java
View
src/main/java/org/ntlab/citrusserver/resources/HelloWorldRest.java
View
src/main/java/org/ntlab/citrusserver/resources/PublicBooksRest.java
View
src/main/java/org/ntlab/citrusserver/resources/ScheduleRest.java
View
src/main/java/org/ntlab/citrusserver/resources/TodoRest.java