Add cache logic

This commit is contained in:
2025-02-09 19:31:44 +03:00
parent 48ecce8ef8
commit 04fb31ec3d
2 changed files with 16 additions and 1 deletions
@@ -7,8 +7,22 @@ import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Data
public class BookCreationCache {
public enum CreationState {
ADDING_TITLE,
ADDING_AUTHOR,
ADDING_RATING
}
private String title;
private String author;
private Integer rating;
private CreationState creationState = CreationState.ADDING_TITLE;
public CreationState getCreationState() {
return creationState;
}
public void setCreationState(CreationState creationState) {
this.creationState = creationState;
}
}
@@ -2,6 +2,7 @@ package ru.cathub.telegabot;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.TestPropertySource;