Fix book setting logic
This commit is contained in:
+1
-1
@@ -8,6 +8,6 @@ import lombok.Data;
|
||||
public class BookViewerSetting {
|
||||
private int pageNumber;
|
||||
private String zoom;
|
||||
private boolean sidebar_visible;
|
||||
private Boolean sidebar_visible;
|
||||
private String spread;
|
||||
}
|
||||
+1
-1
@@ -31,6 +31,6 @@ public class AppSettings {
|
||||
public static class PdfSettings {
|
||||
private String spread;
|
||||
private String zoom;
|
||||
private boolean sidebar;
|
||||
private Boolean sidebar;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class BookViewerSettingEntity {
|
||||
private String zoom;
|
||||
|
||||
@Column(name = "sidebar_visible")
|
||||
private boolean sidebar_visible;
|
||||
private Boolean sidebar_visible;
|
||||
|
||||
@Column(name = "spread")
|
||||
private String spread;
|
||||
|
||||
@@ -67,7 +67,7 @@ public class BooksService {
|
||||
bookViewerSetting.setPageNumber(bookViewerSettingDTO.getPageNumber());
|
||||
bookViewerSetting.setZoom(bookViewerSettingDTO.getZoom());
|
||||
bookViewerSetting.setSpread(bookViewerSettingDTO.getSpread());
|
||||
bookViewerSetting.setSidebar_visible(bookViewerSettingDTO.isSidebar_visible());
|
||||
bookViewerSetting.setSidebar_visible(bookViewerSettingDTO.getSidebar_visible());
|
||||
bookViewerSettingRepository.save(bookViewerSetting);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,10 +59,10 @@ CREATE TABLE IF NOT EXISTS category
|
||||
CREATE TABLE IF NOT EXISTS book_viewer_setting
|
||||
(
|
||||
book_id BIGINT PRIMARY KEY,
|
||||
page_number INT DEFAULT 1,
|
||||
zoom VARCHAR(16) DEFAULT 'page-fit',
|
||||
sidebar_visible BOOLEAN DEFAULT false,
|
||||
spread VARCHAR(16) DEFAULT 'odd',
|
||||
page_number INT NULL,
|
||||
zoom VARCHAR(16) NULL,
|
||||
sidebar_visible BOOLEAN NULL,
|
||||
spread VARCHAR(16) NULL,
|
||||
CONSTRAINT fk_book_viewer_setting FOREIGN KEY (book_id) REFERENCES book (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
@@ -108,7 +108,7 @@ CREATE TABLE app_settings
|
||||
(
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
category VARCHAR(255) NOT NULL,
|
||||
key1 VARCHAR (255) NOT NULL,
|
||||
key1 VARCHAR(255) NOT NULL,
|
||||
value TEXT NOT NULL,
|
||||
UNIQUE (category, key1)
|
||||
);
|
||||
@@ -8,5 +8,5 @@ VALUES ('epub', 'theme', 'white'),
|
||||
|
||||
INSERT INTO app_settings (category, key1, value)
|
||||
VALUES ('pdf', 'spread', 'odd'),
|
||||
('pdf', 'zoom', 'page_fit'),
|
||||
('pdf', 'zoom', 'page-fit'),
|
||||
('pdf', 'sidebar', 'true');
|
||||
Reference in New Issue
Block a user