From 928bfa40ffb81e269b8d3d12259542f42dfe652d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E5=B0=8F=E5=A2=A8?= <2291200076@qq.com> Date: Mon, 18 Apr 2022 10:26:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=8C=89=E9=92=AE=E7=BE=8E?= =?UTF-8?q?=E5=8C=96=E8=B0=83=E6=95=B4=EF=BC=9B=E6=B7=BB=E5=8A=A0=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=A4=B1=E6=95=88=E5=8F=8D=E9=A6=88=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../public/assets/image/svg/aliyun_drive.svg | 2 + .../public/assets/image/svg/baidu_netdisk.svg | 1 + .../public/assets/image/svg/direct_link.svg | 1 + .../public/assets/image/svg/feedback.svg | 1 + .../public/assets/javascripts/cssUtils.js | 32 ++++ bookshelfplus-frontend/routes/index.js | 7 + bookshelfplus-frontend/views/book.html | 156 +++++++++++++++-- .../views/category-details.html | 2 +- .../views/component/footer.html | 2 + bookshelfplus-frontend/views/feedback.html | 162 ++++++++++++++++++ bookshelfplus.sql | 24 +-- .../Common/Enum/FileStorageMediumEnum.java | 2 +- 12 files changed, 363 insertions(+), 29 deletions(-) create mode 100644 bookshelfplus-frontend/public/assets/image/svg/aliyun_drive.svg create mode 100644 bookshelfplus-frontend/public/assets/image/svg/baidu_netdisk.svg create mode 100644 bookshelfplus-frontend/public/assets/image/svg/direct_link.svg create mode 100644 bookshelfplus-frontend/public/assets/image/svg/feedback.svg create mode 100644 bookshelfplus-frontend/public/assets/javascripts/cssUtils.js create mode 100644 bookshelfplus-frontend/views/feedback.html diff --git a/bookshelfplus-frontend/public/assets/image/svg/aliyun_drive.svg b/bookshelfplus-frontend/public/assets/image/svg/aliyun_drive.svg new file mode 100644 index 0000000..cf13820 --- /dev/null +++ b/bookshelfplus-frontend/public/assets/image/svg/aliyun_drive.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/bookshelfplus-frontend/public/assets/image/svg/baidu_netdisk.svg b/bookshelfplus-frontend/public/assets/image/svg/baidu_netdisk.svg new file mode 100644 index 0000000..3505fe4 --- /dev/null +++ b/bookshelfplus-frontend/public/assets/image/svg/baidu_netdisk.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/bookshelfplus-frontend/public/assets/image/svg/direct_link.svg b/bookshelfplus-frontend/public/assets/image/svg/direct_link.svg new file mode 100644 index 0000000..b6d81ad --- /dev/null +++ b/bookshelfplus-frontend/public/assets/image/svg/direct_link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/bookshelfplus-frontend/public/assets/image/svg/feedback.svg b/bookshelfplus-frontend/public/assets/image/svg/feedback.svg new file mode 100644 index 0000000..1387ccc --- /dev/null +++ b/bookshelfplus-frontend/public/assets/image/svg/feedback.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/bookshelfplus-frontend/public/assets/javascripts/cssUtils.js b/bookshelfplus-frontend/public/assets/javascripts/cssUtils.js new file mode 100644 index 0000000..d62b923 --- /dev/null +++ b/bookshelfplus-frontend/public/assets/javascripts/cssUtils.js @@ -0,0 +1,32 @@ +function copyToClipboard(content) { + var aux = document.createElement('input'); + aux.setAttribute('value', content); + aux.style.display = "none"; + document.body.appendChild(aux); + aux.select(); + document.execCommand('copy'); + document.body.removeChild(aux); +} +function showTip(e, text) { + var $i = $("").text(text); + $("body").append($i); + var x = e.pageX - $i.outerWidth() / 2, + y = e.pageY - $i.outerHeight() - 1; + $i.css({ + "position": "absolute", + "z-index": "10000", + "top": y, + "left": x, + "color": "red", + "font-size": "14px", + "font-weight": "bold", + }); + $i.animate({ + "top": y - 60, + "left": x, + "opacity": "0" + }, 600, function() { + $i.remove(); + }); + e.stopPropagation(); +} \ No newline at end of file diff --git a/bookshelfplus-frontend/routes/index.js b/bookshelfplus-frontend/routes/index.js index 70e09a7..ce42ea7 100644 --- a/bookshelfplus-frontend/routes/index.js +++ b/bookshelfplus-frontend/routes/index.js @@ -60,6 +60,13 @@ router.get('/about', function (req, res) { }); }); +router.get('/feedback', function (req, res) { + res.render('feedback', { + title: getPageTitle("用户反馈"), + headText: "用户反馈" + }); +}); + router.get('/login', function (req, res) { res.render('login', { title: getPageTitle("用户登录"), diff --git a/bookshelfplus-frontend/views/book.html b/bookshelfplus-frontend/views/book.html index 252ba01..7273e96 100644 --- a/bookshelfplus-frontend/views/book.html +++ b/bookshelfplus-frontend/views/book.html @@ -78,7 +78,7 @@ .file-item { text-align: left; background-color: #e6e6e6; - padding: 10px 20px; + padding: 15px 20px; border-radius: 5px; transition: all 0.3s; } @@ -96,20 +96,84 @@ .file-object { display: grid; - grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); place-items: center; gap: 10px; } .file-object>.file-object-item { + border: solid 2px #c6c6c6; + border-radius: 5px; + padding: 5px 8px; + min-width: 135px; + /* max-width: 150px; */ + width: 80%; + height: 60px; + position: relative; font-size: 14px; display: inline-block; transition: all 0.2s; + user-select: none; } .file-object>.file-object-item:hover { - transform: scale(1.03); - font-weight: bold; + /* transform: scale(1.03); */ + border-color: #5e5e5e; + } + + .file-object>.file-object-item>.file-object-item-title { + height: 20px; + } + .file-object>.file-object-item>.file-object-item-title>* { + vertical-align: middle; + } + + .file-object>.file-object-item img { + width: 18px; + height: 18px; + } + + .file-object>.file-object-item .outdated-feedback { + width: 20px; + height: 20px; + position: absolute; + right: 2px; + top: 2px; + cursor: pointer; + } + .file-object>.file-object-item .outdated-feedback>.outdated-feedback-tip { + display: none; + position: absolute; + width: max-content; + background: aliceblue; + padding: 3px 5px; + border: 2px solid grey; + border-radius: 4px; + z-index: 99999; + margin-left: 5px; + font-family: initial; + } + .file-object>.file-object-item .outdated-feedback:hover .outdated-feedback-tip { + display: initial; + } + .file-object>.file-object-item .outdated-feedback img { + opacity: 0.5; + transition: all 0.18s; + } + .file-object>.file-object-item .outdated-feedback:hover img { + opacity: 1; + } + + .file-object>.file-object-item>.file-object-item-content { + height: 20px; + display: grid; + place-items: center; + } + + .file-object>.file-object-item>.file-object-item-link { + height: 20px; + display: grid; + place-items: center; } /* 统一 */ @@ -151,7 +215,7 @@

下载这本书

-
+
<% /* +
--> */ %>

@@ -184,6 +261,8 @@ + + + + + + + + \ No newline at end of file diff --git a/bookshelfplus.sql b/bookshelfplus.sql index 1f53ede..e830a15 100644 --- a/bookshelfplus.sql +++ b/bookshelfplus.sql @@ -38,17 +38,17 @@ CREATE TABLE `book_info` ( -- ---------------------------- -- Records of book_info -- ---------------------------- -INSERT INTO `book_info` VALUES (1, '程序员小墨', '这是书栖网的第1本书', 3, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, '', '小墨'); -INSERT INTO `book_info` VALUES (2, '程序员小墨', '这是书栖网的第2本书', 2, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, '', '小墨'); -INSERT INTO `book_info` VALUES (3, '程序员小墨', '这是书栖网的第3本书', 1, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, '', '小墨'); -INSERT INTO `book_info` VALUES (4, '程序员小墨', '这是书栖网的第4本书', 5, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, '', '小墨'); -INSERT INTO `book_info` VALUES (5, '程序员小墨', '这是书栖网的第5本书', 4, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, '', '小墨'); -INSERT INTO `book_info` VALUES (6, '程序员小墨', '这是书栖网的第6本书', 6, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, '', '小墨'); -INSERT INTO `book_info` VALUES (7, '程序员小墨', '这是书栖网的第7本书', 7, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, '', '小墨'); -INSERT INTO `book_info` VALUES (8, '程序员小墨', '这是书栖网的第8本书', 8, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, '', '小墨'); -INSERT INTO `book_info` VALUES (9, '程序员小墨', '这是书栖网的第9本书', 9, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, '', '小墨'); -INSERT INTO `book_info` VALUES (10, '这是一本名字肥肠肥肠滴长滴书', '这是书栖网的第10本书,外加一个超级超级超级超级超级超级超级超级超级超级超级超级超级超级超级超级长的简介', 10, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, '', '小墨'); -INSERT INTO `book_info` VALUES (11, '书本名称', '这是一本很有意义的书', 1, '中国地质大学(武汉)出版社出版', 'Chinese', '版权没有', 1, 'http://localhost/api/swagger-ui/index.html#/%E4%B9%A6%E7%B1%8D%E4%BF%A1%E6%81%AF/addUsingGET', '消息'); +INSERT INTO `book_info` VALUES (1, '程序员小墨1', '这是书栖网的第1本书', 38, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '小墨'); +INSERT INTO `book_info` VALUES (2, '程序员小墨2', '这是书栖网的第2本书', 20, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '小墨'); +INSERT INTO `book_info` VALUES (3, '程序员小墨3', '这是书栖网的第3本书', 1, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '小墨'); +INSERT INTO `book_info` VALUES (4, '程序员小墨4', '这是书栖网的第4本书', 5, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '小墨'); +INSERT INTO `book_info` VALUES (5, '程序员小墨5', '这是书栖网的第5本书', 4, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '小墨'); +INSERT INTO `book_info` VALUES (6, '程序员小墨6', '这是书栖网的第6本书', 6, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '小墨'); +INSERT INTO `book_info` VALUES (7, '程序员小墨7', '这是书栖网的第7本书', 7, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '小墨'); +INSERT INTO `book_info` VALUES (8, '程序员小墨8', '这是书栖网的第8本书', 8, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '小墨'); +INSERT INTO `book_info` VALUES (9, '程序员小墨9', '这是书栖网的第9本书', 9, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '小墨'); +INSERT INTO `book_info` VALUES (10, '这是一本名字肥肠肥肠滴长滴书', '这是书栖网的第10本书,外加一个超级超级超级超级超级超级超级超级超级超级超级超级超级超级超级超级长的简介', 10, '电子工业出版社', 'Chinese', '中国工信出版集团', 0, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '小墨'); +INSERT INTO `book_info` VALUES (11, '书本名称', '这是一本很有意义的书', 1, '中国地质大学(武汉)出版社出版', 'Chinese', '版权没有', 1, 'https://img14.360buyimg.com/pop/jfs/t1/141705/31/25225/853702/61a85f89Ef68c838b/929ded96a4a7579e.png', '消息'); -- ---------------------------- -- Table structure for category_info @@ -173,7 +173,7 @@ CREATE TABLE `file_object_info` ( `upload_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '上传状态(上传成功 SUCCESS,正在上传 UPLOADING,上传终止 NOT_EXIST)', `file_sha1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '文件SHA1哈希', `last_modified` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '文件最后修改时间戳', - `additional_fields` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `additional_fields` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC; diff --git a/bookshelfplus/src/main/java/plus/bookshelf/Common/Enum/FileStorageMediumEnum.java b/bookshelfplus/src/main/java/plus/bookshelf/Common/Enum/FileStorageMediumEnum.java index e9c2a22..b4dfffb 100644 --- a/bookshelfplus/src/main/java/plus/bookshelf/Common/Enum/FileStorageMediumEnum.java +++ b/bookshelfplus/src/main/java/plus/bookshelf/Common/Enum/FileStorageMediumEnum.java @@ -4,7 +4,7 @@ public enum FileStorageMediumEnum { LOCAL("LOCAL", "本地"), QCLOUD_COS("QCLOUD_COS", "腾讯云对象存储"), BAIDU_NETDISK("BAIDU_NETDISK", "百度网盘"), - ALIYUN_DRIVE("ALIYUN_DRIVE", "阿里网盘"); + ALIYUN_DRIVE("ALIYUN_DRIVE", "阿里云盘"); private FileStorageMediumEnum(String storageMediumIndex, String storageMediumDisplayName) { this.storageMediumIndex = storageMediumIndex;