fix: Remove duplicate cache declaration and fix switch statement syntax

This commit is contained in:
2025-02-09 19:07:44 +03:00
parent 5378ab9707
commit 48ecce8ef8
@@ -60,7 +60,6 @@ public class BookManageServiceImpl implements BookManageService {
bookCreationService.handleNewAddRequest(user, text);
break;
default:
BookCreationCache creationCache = bookCacheService.getCache(user.getId());
if (creationCache != null && creationCache.getCreationState() != null) {
// Handle book creation states
bookCreationService.handleExistingAddCache(user, text);
@@ -69,13 +68,14 @@ public class BookManageServiceImpl implements BookManageService {
switch (editCache.getBookEditState()) {
case SELECTING_BOOK ->
bookCreationService.handleNewAddRequest(user, text);
case EDITING_TITLE ->
bookEditingService.updateBookTitle(user, text);
case EDITING_AUTHOR ->
bookEditingService.updateBookAuthor(user, text);
case EDITING_RATING ->
bookEditingService.updateBookRating(user, text);
case CHOOSING_FIELD -> {} // No action needed
case EDITING_TITLE ->
bookEditingService.updateBookTitle(user, text);
case EDITING_AUTHOR ->
bookEditingService.updateBookAuthor(user, text);
case EDITING_RATING ->
bookEditingService.updateBookRating(user, text);
case CHOOSING_FIELD -> {} // No action needed
}
}
}
@@ -123,7 +123,7 @@ public class BookManageServiceImpl implements BookManageService {
}
public String getWelcomeMessage() {
private String getWelcomeMessage() {
return "✨ *Добро пожаловать в Бок Книжник\\!* 📚\n" +
"_Ваш персональный помощник для управления библиотекой_\n\n" +
"Чтобы начать, отправьте:\n" +