1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-05 00:21:38 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

建立项目与数据库

This commit is contained in:
2022-03-12 18:49:17 +08:00
commit fe5bd2080d
24 changed files with 972 additions and 0 deletions

196
bookshelfplus.sql Normal file
View File

@@ -0,0 +1,196 @@
/*
Navicat Premium Data Transfer
Source Server : localhost MySQL 5.7
Source Server Type : MySQL
Source Server Version : 50726
Source Host : localhost:3306
Source Schema : bookshelfplus
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 12/03/2022 18:31:07
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for book_author_info
-- ----------------------------
DROP TABLE IF EXISTS `book_author_info`;
CREATE TABLE `book_author_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of book_author_info
-- ----------------------------
-- ----------------------------
-- Table structure for book_info
-- ----------------------------
DROP TABLE IF EXISTS `book_info`;
CREATE TABLE `book_info` (
`id` tinyint(11) NOT NULL AUTO_INCREMENT COMMENT '自增编号',
`book_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`category_id` int(11) NOT NULL DEFAULT 0,
`publishing_house_id` int(11) NOT NULL DEFAULT '',
`language` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`copyright` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`is_delete` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1为已删除项',
PRIMARY KEY (`id`, `book_name`) USING BTREE,
INDEX ``(`category_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of book_info
-- ----------------------------
-- ----------------------------
-- Table structure for book_publishing_house_info
-- ----------------------------
DROP TABLE IF EXISTS `book_publishing_house_info`;
CREATE TABLE `book_publishing_house_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of book_publishing_house_info
-- ----------------------------
-- ----------------------------
-- Table structure for book_thumbnail_info
-- ----------------------------
DROP TABLE IF EXISTS `book_thumbnail_info`;
CREATE TABLE `book_thumbnail_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of book_thumbnail_info
-- ----------------------------
-- ----------------------------
-- Table structure for category_info
-- ----------------------------
DROP TABLE IF EXISTS `category_info`;
CREATE TABLE `category_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '分类ID',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类名',
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类简介(预留字段)',
`isShow` tinyint(1) NOT NULL DEFAULT 1 COMMENT '分类是否显示',
`order` int(11) NOT NULL COMMENT '分类顺序',
`level` int(11) NOT NULL COMMENT '分类层级(一、二、三级)',
`parentId` int(11) NOT NULL DEFAULT 0 COMMENT '父分类ID',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `cateName`(`name`) USING BTREE COMMENT '索引名称不得重复',
INDEX `parentCateId`(`parentId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 44 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of category_info
-- ----------------------------
INSERT INTO `category_info` VALUES (1, 'Git与代码版本管理', '简介123', 1, 1, 1, 0);
INSERT INTO `category_info` VALUES (2, 'LeetCode与面试', '\r\n', 1, 2, 1, 0);
INSERT INTO `category_info` VALUES (3, '操作系统Android、Linux等', '\r\n', 1, 3, 1, 0);
INSERT INTO `category_info` VALUES (4, 'Android', '\r\n', 1, 1, 2, 3);
INSERT INTO `category_info` VALUES (5, 'Linux', '\r\n', 1, 2, 2, 3);
INSERT INTO `category_info` VALUES (6, '产品与时代', '\r\n', 1, 4, 1, 0);
INSERT INTO `category_info` VALUES (7, '分布式与高并发Hadoop、ElasticSearch、区块链、架构', '\r\n', 1, 5, 1, 0);
INSERT INTO `category_info` VALUES (8, 'ElasticSearch 分布式搜索引擎', '\r\n', 1, 1, 2, 7);
INSERT INTO `category_info` VALUES (9, 'Hadoop', '\r\n', 1, 2, 2, 7);
INSERT INTO `category_info` VALUES (10, '架构', '\r\n', 1, 3, 2, 7);
INSERT INTO `category_info` VALUES (11, '区块链', '\r\n', 1, 4, 2, 7);
INSERT INTO `category_info` VALUES (12, '机器学习', '\r\n', 1, 6, 1, 0);
INSERT INTO `category_info` VALUES (13, '计算机基础(计算机组成原理、计算机网络、数据结构与算法)', '\r\n', 1, 7, 1, 0);
INSERT INTO `category_info` VALUES (14, '计算机网络', '\r\n', 1, 1, 2, 13);
INSERT INTO `category_info` VALUES (15, '计算机组成原理', '\r\n', 1, 2, 2, 13);
INSERT INTO `category_info` VALUES (16, '数据结构与算法', '\r\n', 1, 3, 2, 13);
INSERT INTO `category_info` VALUES (17, '开发语言C、C++、Java、Go、Python、HTML、JavaScript、CSS、汇编等', '\r\n', 1, 8, 1, 0);
INSERT INTO `category_info` VALUES (18, 'C++', '\r\n', 1, 2, 2, 17);
INSERT INTO `category_info` VALUES (19, 'Go', '\r\n', 1, 3, 2, 17);
INSERT INTO `category_info` VALUES (20, 'Java', '\r\n', 1, 4, 2, 17);
INSERT INTO `category_info` VALUES (21, 'Java工具', '\r\n', 1, 1, 3, 20);
INSERT INTO `category_info` VALUES (22, 'Java基础', '\r\n', 1, 2, 3, 20);
INSERT INTO `category_info` VALUES (23, 'Netty', '\r\n', 1, 3, 3, 20);
INSERT INTO `category_info` VALUES (24, 'Spring', '\r\n', 1, 4, 3, 20);
INSERT INTO `category_info` VALUES (25, '线程', '\r\n', 1, 5, 3, 20);
INSERT INTO `category_info` VALUES (26, '虚拟机', '\r\n', 1, 6, 3, 20);
INSERT INTO `category_info` VALUES (27, 'Python', '\r\n', 1, 5, 2, 17);
INSERT INTO `category_info` VALUES (28, '汇编语言', '\r\n', 1, 6, 2, 17);
INSERT INTO `category_info` VALUES (29, '前端HTML、JavaScript、CSS', '\r\n', 1, 7, 2, 17);
INSERT INTO `category_info` VALUES (30, '设计模式', '\r\n', 1, 9, 1, 0);
INSERT INTO `category_info` VALUES (31, '数据库MySQL、Redis、SQLite、Mybatis、MongoDB等', '\r\n', 1, 10, 1, 0);
INSERT INTO `category_info` VALUES (32, 'MongoDB', '\r\n', 1, 1, 2, 31);
INSERT INTO `category_info` VALUES (33, 'Mybatis', '\r\n', 1, 2, 2, 31);
INSERT INTO `category_info` VALUES (34, 'MySQL', '\r\n', 1, 3, 2, 31);
INSERT INTO `category_info` VALUES (35, 'Redis', '\r\n', 1, 4, 2, 31);
INSERT INTO `category_info` VALUES (36, 'SQLite', '\r\n', 1, 5, 2, 31);
INSERT INTO `category_info` VALUES (37, '消息队列', '\r\n', 1, 11, 1, 0);
INSERT INTO `category_info` VALUES (38, 'C语言', '\r\n', 1, 1, 2, 17);
INSERT INTO `category_info` VALUES (39, 'Spring Boot', '\r\n', 1, 7, 3, 20);
INSERT INTO `category_info` VALUES (40, 'Java进阶', '\r\n', 1, 8, 3, 20);
INSERT INTO `category_info` VALUES (41, 'Java Web', '\r\n', 1, 9, 3, 20);
INSERT INTO `category_info` VALUES (42, 'Spring Cloud', '\r\n', 1, 10, 3, 20);
INSERT INTO `category_info` VALUES (43, '其他', '\r\n', 1, 12, 1, 0);
-- ----------------------------
-- Table structure for file_info
-- ----------------------------
DROP TABLE IF EXISTS `file_info`;
CREATE TABLE `file_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增编号',
`book_id` int(11) NOT NULL,
`file_display_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`file_format` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`number_of_pages` int(11) NOT NULL DEFAULT 0,
`watermark` tinyint(1) NOT NULL DEFAULT 0,
`advertising` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1为已删除项',
`book_origin` tinyint(4) NOT NULL,
`thumbnail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`file_create_at` datetime NOT NULL,
`file_modified_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
`file_size` int(18) NOT NULL DEFAULT 0,
`hash_md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`hash_sha1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`hash_sha256` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id`, `book_id`) USING BTREE,
INDEX ``(`file_name`) USING BTREE,
INDEX `fileId`(`hash_md5`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of file_info
-- ----------------------------
-- ----------------------------
-- Table structure for file_object_info
-- ----------------------------
DROP TABLE IF EXISTS `file_object_info`;
CREATE TABLE `file_object_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
`fileId` int(11) NOT NULL,
`storage_medium_type` tinyint(4) NOT NULL DEFAULT 0,
`file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '本地文件保存相对路径(本地维护用,非线上使用)',
`file_pwd` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`file_share_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`additional_fields` json NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of file_object_info
-- ----------------------------
SET FOREIGN_KEY_CHECKS = 1;

8
bookshelfplus/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

18
bookshelfplus/.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="bookshelfplus" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="bookshelfplus" options="-parameters" />
</option>
</component>
</project>

8
bookshelfplus/.idea/encodings.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

20
bookshelfplus/.idea/jarRepositories.xml generated Normal file
View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://maven.aliyun.com/repository/public" />
</remote-repository>
</component>
</project>

14
bookshelfplus/.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@@ -0,0 +1,27 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="bookshelfplus [mybatis-generator:generate]" type="MavenRunConfiguration" factoryName="Maven" nameIsGenerated="true">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="mybatis-generator:generate" />
</list>
</option>
<option name="pomFileName" />
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>

124
bookshelfplus/.idea/uiDesigner.xml generated Normal file
View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

6
bookshelfplus/.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

195
bookshelfplus/pom.xml Normal file
View File

@@ -0,0 +1,195 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>plus.bookshelf</groupId>
<artifactId>bookshelfplus</artifactId>
<version>1.0-SNAPSHOT</version>
<name>bookshelfplus</name>
<url>http://bookshelf.plus/</url>
<!--引入SpringBoot-->
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>2.1.2.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!--引入SpringBoot-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.6.4</version>
</dependency>
<!--MySQL依赖-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.49</version>
</dependency>
<!--连接池用于管理MySQL连接-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.2.8</version>
</dependency>
<!--MyBatis对SpringBoot的支持文件-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<!--<version>1.3.2</version>-->
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<!--参数验证-->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.4.3.Final</version>
</dependency>
<!--日期时间-->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.1</version>
</dependency>
<!--引入SpringBoot对Redis的依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!--SpringBoot将Session存储在Redis中-->
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<!--自动生成数据库的映射-->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.5</version>
<dependencies>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.49</version>
</dependency>
</dependencies>
<executions>
<!--在package阶段做generate-->
<execution>
<id>mybatis generator</id>
<phase>package</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<!--考虑到项目反复生成-->
<configuration>
<!--允许移动生成的文件-->
<verbose>true</verbose>
<!--自动覆盖文件-->
<overwrite>false</overwrite>
<!--mybatis配置文件路径-->
<configurationFile>
src/main/resources/mybatis-generator.xml
</configurationFile>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!--
添加SpringBoot打包plugin
解决【flashsale-1.0-SNAPSHOT.jar中没有主清单属性】问题
-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.3</version>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,27 @@
package plus.bookshelf;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Hello world!
*
*/
@SpringBootApplication(scanBasePackages = { "plus.bookshelf" })
@RestController
@MapperScan("plus.bookshelf.mapper")
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
@RequestMapping("/")
public String Home() {
return "首页";
}
}

View File

@@ -0,0 +1,15 @@
package plus.bookshelf.Common.Enum;
public enum BookOrigin {
ORIGIN("原版电子书"),
SCAN("扫描版"),
WORD("文字版"), // 大部分是手机版的电子书重新制作成为PDF的
HEELP_DOCUMENT("帮助文档"),
OTHER("其他");
private BookOrigin(String intro) {
this.intro = intro;
}
private String intro;
}

View File

@@ -0,0 +1,28 @@
package plus.bookshelf.Common.Enum;
public enum FileFormatEnum {
PDF("pdf", "PDF文件"),
MOBI("mobi", "mobi文件"),
EPUB("epub", "epub电子书文件"),
TXT("txt", "文本文档"),
CHM("chm", "CHM帮助文档"),
AZW3("azw3", "azw3文件"),
DOC("doc", "Word文档"),
DOCX("docx", "Word文档");
private FileFormatEnum(String ext, String extIntro) {
this.ext = ext;
this.extIntro = extIntro;
}
private String ext;
private String extIntro;
public String getExt() {
return ext;
}
public String getExtIntro() {
return extIntro;
}
}

View File

@@ -0,0 +1,22 @@
package plus.bookshelf.Common.Enum;
public enum FileStorageMediumEnum {
LOCAL (10000, "本地"),
BAIDU_NETDISK (20001, "百度网盘"),
ALIYUN_DRIVE (20002, "阿里网盘");
private FileStorageMediumEnum(int storageMediumIndex, String storageMediumDisplayName) {
this.storageMediumIndex = storageMediumIndex;
this.storageMediumDisplayName = storageMediumDisplayName;
}
private Integer storageMediumIndex;
private String storageMediumDisplayName;
public Integer getStorageMediumIndex() {
return storageMediumIndex;
}
public String getStorageMediumDisplayName() {
return storageMediumDisplayName;
}
}

View File

@@ -0,0 +1,15 @@
package plus.bookshelf.Common.Enum;
public enum Language {
SIMPLIFIED_CHINESE(1000, "简体中文"),
ENGLISH(1001, "English"),
TRADITIONAL_CHINESE(1001, "繁体中文");
private Language(Integer langId, String langName) {
this.langId = langId;
this.langName = langName;
}
private Integer langId;
private String langName;
}

View File

@@ -0,0 +1,9 @@
package plus.bookshelf.Service.Model.Book;
public class AuthorModel {
// 作者Id
Integer id;
// 作者姓名
String name;
}

View File

@@ -0,0 +1,34 @@
package plus.bookshelf.Service.Model.Book;
import plus.bookshelf.Common.Enum.Language;
import plus.bookshelf.Service.Model.Category.CategoryModel;
public class BookModel {
// 书籍id
Integer id;
// 书名
String bookName;
// 书籍简介
String description;
// 作者姓名
AuthorModel[] author;
//书籍所属分类
CategoryModel category;
// 出版社
PublishingHouseModel publishingHouse;
// 语言
Language language;
// 来源(版权)信息
String copyright;
// 是否删除
Boolean isDelete;
}

View File

@@ -0,0 +1,9 @@
package plus.bookshelf.Service.Model.Book;
public class PublishingHouseModel {
// 出版社Id
Integer id;
// 出版社名称
String name;
}

View File

@@ -0,0 +1,10 @@
package plus.bookshelf.Service.Model.Book;
public class ThumbnailModel {
// 书籍缩略图Id
Integer id;
// 缩略图路径
String path;
}

View File

@@ -0,0 +1,31 @@
package plus.bookshelf.Service.Model.Category;
public class CategoryModel {
// 分类名称
Integer id;
// 分类名称
Integer name;
// 分类简介
Integer description;
Boolean isShow;
// 分类显示顺序
Integer order;
// 分类级别 0为一级分类, 1为二级分类...
Integer level;
// 所属父分类Id
Integer parentId;
// 父分类
CategoryModel parent;
// 子分类集合
CategoryModel[] children;
}

View File

@@ -0,0 +1,57 @@
package plus.bookshelf.Service.Model.File;
import org.joda.time.DateTime;
import plus.bookshelf.Common.Enum.BookOrigin;
import plus.bookshelf.Common.Enum.FileFormatEnum;
import plus.bookshelf.Service.Model.Book.ThumbnailModel;
public class FileModel {
// 文件Id
Integer id;
// 关联的书籍Id
Integer bookId;
// 文件名 (用于展示给用户的文件名,不含扩展名)
String fileDisplayName;
// 文件存储名称 (文件的实际文件名,含扩展名)
String fileName;
// 文件格式
FileFormatEnum fileFormat;
// 总页数
Integer numberOfPages;
// 是否含有水印
Boolean watermark;
// 是否有广告
Boolean advertising;
// 文件来源 电子版/扫描版
BookOrigin bookOrigin;
// 缩略图
ThumbnailModel thumbnail;
// 文件创建时间
DateTime fileCreateAt;
// 文件修改时间
DateTime fileModifiedAt;
// 文件大小
long fileSize;
// 文件哈希 - MD5
String hashMd5;
// 文件哈希 - SHA1
String hashSha1;
// 文件哈希 - SHA256
String hashSha256;
}

View File

@@ -0,0 +1,28 @@
package plus.bookshelf.Service.Model.File;
import plus.bookshelf.Common.Enum.FileStorageMediumEnum;
public class FileObjectModel {
// 文件存储介质Id
private Integer id;
// 存储的文件Id
private Integer fileId;
// 文件存储介质类型
FileStorageMediumEnum storageMediumType;
// 文件地址
// 如果是网盘就是分享链接,如果是本地存储就是文件路径
String filePath;
// 如果文件有压缩,那么就是压缩包密码
String filePwd;
// 文件提取码
String fileShareCode;
// 附加字段(JSON存储)
Object additionalFields;
}

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<context id="DB2Tables" targetRuntime="MyBatis3">
<!-- 数据库链接地址账号密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/bookshelfplus?serverTimezone=Asia/Shanghai&amp;useSSL=false"
userId="root"
password="111111">
</jdbcConnection>
<!-- 生成 DataObject 类存放位置 -->
<javaModelGenerator targetPackage="plus.bookshelf.Dao.DO" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!-- 生成映射文件存放位置 -->
<sqlMapGenerator targetPackage="mapping" targetProject="src/main/resources">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!-- 生成Dao类存放位置 -->
<!-- 客户端代码生成易于使用的针对Mode L对象和XML配置文件的代码
type="ANNOTATEDMAPPER",生成Java Model和基于注解的Mapper对象
type="MIXEDMAPPER",生成基于注解的Java Model和相应的Mapper对象
type="XM1LMAPPER",生成SQLMap XML文件和独立的Mapper接口
-->
<javaClientGenerator type="XMLMAPPER" targetPackage="plus.bookshelf.Dao.Mapper" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!--去除复杂操作语句-->
<!--enableCountByExample="false"-->
<!--enableUpdateByExample="false" -->
<!--enableDeleteByExample="false" -->
<!--enableSelectByExample="false"-->
<!--selectByExampleQueryId="false"-->
<!-- 生成对应表及其类名 -->
<table tableName="book_author_info" domainObjectName="AuthorDO" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false"></table>
<table tableName="book_publishing_house_info" domainObjectName="PublishingHouseDO" enableCountByExample="false"
enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>

View File

@@ -0,0 +1,20 @@
package plus.bookshelf;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}