diff --git a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java index a305d5a..6a00427 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java @@ -3,10 +3,7 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import org.ntlab.citrusserver.entities.Account; -import org.ntlab.citrusserver.repositories.AccountManager; -import org.ntlab.citrusserver.repositories.BookManager; -import org.ntlab.citrusserver.repositories.ScheduleManager; -import org.ntlab.citrusserver.repositories.TodoManager; +import org.ntlab.citrusserver.repositories.*; import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.http.HttpStatus; import org.springframework.stereotype.Component; @@ -23,13 +20,15 @@ private final BookManager bookManager; private final TodoManager todoManager; private final ScheduleManager scheduleManager; + private final FavoriteManager favoriteManager; @Autowired//springbootの決まり - public AccountsRest(AccountManager am, BookManager bm, TodoManager tm, ScheduleManager sm) { + public AccountsRest(AccountManager am, BookManager bm, TodoManager tm, ScheduleManager sm, FavoriteManager favoriteManager) { accountManager = am; bookManager = bm; todoManager = tm; scheduleManager = sm; + this.favoriteManager = favoriteManager; } // アカウントの一覧をリストとして返す(GET) @@ -82,6 +81,7 @@ bookManager.deleteAllBooks(accountId); todoManager.deleteAllTodosByAccountId(accountId); scheduleManager.deleteSchedules(accountId); + favoriteManager.removeFavoriteById(accountId); return; } //404