mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-01 15:26:37 +00:00
Compare commits
335 Commits
Author | SHA1 | Date | |
---|---|---|---|
b02a2b3b2c | |||
f28c8a9c16 | |||
e44978617f | |||
aa2929a3cd | |||
281561c85b | |||
cab350dbb2 | |||
9ed465784a | |||
e2cfa5a788 | |||
6fb1e5cc99 | |||
749fd1aeaa | |||
8c3fb7f1ca | |||
c71eadef82 | |||
3ffa75dc10 | |||
8ddc6cc434 | |||
5854536c70 | |||
a7d825cc54 | |||
687eb61846 | |||
9f23f817b1 | |||
0c59adf23b | |||
57eca58b24 | |||
c76df15a7f | |||
3b0edd8e1f | |||
2c3b735d49 | |||
b45b83fdb0 | |||
29d074ec18 | |||
282bc7b707 | |||
68b3458c30 | |||
2f5002f673 | |||
d293d7bf91 | |||
a9080310a4 | |||
1f571f9b64 | |||
7be529fe4a | |||
2f62641b63 | |||
d962620814 | |||
7640d153ac | |||
3d9f52ffee | |||
0112af202b | |||
e3010ea81e | |||
05608d0316 | |||
4f6ec5aa0f | |||
01984f7137 | |||
617f6f50b0 | |||
e0686f079c | |||
5fb1717770 | |||
4bf495b6c0 | |||
028c200764 | |||
472440ef7c | |||
5278b5fc39 | |||
9a0a79957b | |||
d93bf3dd4e | |||
09a4f39172 | |||
3abe7e22c9 | |||
5e1135268a | |||
54aeef7c80 | |||
027fbffb7f | |||
5d70e44021 | |||
607deaa82f | |||
b997367f1a | |||
3d3cbc22b6 | |||
ba272bd89a | |||
7d1b024c4d | |||
e732c0fdee | |||
78de1de846 | |||
0b728b9fe5 | |||
ec3428c358 | |||
3c322a9d0e | |||
cdceb3818d | |||
6fc2df9b5a | |||
c45b81fbbf | |||
40a999f353 | |||
547bf00f46 | |||
d6849bc5a2 | |||
dc654086f3 | |||
303cc2051f | |||
fe90345f0b | |||
7ac4b62840 | |||
029cce959b | |||
7395cf63e5 | |||
906e7762c9 | |||
465e03a17b | |||
2a69a28a0c | |||
c1eb7b8954 | |||
16e381f384 | |||
094ac95428 | |||
96662fcb17 | |||
fecf03b3f5 | |||
e7f702ece0 | |||
b2c67c4f15 | |||
6a385877ac | |||
7cde6ebf61 | |||
78969f9fd1 | |||
b2eb6686e9 | |||
c537f6fb20 | |||
16e4c98a45 | |||
776083076c | |||
2bf945fe0e | |||
ede7aca66d | |||
396452b46e | |||
fc2ea40c6a | |||
bfe4d938fd | |||
7f4728191a | |||
80b393fdda | |||
e7897c988a | |||
750c8dee02 | |||
cbfd0b049f | |||
7f0331e095 | |||
3520200a87 | |||
4939bcf418 | |||
1cffbae495 | |||
b99b6ae4f2 | |||
2e2a58c84b | |||
4fe36a8f4f | |||
b5df86d5c7 | |||
9b3ba1d8c1 | |||
c4db754d23 | |||
8d3ce53dba | |||
d32d9d8410 | |||
05ae012e05 | |||
b60a0c9b40 | |||
3efaf8ce5f | |||
ebc4210774 | |||
655ec90906 | |||
f28dd867ef | |||
8e6842a495 | |||
928cb2417f | |||
625694ba1e | |||
d6c0337c09 | |||
689efc0807 | |||
4540c3781e | |||
9d2c453bb0 | |||
9de47ce697 | |||
c79974ff77 | |||
fb0098aef8 | |||
e83494cb17 | |||
419d7a971b | |||
83eda2a44d | |||
3182029bdd | |||
19d4a9960d | |||
2603150b33 | |||
f5e440390b | |||
91e525ec8e | |||
83afb9e6e2 | |||
19d4c6b778 | |||
d22200b8c7 | |||
43fe1150fd | |||
65b65f874f | |||
3b6bc859a5 | |||
cfc55a6c92 | |||
0a80c5662d | |||
02fd0d7e25 | |||
521142a792 | |||
c567e37423 | |||
b5e0814eb4 | |||
ca6c2aec96 | |||
34859c839b | |||
039f9d9cf8 | |||
224829dd1f | |||
1a5122209a | |||
48aff7cf37 | |||
e673f9be9d | |||
20469bd669 | |||
755300db3c | |||
a790f8042d | |||
d0db2021a6 | |||
c403fc7496 | |||
e4927d7ac6 | |||
a00a2141f2 | |||
7cc7d8b541 | |||
e4822979e2 | |||
ab741ec6bf | |||
057c0646cd | |||
57a9cd09ef | |||
1a49e2a340 | |||
f8411c2337 | |||
343a741c21 | |||
f1a5fb4813 | |||
0428356bd4 | |||
c01097cd5f | |||
7e650a0a04 | |||
45c59ecc37 | |||
5e3962fef4 | |||
7f5035e369 | |||
44aad39847 | |||
6ad51908d5 | |||
f03ab953d0 | |||
5cc9dfa1bc | |||
2fbda60617 | |||
39c19ac004 | |||
7494fe431a | |||
c9f1500976 | |||
f61c252e71 | |||
6fd183c2ae | |||
c3daaecaaa | |||
1b6cc8ccd5 | |||
0a10504461 | |||
1046a7ffc1 | |||
612555dbe6 | |||
d5768e4011 | |||
5982eb623f | |||
85ad5fa3b2 | |||
bdc81f7676 | |||
f31c86f362 | |||
45d8902429 | |||
ff9696bb7e | |||
cacebcaa33 | |||
355cb80458 | |||
a8c74d061c | |||
a713b66c1b | |||
e9d915c1fe | |||
cd3520971d | |||
dc4c9138ee | |||
f830600c3e | |||
154210719f | |||
11e744e6a8 | |||
944ef912e2 | |||
2ce51d5fc0 | |||
2f4b671d84 | |||
6ffd8d90d7 | |||
1e2b6f4103 | |||
24c7175872 | |||
a6b009cc84 | |||
04afa759a7 | |||
1be39a0f13 | |||
2fd0349a80 | |||
79fd85ab9b | |||
0b22bbb111 | |||
7f4d315f25 | |||
f7375c5779 | |||
194461f729 | |||
6bf6b44493 | |||
cffa00a54a | |||
b279763383 | |||
cfe19854a5 | |||
28cebad48d | |||
68a1ece57c | |||
77645da2bd | |||
36376aa623 | |||
9e98665cca | |||
9a19a33406 | |||
a4f7042b87 | |||
31aa3192fd | |||
cd11854eff | |||
85f5048fd9 | |||
f625ee38e1 | |||
2c3e346ea7 | |||
66093cb065 | |||
beba6e5154 | |||
04d3aef82b | |||
018daf8d37 | |||
8e0f1f12a4 | |||
165c96cd48 | |||
e343134ce2 | |||
a1adb2c7df | |||
81a82d8e72 | |||
1d33094bd7 | |||
4cccea5d75 | |||
fbfb68583f | |||
655957904b | |||
99e973091d | |||
5fdf618223 | |||
03c4e6c54b | |||
29527301cf | |||
29d03a7a22 | |||
ad4199dc4e | |||
4f7f9af6a9 | |||
ee2a0f514f | |||
70f04bd37c | |||
9d621edaec | |||
56c0a81c1b | |||
6b3b88c147 | |||
894ee67f56 | |||
a88891b72f | |||
5c7724c813 | |||
79c9f3e0f1 | |||
575142f9f3 | |||
83c2460c83 | |||
c7642ac2ef | |||
5af570a514 | |||
0d96ff81b6 | |||
7733cf1e3f | |||
c9c714e71e | |||
3cbb6bf3fb | |||
750e234f60 | |||
c1d485c42b | |||
0e2e6229cd | |||
f8a669eb01 | |||
6d56399d0f | |||
1a0c1f864b | |||
b193aca288 | |||
7a6d7a4442 | |||
5505840b6e | |||
8eb3048b91 | |||
1b138c2aad | |||
f5e2dbaa6b | |||
b6cb9aaedc | |||
f9f1e474ec | |||
06bf848e99 | |||
6e171d20ed | |||
c62acc288e | |||
9975faed01 | |||
8fde3a3725 | |||
430504ee28 | |||
16447c60ec | |||
be7cbe2d6f | |||
8f1ed88b07 | |||
9b9851e7ab | |||
a55edf0408 | |||
856c4c0667 | |||
e4dd5bcb71 | |||
5dbddbdd96 | |||
73be43e1c5 | |||
ce2a3b4647 | |||
68abdeca93 | |||
0b505a3922 | |||
353cb8c536 | |||
e1e1310b9e | |||
4c42ac0d29 | |||
d025d3d514 | |||
a0fb8e481a | |||
80b933db8d | |||
87a060280a | |||
9c78f400dc | |||
c2cdf73893 | |||
a13ea78c3f | |||
0144b77983 | |||
07b9ffde96 | |||
002a0723f7 | |||
8a628f081f | |||
4aa6b82143 | |||
c80b02caf0 | |||
5e16119880 | |||
231b94f1da | |||
92ce982899 | |||
8c2e43c04f | |||
f553d23fb9 |
23
.gitignore
vendored
23
.gitignore
vendored
@ -1,16 +1,7 @@
|
|||||||
/.idea
|
**/logs
|
||||||
/cachedata
|
**/.idea
|
||||||
/logs
|
**/cachedata
|
||||||
/novel-common/target
|
**/target
|
||||||
/novel-front/target
|
**/*.iml
|
||||||
/novel-front/*.iml
|
**/.DS_Store
|
||||||
/novel-common/*.iml
|
|
||||||
/novel-mobile/target
|
|
||||||
/novel-mobile/*.iml
|
|
||||||
/novel-front/novel-front.iml
|
|
||||||
/novel-crawl/novel-crawl.iml
|
|
||||||
/novel-crawl/target
|
|
||||||
/novel-admin/target
|
|
||||||
/*.iml
|
|
||||||
/novel-admin/*.iml
|
|
||||||
.DS_Store
|
|
||||||
|
176
README.md
176
README.md
@ -1,142 +1,88 @@
|
|||||||
[](https://cloud.tencent.com/act/cps/redirect?redirect=1052&cps_key=736e609d66e0ac4e57813316cec6fd0b&from=console)
|
[]( https://cloud.tencent.com/act/cps/redirect?redirect=2446&cps_key=736e609d66e0ac4e57813316cec6fd0b&from=console )
|
||||||
|
|
||||||
# 小说精品屋-plus
|
<p align="center">
|
||||||
|
<a href='https://github.com/201206030/novel-plus'><img alt="Github stars" src="https://img.shields.io/github/stars/201206030/novel-plus?logo=github"></a>
|
||||||
|
<a href='https://github.com/201206030/novel-plus'><img alt="Github forks" src="https://img.shields.io/github/forks/201206030/novel-plus?logo=github"></a>
|
||||||
|
<a href='https://gitee.com/novel_dev_team/novel-plus'><img alt="Gitee stars" src="https://gitee.com/novel_dev_team/novel-plus/badge/star.svg?theme=gitee"></a>
|
||||||
|
<a href='https://gitee.com/novel_dev_team/novel-plus'><img alt="Gitee forks" src="https://gitee.com/novel_dev_team/novel-plus/badge/fork.svg?theme=gitee"></a>
|
||||||
|
<a href="https://github.com/201206030/novel-plus"><img src="https://visitor-badge.glitch.me/badge?page_id=201206030.novel-plus" alt="visitors"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
#### 演示地址
|
<p align="center">
|
||||||
|
👉 <a href='https://novel.xxyopen.com'>官网</a> | 👉 <a href='https://www.bilibili.com/video/BV1Zo4y187Mi'>项目演示</a> | 👉 <a href='https://docs.xxyopen.com/course/novelplus/1.html'>安装教程</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
[点击前往](http://www.java2nb.com)(前台门户)
|
## 项目介绍
|
||||||
|
|
||||||
#### 前言
|
novel-plus 是一个多端(PC、WAP)阅读,功能完善的原创文学 CMS
|
||||||
|
系统。由前台门户系统、作家后台管理系统、平台后台管理系统和爬虫管理系统等多个子系统构成,包括小说推荐、作品检索、小说排行、小说阅读、小说评论、会员中心、作家专区等功能,支持自定义多模版、可拓展的多种小说内容存储方式(内置数据库分表存储和
|
||||||
|
TXT 文本存储)、阅读主题切换、多爬虫源自动采集和更新数据、会员充值、订阅模式、新闻发布和实时统计报表。
|
||||||
|
|
||||||
小说精品屋-plus致力于打造一个完整的商用小说门户平台,使用前建议先阅读此文档。
|
## 项目地址
|
||||||
|
|
||||||
#### 项目介绍
|
- 学习版:[GitHub](https://github.com/201206030/novel) | [码云](https://gitee.com/novel_dev_team/novel)
|
||||||
|
| [保姆级教程](https://docs.xxyopen.com)
|
||||||
|
- **应用版**:[GitHub](https://github.com/201206030/novel-plus) | [码云](https://gitee.com/novel_dev_team/novel-plus)
|
||||||
|
- 微服务版:[GitHub](https://github.com/201206030/novel-cloud) | [码云](https://gitee.com/novel_dev_team/novel-cloud)
|
||||||
|
|
||||||
[小说精品屋](https://github.com/201206030/fiction_house)是一个多平台(web、安卓app、微信小程序)、功能完善的小说弹幕网站,包含精品小说专区、轻小说专区和漫画专区。包括小说/漫画分类、小说/漫画搜索、小说/漫画排行、完本小说/漫画、小说/漫画评分、小说/漫画在线阅读、小说/漫画书架、小说/漫画阅读记录、小说下载、小说弹幕、小说/漫画自动爬取、小说内容自动分享到微博、邮件自动推广、链接自动推送到百度搜索引擎等功能。包含电脑端、移动端、微信小程序等多个平台,现已开源web端、安卓端、小程序端源码。
|
## 项目结构
|
||||||
|
|
||||||
小说精品屋-plus是在小说精品屋的基础上,重新进行了数据库设计、代码重构和功能增强,提升了程序整体的可读性和性能,增加了很多商用特性。主要升级如下:
|
|
||||||
|
|
||||||
- [x] 数据库重新设计,结构调整。
|
|
||||||
- [x] 服务端代码重构,MyBatis3升级为MyBatis3DynamicSql。
|
|
||||||
- [x] 移动站与PC站站点分离,浏览器自动识别跳转。
|
|
||||||
- [x] PC站UI更新。
|
|
||||||
- [x] 新闻模块。
|
|
||||||
- [x] 排行榜。
|
|
||||||
- [x] 小说评论模块。
|
|
||||||
- [x] 阅读主题模块。
|
|
||||||
- [x] 作家专区。
|
|
||||||
- [x] 充值。
|
|
||||||
- [x] 后台管理系统。
|
|
||||||
- [x] 爬虫管理系统。
|
|
||||||
|
|
||||||
#### 项目结构
|
|
||||||
|
|
||||||
```
|
```
|
||||||
novel-plus -- 父工程
|
novel-plus -- 父工程
|
||||||
├── novel-common -- 通用模块
|
├── novel-common -- 通用模块
|
||||||
├── novel-front -- 前台门户系统
|
├── novel-front -- 前台门户&作家后台
|
||||||
├── novel-crawl -- 爬虫管理系统
|
├── novel-crawl -- 爬虫
|
||||||
└── novel-admin -- 后台管理系统
|
├── novel-admin -- 管理后台
|
||||||
|
└── templates -- 前端模版
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 技术选型
|
## 技术选型
|
||||||
Springboot+Mybatis+Mysql+Ehcache+Thymeleaf+Layui
|
|
||||||
|
|
||||||
#### PC站截图
|
| 技术 | 说明
|
||||||
|
|---------------------| ---------------------------
|
||||||
|
| Spring Boot | Spring 应用快速开发脚手架
|
||||||
|
| MyBatis | 持久层 ORM 框架
|
||||||
|
| MyBatis Dynamic SQL | Mybatis 动态 sql
|
||||||
|
| PageHelper | MyBatis 分页插件
|
||||||
|
| MyBatis Generator | 持久层代码生成插件
|
||||||
|
| Sharding-JDBC | 代码层分库分表中间件
|
||||||
|
| JJWT | JWT 登录支持
|
||||||
|
| Spring Security | 安全框架
|
||||||
|
| Apache Shiro | 安全框架
|
||||||
|
| Redis | 缓存方案
|
||||||
|
| Aliyun OSS | 阿里云对象存储服务(图片存储方式之一,一行配置即可切换)
|
||||||
|
| FastDFS | 开源轻量级分布式文件系统(图片存储方式之一,一行配置即可切换)
|
||||||
|
| Lombok | 简化对象封装工具
|
||||||
|
| Docker | 应用容器引擎
|
||||||
|
| MySQL | 数据库服务
|
||||||
|
| Thymeleaf | 模板引擎
|
||||||
|
| Layui | 前端 UI 框架
|
||||||
|
|
||||||
|
## 项目演示
|
||||||
|
|
||||||
|
https://www.bilibili.com/video/BV1Zo4y187Mi
|
||||||
|
|
||||||

|
## 增值服务
|
||||||
|
|
||||||
|
👉 [了解详情](https://novel.xxyopen.com/service.htm)
|
||||||
|
|
||||||
|
## 微信公众号
|
||||||
|
|
||||||

|
发布最新更新动态、最新前端模版、最新爬虫规则、文档教程等。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 赞赏支持
|
||||||
|
|
||||||

|
开源项目不易,若此项目能得到你的青睐,那么你可以赞赏支持作者持续开发与维护。
|
||||||
|
|
||||||
|
- 服务器的费用也是一笔开销
|
||||||
|
- 编写更完备的文档教程
|
||||||
|
- 发布更多前端模版和爬虫规则
|
||||||
|
- 一杯咖啡
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
#### 手机站截图
|
## 免责声明
|
||||||
|
|
||||||
1. 首页
|
本项目提供的爬虫工具仅用于采集项目初期的测试数据,请勿用于商业盈利。 用户使用本系统从事任何违法违规的事情,一切后果由用户自行承担,作者不承担任何责任。
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2. 小说详情页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
3. 目录页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
4. 小说阅读页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 爬虫管理系统截图
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 安装步骤
|
|
||||||
|
|
||||||
##### 数据库安装:
|
|
||||||
|
|
||||||
1. 安装MySQL软件。
|
|
||||||
2. 修改MySQL`max_allowed_packet `配置(建议100M)。
|
|
||||||
3. 新建数据库,设置编码为utf8mb4。
|
|
||||||
4. 执行sql/novel_plus.sql脚本文件。
|
|
||||||
|
|
||||||
##### 爬虫管理系统安装:
|
|
||||||
|
|
||||||
1. 修改novel-common模块下application-dev.yml文件中的数据库的配置。
|
|
||||||
2. 修改novel-crawl模块下application.yml文件中的管理员账号密码。
|
|
||||||
3. 启动程序,打开浏览器,默认8081端口访问。
|
|
||||||
4. 选择已有或新增爬虫源(支持自定义爬虫规则),点击`开启`按钮,开始爬取小说数据。
|
|
||||||
|
|
||||||
##### 前台小说门户安装:
|
|
||||||
|
|
||||||
1. 修改novel-common模块下application-dev.yml文件中的数据库的配置。
|
|
||||||
2. 启动程序,打开浏览器,默认8080端口访问。
|
|
||||||
|
|
||||||
**喜欢此项目的可以给我的GitHub和Gitee加个Star支持一下 。**
|
|
||||||
|
|
||||||
#### 其他安装教程
|
|
||||||
|
|
||||||
包安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4272630)
|
|
||||||
|
|
||||||
宝塔安装教程(非官方):[点击前往](https://www.daniao.org/9166.html)
|
|
||||||
|
|
||||||
docker安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4271989)
|
|
||||||
|
|
||||||
#### 代码仓库
|
|
||||||
|
|
||||||
Gitee仓库地址: https://gitee.com/xiongxyang/novel-plus
|
|
||||||
|
|
||||||
GitHub仓库地址: https://github.com/201206030/novel-plus
|
|
||||||
|
|
||||||
#### QQ交流群
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### 捐赠支持
|
|
||||||
|
|
||||||
开源项目不易,若此项目能得到你的青睐,可以捐赠支持作者持续开发与维护。
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### 备注
|
|
||||||
|
|
||||||
精品小说屋所有相关项目均已在开源中国公开,感兴趣的可进入[开源中国](https://www.oschina.net/p/fiction_house)按关键字`精品小说屋`搜索。
|
|
||||||
|
|
||||||
[](https://www.aliyun.com/minisite/goods?userCode=uf4nasee )
|
|
||||||
|
BIN
assets/QQ20200520-215756.png
Normal file
BIN
assets/QQ20200520-215756.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 105 KiB |
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 62 KiB |
Binary file not shown.
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 185 KiB |
116
doc/api/api.md
Normal file
116
doc/api/api.md
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
|
||||||
|
<h1 class="curproject-name"> 小说精品屋-plus </h1>
|
||||||
|
小说精品屋-plus接口
|
||||||
|
|
||||||
|
|
||||||
|
# 作家模块
|
||||||
|
|
||||||
|
## 小说章节分页列表查询接口
|
||||||
|
<a id=小说章节分页列表查询接口> </a>
|
||||||
|
### 基本信息
|
||||||
|
|
||||||
|
**Path:** /book/queryIndexList
|
||||||
|
|
||||||
|
**Method:** GET
|
||||||
|
|
||||||
|
**接口描述:**
|
||||||
|
<p>作家后台章节管理页面需要请求该接口获取小说章节分页列表信息</p>
|
||||||
|
|
||||||
|
|
||||||
|
### 请求参数
|
||||||
|
**Query**
|
||||||
|
|
||||||
|
| 参数名称 | 是否必须 | 示例 | 备注 |
|
||||||
|
| ------------ | ------------ | ------------ | ------------ |
|
||||||
|
| bookId | 是 | 1334337530296893441 | 小说ID |
|
||||||
|
| curr | 否 | 1 | 查询页码,默认1 |
|
||||||
|
| limit | 否 | 5 | 分页大小,默认5 |
|
||||||
|
|
||||||
|
### 返回数据
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead class="ant-table-thead">
|
||||||
|
<tr>
|
||||||
|
<th key=name>名称</th><th key=type>类型</th><th key=required>是否必须</th><th key=default>默认值</th><th key=desc>备注</th><th key=sub>其他信息</th>
|
||||||
|
</tr>
|
||||||
|
</thead><tbody className="ant-table-tbody"><tr key=0-0><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> code</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应状态吗,200表示成功</span></td><td key=5></td></tr><tr key=0-1><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> msg</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应信息</span></td><td key=5></td></tr><tr key=0-2><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> data</span></td><td key=1><span>object</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应数据</span></td><td key=5></td></tr><tr key=0-2-0><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> total</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">总数量</span></td><td key=5></td></tr><tr key=0-2-1><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> list</span></td><td key=1><span>object []</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">章节数据集合</span></td><td key=5><p key=3><span style="font-weight: '700'">item 类型: </span><span>object</span></p></td></tr><tr key=0-2-1-0><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> id</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">章节ID</span></td><td key=5></td></tr><tr key=0-2-1-1><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> bookId</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">小说ID</span></td><td key=5></td></tr><tr key=0-2-1-2><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> indexName</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">章节名</span></td><td key=5></td></tr><tr key=0-2-1-3><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> isVip</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">是否收费,1:收费,0:免费</span></td><td key=5></td></tr><tr key=0-2-1-4><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> updateTime</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">更新时间</span></td><td key=5></td></tr><tr key=0-2-2><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> pageNum</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">页码</span></td><td key=5></td></tr><tr key=0-2-3><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> pageSize</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">分页大小</span></td><td key=5></td></tr><tr key=0-2-4><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> size</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">当前页数量</span></td><td key=5></td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
## 小说章节删除接口
|
||||||
|
<a id=小说章节删除接口> </a>
|
||||||
|
### 基本信息
|
||||||
|
|
||||||
|
**Path:** /author/deleteIndex/{indexId}
|
||||||
|
|
||||||
|
**Method:** DELETE
|
||||||
|
|
||||||
|
**接口描述:**
|
||||||
|
<p>作家后台章节管理页面点击删除按钮请求该接口删除小说章节内容</p>
|
||||||
|
|
||||||
|
|
||||||
|
### 请求参数
|
||||||
|
**Headers**
|
||||||
|
|
||||||
|
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
|
||||||
|
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||||
|
| Content-Type | application/x-www-form-urlencoded | 是 | | |
|
||||||
|
| Authorization | | 是 | eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE2MDgzNDg0NzksInN1YiI6IntcImlkXCI6MTI1NTA2MDMyODMyMjAyNzUyMCxcInVzZXJuYW1lXCI6XCIxMzU2MDQyMTMyNFwiLFwibmlja05hbWVcIjpcIjEzNTYwNDIxMzI0XCJ9IiwiY3JlYXRlZCI6MTYwNzc0MzY3OTkxM30.0qhwis_zPb6t8wGNejMhDZ2iHCL9Tgh2UHd1gcQBCp8t6RW3ggSwtfo4l_RgMT_v8jOkLW91GzTVWlNnTE6LCA | 认证JWT,请求登录接口成功后返回 |
|
||||||
|
**路径参数**
|
||||||
|
|
||||||
|
| 参数名称 | 示例 | 备注 |
|
||||||
|
| ------------ | ------------ | ------------ |
|
||||||
|
| indexId | 1337603246936645632 | 章节ID |
|
||||||
|
|
||||||
|
### 返回数据
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead class="ant-table-thead">
|
||||||
|
<tr>
|
||||||
|
<th key=name>名称</th><th key=type>类型</th><th key=required>是否必须</th><th key=default>默认值</th><th key=desc>备注</th><th key=sub>其他信息</th>
|
||||||
|
</tr>
|
||||||
|
</thead><tbody className="ant-table-tbody"><tr key=0-0><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> code</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应状态吗,200表示成功</span></td><td key=5></td></tr><tr key=0-1><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> msg</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应信息</span></td><td key=5></td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
## 小说章节发布接口
|
||||||
|
<a id=小说章节发布接口> </a>
|
||||||
|
### 基本信息
|
||||||
|
|
||||||
|
**Path:** /author/addBookContent
|
||||||
|
|
||||||
|
**Method:** POST
|
||||||
|
|
||||||
|
**接口描述:**
|
||||||
|
<p>作家后台章节发布页面点击提交按钮请求该接口新增小说章节内容</p>
|
||||||
|
|
||||||
|
|
||||||
|
### 请求参数
|
||||||
|
**Headers**
|
||||||
|
|
||||||
|
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
|
||||||
|
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||||
|
| Content-Type | application/x-www-form-urlencoded | 是 | | |
|
||||||
|
| Authorization | | 是 | eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE2MDgzNDg0NzksInN1YiI6IntcImlkXCI6MTI1NTA2MDMyODMyMjAyNzUyMCxcInVzZXJuYW1lXCI6XCIxMzU2MDQyMTMyNFwiLFwibmlja05hbWVcIjpcIjEzNTYwNDIxMzI0XCJ9IiwiY3JlYXRlZCI6MTYwNzc0MzY3OTkxM30.0qhwis_zPb6t8wGNejMhDZ2iHCL9Tgh2UHd1gcQBCp8t6RW3ggSwtfo4l_RgMT_v8jOkLW91GzTVWlNnTE6LCA | 认证JWT,请求登录接口成功后返回 |
|
||||||
|
**Body**
|
||||||
|
|
||||||
|
| 参数名称 | 参数类型 | 是否必须 | 示例 | 备注 |
|
||||||
|
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||||
|
| bookId | text | 是 | 1334337530296893441 | 小说ID |
|
||||||
|
| indexName | text | 是 | 第六章未婚妻(下) | 章节名 |
|
||||||
|
| content | text | 是 | 开始之时,李七夜还是生疏无比,那怕他对于刀术的所有奥义了然于胸,但是,他出刀之时依然会颤抖,无法达到妙及巅毫的要求。 | 章节内容 |
|
||||||
|
| isVip | text | 是 | 1 | 是否收费,1:收费,0:免费 |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 返回数据
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead class="ant-table-thead">
|
||||||
|
<tr>
|
||||||
|
<th key=name>名称</th><th key=type>类型</th><th key=required>是否必须</th><th key=default>默认值</th><th key=desc>备注</th><th key=sub>其他信息</th>
|
||||||
|
</tr>
|
||||||
|
</thead><tbody className="ant-table-tbody"><tr key=0-0><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> code</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应状态吗,200表示成功</span></td><td key=5></td></tr><tr key=0-1><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> msg</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应信息</span></td><td key=5></td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
82
doc/es/index_create.txt
Normal file
82
doc/es/index_create.txt
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
PUT /novel
|
||||||
|
{
|
||||||
|
"mappings" : {
|
||||||
|
"book" : {
|
||||||
|
"properties" : {
|
||||||
|
"id" : {
|
||||||
|
"type" : "long"
|
||||||
|
},
|
||||||
|
"authorId" : {
|
||||||
|
"type" : "long"
|
||||||
|
},
|
||||||
|
"authorName" : {
|
||||||
|
"type" : "text",
|
||||||
|
"analyzer": "ik_smart",
|
||||||
|
"boost": 1.9
|
||||||
|
},
|
||||||
|
|
||||||
|
"bookName" : {
|
||||||
|
"type" : "text",
|
||||||
|
"analyzer": "ik_smart",
|
||||||
|
"boost": 2
|
||||||
|
},
|
||||||
|
|
||||||
|
"bookDesc" : {
|
||||||
|
"type" : "text",
|
||||||
|
"analyzer": "ik_smart",
|
||||||
|
"boost": 0.1
|
||||||
|
},
|
||||||
|
|
||||||
|
"bookStatus" : {
|
||||||
|
"type" : "short"
|
||||||
|
},
|
||||||
|
|
||||||
|
"catId" : {
|
||||||
|
"type" : "integer"
|
||||||
|
},
|
||||||
|
|
||||||
|
"catName" : {
|
||||||
|
"type" : "text",
|
||||||
|
"analyzer": "ik_smart",
|
||||||
|
"boost": 1.0
|
||||||
|
},
|
||||||
|
|
||||||
|
"lastIndexId" : {
|
||||||
|
"type" : "long"
|
||||||
|
},
|
||||||
|
|
||||||
|
"lastIndexName" : {
|
||||||
|
"type" : "text",
|
||||||
|
"analyzer": "ik_smart",
|
||||||
|
"boost": 0.1
|
||||||
|
},
|
||||||
|
|
||||||
|
"lastIndexUpdateTime" : {
|
||||||
|
"type": "keyword"
|
||||||
|
},
|
||||||
|
|
||||||
|
"picUrl" : {
|
||||||
|
"type" : "keyword"
|
||||||
|
},
|
||||||
|
|
||||||
|
"score" : {
|
||||||
|
"type" : "float"
|
||||||
|
},
|
||||||
|
|
||||||
|
"wordCount" : {
|
||||||
|
"type" : "integer"
|
||||||
|
},
|
||||||
|
|
||||||
|
"workDirection" : {
|
||||||
|
"type" : "short"
|
||||||
|
},
|
||||||
|
|
||||||
|
"visitCount" : {
|
||||||
|
"type": "long"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
87
doc/sql/20200513.sql
Normal file
87
doc/sql/20200513.sql
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
/*
|
||||||
|
Navicat MySQL Data Transfer
|
||||||
|
|
||||||
|
Source Server : localhost
|
||||||
|
Source Server Version : 50624
|
||||||
|
Source Host : localhost:3306
|
||||||
|
Source Database : novel_plus
|
||||||
|
|
||||||
|
Target Server Type : MYSQL
|
||||||
|
Target Server Version : 50624
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 2020-05-13 21:42:20
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS=0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for author
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `author`;
|
||||||
|
CREATE TABLE `author` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
|
||||||
|
`invite_code` varchar(20) DEFAULT NULL COMMENT '邀请码',
|
||||||
|
`pen_name` varchar(20) DEFAULT NULL COMMENT '笔名',
|
||||||
|
`tel_phone` varchar(20) DEFAULT NULL COMMENT '手机号码',
|
||||||
|
`chat_account` varchar(50) DEFAULT NULL COMMENT 'QQ或微信账号',
|
||||||
|
`email` varchar(50) DEFAULT NULL COMMENT '电子邮箱',
|
||||||
|
`work_direction` tinyint(4) DEFAULT NULL COMMENT '作品方向,0:男频,1:女频',
|
||||||
|
`status` tinyint(4) DEFAULT '0' COMMENT '0:正常,1:封禁',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='作者表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of author
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `author` VALUES ('1', null, 'reerer', 'abc', '13560487656', '23484388', '23484388@qq.com', '0', '0', null);
|
||||||
|
INSERT INTO `author` VALUES ('2', '1255060328322027520', 'rwrr445554', '梦入神机', '13560421324', '1179705413', 'reerer@qq.com', '0', '0', '2020-05-13 14:01:31');
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for author_code
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `author_code`;
|
||||||
|
CREATE TABLE `author_code` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`invite_code` varchar(100) DEFAULT NULL COMMENT '邀请码',
|
||||||
|
`validity_time` datetime DEFAULT NULL COMMENT '有效时间',
|
||||||
|
`is_use` tinyint(1) DEFAULT '0' COMMENT '是否使用过,0:未使用,1:使用过',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`create_user_id` bigint(20) DEFAULT NULL COMMENT '创建人ID',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `key_code` (`invite_code`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='作家邀请码表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of author_code
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `author_code` VALUES ('3', 'reerer', '2020-05-27 22:43:45', '1', '2020-05-13 11:40:56', '1');
|
||||||
|
INSERT INTO `author_code` VALUES ('4', '123456', '2020-05-28 00:00:00', '0', '2020-05-13 14:09:55', '1');
|
||||||
|
INSERT INTO `author_code` VALUES ('5', 'ww34343', '2020-05-21 00:00:00', '0', '2020-05-13 14:18:58', '1');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for user_buy_record
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `user_buy_record`;
|
||||||
|
CREATE TABLE `user_buy_record` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
|
||||||
|
`book_id` bigint(20) DEFAULT NULL COMMENT '购买的小说ID',
|
||||||
|
`book_name` varchar(50) DEFAULT NULL COMMENT '购买的小说名',
|
||||||
|
`book_index_id` bigint(20) DEFAULT NULL COMMENT '购买的章节ID',
|
||||||
|
`book_index_name` varchar(100) DEFAULT NULL COMMENT '购买的章节名',
|
||||||
|
`buy_amount` int(11) DEFAULT NULL COMMENT '购买使用的屋币数量',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '购买时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `key_userId_indexId` (`user_id`,`book_index_id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='用户消费记录表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of user_buy_record
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `user_buy_record` VALUES ('1', '1255060328322027520', '1260400284744613890', '我是一只消消乐2', '1260522024606953472', '第三章', '10', '2020-05-13 21:29:09');
|
||||||
|
INSERT INTO `user_buy_record` VALUES ('2', '1255060328322027520', '1260400284744613890', '我是一只消消乐2', '1260564410687107072', '第四章', '10', '2020-05-13 21:40:38');
|
3
doc/sql/20200518.sql
Normal file
3
doc/sql/20200518.sql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
INSERT INTO `crawl_source` (`id`, `source_name`, `crawl_rule`, `source_status`, `create_time`, `update_time`) VALUES ('4', '书趣阁', '{\r\n \"bookListUrl\": \"http://m.shuquge.com/sort/{catId}/0_{page}.html\",\r\n \"catIdRule\": {\r\n \"catId1\": \"1\",\r\n \"catId2\": \"2\",\r\n \"catId3\": \"3\",\r\n \"catId4\": \"4\",\r\n \"catId5\": \"7\",\r\n \"catId6\": \"6\",\r\n \"catId7\": \"8\"\r\n },\r\n \"bookIdPatten\": \"href=\\\"/s/(\\\\d+)\\\\.html\\\"\",\r\n \"pagePatten\": \"第(\\\\d+)/\\\\d+页\",\r\n \"totalPagePatten\": \"第\\\\d+/(\\\\d+)页\",\r\n \"bookDetailUrl\": \"http://m.shuquge.com/s/{bookId}.html\",\r\n \"bookNamePatten\": \"<a\\\\s+href=\\\"/s/\\\\d+\\\\.html\\\"><h2>([^/]+)</h2></a>\",\r\n \"authorNamePatten\": \"<p>作者:([^/]+)</p>\",\r\n \"picUrlPatten\": \"src=\\\"(http://www.shuquge.com/files/article/image/\\\\d+/\\\\d+/\\\\d+s\\\\.jpg)\\\"\",\r\n \"statusPatten\": \"<p>状态:([^/]+)</p>\",\r\n \"bookStatusRule\": {\r\n \"连载中\": 0,\r\n \"完本\": 1\r\n },\r\n \"descStart\": \"<div class=\\\"intro_info\\\">\",\r\n \"descEnd\": \"最新章节推荐地址\",\r\n \"bookIndexUrl\": \"http://www.shuquge.com/txt/{bookId}/index.html\",\r\n \"bookIndexStart\": \"》正文\",\r\n \"indexIdPatten\": \"<dd><a\\\\s+href=\\\"(\\\\d+)\\\\.html\\\">[^/]+</a></dd>\",\r\n \"indexNamePatten\": \"<dd><a\\\\s+href=\\\"\\\\d+\\\\.html\\\">([^/]+)</a></dd>\",\r\n \"bookContentUrl\": \"http://www.shuquge.com/txt/{bookId}/{indexId}.html\",\r\n \"contentStart\": \"<div id=\\\"content\\\" class=\\\"showtxt\\\">\",\r\n \"contentEnd\": \"http://www.shuquge.com\"\r\n}', '1', '2020-05-18 12:02:34', '2020-05-18 12:02:34');
|
||||||
|
INSERT INTO `crawl_source` (`id`, `source_name`, `crawl_rule`, `source_status`, `create_time`, `update_time`) VALUES ('5', '笔趣阁', '{\"bookListUrl\":\"http://m.mcmssc.com/xclass/{catId}/{page}.html\",\"catIdRule\":{\"catId1\":\"1\",\"catId2\":\"2\",\"catId3\":\"3\",\"catId4\":\"4\",\"catId5\":\"5\",\"catId6\":\"6\",\"catId7\":\"7\"},\"bookIdPatten\":\"href=\\\"/(\\\\d+_\\\\d+)/\\\"\",\"pagePatten\":\"class=\\\"page_txt\\\"\\\\s+value=\\\"(\\\\d+)/\\\\d+\\\"\\\\s+size=\",\"totalPagePatten\":\"class=\\\"page_txt\\\"\\\\s+value=\\\"\\\\d+/(\\\\d+)\\\"\\\\s+size=\",\"bookDetailUrl\":\"http://m.mcmssc.com/{bookId}/\",\"bookNamePatten\":\"<span\\\\s+class=\\\"title\\\">([^/]+)</span>\",\"authorNamePatten\":\"<a\\\\s+href=\\\"/author/\\\\d+/\\\">([^/]+)</a>\",\"picUrlPatten\":\"<img\\\\s+src=\\\"([^>]+)\\\"\\\\s+onerror=\",\"picUrlPrefix\":\"http://m.mcmssc.com/\",\"statusPatten\":\">状态:([^/]+)<\",\"bookStatusRule\":{\"连载\":0,\"全本\":1},\"visitCountPatten\":\">点击:(\\\\d+)<\",\"descStart\":\"<p class=\\\"review\\\">\",\"descEnd\":\"</p>\",\"bookIndexUrl\":\"http://m.mcmssc.com/{bookId}/all.html\",\"indexIdPatten\":\"<a\\\\s+href=\\\"/\\\\d+_\\\\d+/(\\\\d+)\\\\.html\\\">[^/]+</a>\",\"indexNamePatten\":\"<a\\\\s+href=\\\"/\\\\d+_\\\\d+/\\\\d+\\\\.html\\\">([^/]+)</a>\",\"bookContentUrl\":\"http://www.mcmssc.com/{bookId}/{indexId}.html\",\"contentStart\":\"</p>\",\"contentEnd\":\"<div align=\\\"center\\\">\"}', '1', '2020-05-18 15:57:41', '2020-05-18 15:57:41');
|
||||||
|
UPDATE `crawl_source` SET `source_name` = '书趣阁', `crawl_rule` = '{\n \"bookListUrl\": \"http://m.shuquge.com/sort/{catId}/0_{page}.html\",\n \"catIdRule\": {\n \"catId1\": \"1\",\n \"catId2\": \"2\",\n \"catId3\": \"3\",\n \"catId4\": \"4\",\n \"catId5\": \"7\",\n \"catId6\": \"6\",\n \"catId7\": \"8\"\n },\n \"bookIdPatten\": \"href=\\\"/s/(\\\\d+)\\\\.html\\\"\",\n \"pagePatten\": \"第(\\\\d+)/\\\\d+页\",\n \"totalPagePatten\": \"第\\\\d+/(\\\\d+)页\",\n \"bookDetailUrl\": \"http://m.shuquge.com/s/{bookId}.html\",\n \"bookNamePatten\": \"<a\\\\s+href=\\\"/s/\\\\d+\\\\.html\\\"><h2>([^/]+)</h2></a>\",\n \"authorNamePatten\": \"<p>作者:([^/]+)</p>\",\n \"picUrlPatten\": \"src=\\\"(http://www.shuquge.com/files/article/image/\\\\d+/\\\\d+/\\\\d+s\\\\.jpg)\\\"\",\n \"statusPatten\": \"<p>状态:([^/]+)</p>\",\n \"bookStatusRule\": {\n \"连载中\": 0,\n \"完本\": 1\n },\n \"descStart\": \"<div class=\\\"intro_info\\\">\",\n \"descEnd\": \"最新章节推荐地址\",\n \"bookIndexUrl\": \"http://www.shuquge.com/txt/{bookId}/index.html\",\n \"bookIndexStart\": \"<dt>《\",\n \"indexIdPatten\": \"<dd><a\\\\s+href=\\\"(\\\\d+)\\\\.html\\\">[^/]+</a></dd>\",\n \"indexNamePatten\": \"<dd><a\\\\s+href=\\\"\\\\d+\\\\.html\\\">([^/]+)</a></dd>\",\n \"bookContentUrl\": \"http://www.shuquge.com/txt/{bookId}/{indexId}.html\",\n \"contentStart\": \"<div id=\\\"content\\\" class=\\\"showtxt\\\">\",\n \"contentEnd\": \"http://www.shuquge.com\"\n}', `source_status` = 1, `create_time` = '2020-05-18 12:02:34', `update_time` = '2020-05-18 12:02:34' WHERE `id` = 4;
|
2
doc/sql/20200608.sql
Normal file
2
doc/sql/20200608.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
INSERT INTO `crawl_source` (`id`, `source_name`, `crawl_rule`, `source_status`, `create_time`, `update_time`) VALUES
|
||||||
|
(6, '新笔趣阁', '{\n \"bookListUrl\": \"http://www.xbiquge.la/fenlei/{catId}_{page}.html\",\n \"catIdRule\": {\n \"catId1\": \"1\",\n \"catId2\": \"2\",\n \"catId3\": \"3\",\n \"catId4\": \"4\",\n \"catId5\": \"6\",\n \"catId6\": \"5\"\n },\n \"bookIdPatten\": \"<a\\\\s+href=\\\"http://www.xbiquge.la/(\\\\d+/\\\\d+)/\\\"\\\\s+target=\\\"_blank\\\">\",\n \"pagePatten\": \"<em\\\\s+id=\\\"pagestats\\\">(\\\\d+)/\\\\d+</em>\",\n \"totalPagePatten\": \"<em\\\\s+id=\\\"pagestats\\\">\\\\d+/(\\\\d+)</em>\",\n \"bookDetailUrl\": \"http://www.xbiquge.la/{bookId}/\",\n \"bookNamePatten\": \"<h1>([^/]+)</h1>\",\n \"authorNamePatten\": \"者:([^/]+)</p>\",\n \"picUrlPatten\": \"src=\\\"(http://www.xbiquge.la/files/article/image/\\\\d+/\\\\d+/\\\\d+s\\\\.jpg)\\\"\",\n \"bookStatusRule\": {},\n \"descStart\": \"<div id=\\\"intro\\\">\",\n \"descEnd\": \"</div>\",\n \"upadateTimePatten\": \"<p>最后更新:(\\\\d+-\\\\d+-\\\\d+\\\\s\\\\d+:\\\\d+:\\\\d+)</p>\",\n \"upadateTimeFormatPatten\": \"yyyy-MM-dd HH:mm:ss\",\n \"bookIndexUrl\": \"http://www.xbiquge.la/{bookId}/\",\n \"indexIdPatten\": \"<a\\\\s+href=\'/\\\\d+/\\\\d+/(\\\\d+)\\\\.html\'\\\\s+>[^/]+</a>\",\n \"indexNamePatten\": \"<a\\\\s+href=\'/\\\\d+/\\\\d+/\\\\d+\\\\.html\'\\\\s+>([^/]+)</a>\",\n \"bookContentUrl\": \"http://www.xbiquge.la/{bookId}/{indexId}.html\",\n \"contentStart\": \"<div id=\\\"content\\\">\",\n \"contentEnd\": \"<p>\"\n}', 0, '2020-05-23 22:46:58', '2020-05-23 22:46:58');
|
40
doc/sql/20200615.sql
Normal file
40
doc/sql/20200615.sql
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
Navicat MySQL Data Transfer
|
||||||
|
|
||||||
|
Source Server : localhost
|
||||||
|
Source Server Version : 50725
|
||||||
|
Source Host : localhost:3306
|
||||||
|
Source Database : novel_plus
|
||||||
|
|
||||||
|
Target Server Type : MYSQL
|
||||||
|
Target Server Version : 50725
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 2020-06-15 15:06:55
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS=0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for crawl_single_task
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `crawl_single_task`;
|
||||||
|
CREATE TABLE `crawl_single_task` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`source_id` int(11) DEFAULT NULL COMMENT '爬虫源ID',
|
||||||
|
`source_name` varchar(50) DEFAULT NULL COMMENT '爬虫源名',
|
||||||
|
`source_book_id` varchar(255) DEFAULT NULL COMMENT '源站小说ID',
|
||||||
|
`cat_id` int(11) DEFAULT NULL COMMENT '分类ID',
|
||||||
|
`book_name` varchar(50) DEFAULT NULL COMMENT '爬取的小说名',
|
||||||
|
`author_name` varchar(50) DEFAULT NULL COMMENT '爬取的小说作者名',
|
||||||
|
`task_status` tinyint(1) DEFAULT '2' COMMENT '任务状态,0:失败,1:成功,2;未执行',
|
||||||
|
`exc_count` tinyint(2) DEFAULT '0' COMMENT '已经执行次数,最多执行5次',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COMMENT='抓取单本小说任务表';
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of crawl_single_task
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `crawl_single_task` VALUES ('6', '2', '百书斋', '1', '1', '1', '1', '0', '5', '2020-06-15 14:36:07');
|
||||||
|
INSERT INTO `crawl_single_task` VALUES ('7', '5', '笔趣阁', '108_108291', '1', '衍天志之不朽仙', '白衣少年丶', '1', '1', '2020-06-15 14:46:08');
|
27
doc/sql/20201103.sql
Normal file
27
doc/sql/20201103.sql
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
CREATE TABLE `author_income_detail` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
|
||||||
|
`author_id` bigint(20) NOT NULL COMMENT '作家ID',
|
||||||
|
`book_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '作品ID,0表示全部作品',
|
||||||
|
`income_date` date NOT NULL COMMENT '收入日期',
|
||||||
|
`income_account` int(11) NOT NULL DEFAULT '0' COMMENT '订阅总额',
|
||||||
|
`income_count` int(11) NOT NULL DEFAULT '0' COMMENT '订阅次数',
|
||||||
|
`income_number` int(11) NOT NULL DEFAULT '0' COMMENT '订阅人数',
|
||||||
|
`create_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='稿费收入明细统计表';
|
||||||
|
|
||||||
|
CREATE TABLE `author_income` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
|
||||||
|
`author_id` bigint(20) NOT NULL COMMENT '作家ID',
|
||||||
|
`book_id` bigint(20) NOT NULL COMMENT '作品ID',
|
||||||
|
`income_month` date NOT NULL COMMENT '收入月份',
|
||||||
|
`pre_tax_income` bigint(20) NOT NULL DEFAULT '0' COMMENT '税前收入(分)',
|
||||||
|
`after_tax_income` bigint(20) NOT NULL DEFAULT '0' COMMENT '税后收入(分)',
|
||||||
|
`pay_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付状态,0:待支付,1:已支付',
|
||||||
|
`confirm_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '稿费确认状态,0:待确认,1:已确认',
|
||||||
|
`detail` varchar(255) DEFAULT NULL COMMENT '详情',
|
||||||
|
`create_time` datetime DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='稿费收入统计表';
|
1
doc/sql/20201109.sql
Normal file
1
doc/sql/20201109.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
alter table book add column `yesterday_buy` int(11) DEFAULT '0' COMMENT '昨日订阅数' after comment_count;
|
1
doc/sql/20201122.sql
Normal file
1
doc/sql/20201122.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
alter table book_index add column `book_price` int(3) DEFAULT 0 COMMENT '章节费用(屋币)' after `is_vip`;
|
32
doc/sql/20201201.sql
Normal file
32
doc/sql/20201201.sql
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (246, 241, '批量删除', NULL, 'novel:news:batchRemove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (245, 241, '删除', NULL, 'novel:news:remove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (244, 241, '修改', NULL, 'novel:news:edit', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (243, 241, '新增', NULL, 'novel:news:add', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (242, 241, '查看', NULL, 'novel:news:detail', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (241, 234, '新闻列表', 'novel/news', 'novel:news:news', 1, 'fa', 8, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (240, 235, '批量删除', NULL, 'novel:category:batchRemove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (239, 235, '删除', NULL, 'novel:category:remove', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (238, 235, '修改', NULL, 'novel:category:edit', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (237, 235, '新增', NULL, 'novel:category:add', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (236, 235, '查看', NULL, 'novel:category:detail', 2, NULL, 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (235, 234, '类别管理', 'novel/category', 'novel:category:category', 1, 'fa', 6, NULL, NULL);
|
||||||
|
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (234, 0, '新闻管理', '', '', 0, 'fa fa-newspaper-o', 8, NULL, NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4889, 1, 246);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4890, 1, 245);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4891, 1, 244);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4892, 1, 243);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4893, 1, 242);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4899, 1, 241);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4894, 1, 240);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4895, 1, 239);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4896, 1, 238);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4897, 1, 237);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4898, 1, 236);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4900, 1, 235);
|
||||||
|
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4888, 1, 234);
|
||||||
|
|
||||||
|
|
||||||
|
delete from sys_menu where menu_id = 202;
|
1
doc/sql/20210726.sql
Normal file
1
doc/sql/20210726.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
alter table news add column `read_count` BIGINT NOT NULL DEFAULT '0' COMMENT '阅读量' after content;
|
3
doc/sql/20210913.sql
Normal file
3
doc/sql/20210913.sql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
alter table book_index add column storage_type varchar(10) NOT NULL DEFAULT 'db' COMMENT '存储方式' after book_price ;
|
||||||
|
|
||||||
|
|
121
doc/sql/20230413.sql
Normal file
121
doc/sql/20230413.sql
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
CREATE TABLE `website_info`
|
||||||
|
(
|
||||||
|
id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
name varchar(50) NOT NULL COMMENT '网站名',
|
||||||
|
domain varchar(50) NOT NULL COMMENT '网站域名',
|
||||||
|
keyword varchar(50) NOT NULL COMMENT 'SEO关键词',
|
||||||
|
description varchar(512) NOT NULL COMMENT '网站描述',
|
||||||
|
qq varchar(20) NOT NULL COMMENT '站长QQ',
|
||||||
|
logo varchar(200) NOT NULL COMMENT '网站logo图片(默认)',
|
||||||
|
logo_dark varchar(200) NOT NULL COMMENT '网站logo图片(深色)',
|
||||||
|
create_time datetime null comment '创建时间',
|
||||||
|
create_user_id bigint null comment '创建人ID',
|
||||||
|
update_time datetime null comment '更新时间',
|
||||||
|
update_user_id bigint null comment '更新人ID',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='网站信息表';
|
||||||
|
|
||||||
|
INSERT INTO website_info (id, name, domain, keyword, description, qq, logo, logo_dark, create_time, create_user_id,
|
||||||
|
update_time, update_user_id)
|
||||||
|
VALUES (1, '小说精品屋', 'www.xxyopen.com', '小说精品屋,小说,小说CMS,原创文学系统,开源小说系统,免费小说建站程序',
|
||||||
|
'小说精品屋是一个多端(PC、WAP)阅读、功能完善的原创文学CMS系统,由前台门户系统、作家后台管理系统、平台后台管理系统、爬虫管理系统等多个子系统构成,支持会员充值、订阅模式、新闻发布和实时统计报表等功能,新书自动入库,老书自动更新。',
|
||||||
|
'1179705413', 'https://youdoc.gitee.io/resource/images/logo/logo.png',
|
||||||
|
'https://youdoc.gitee.io/resource/images/logo/logo_white.png', null, null, null, null);
|
||||||
|
|
||||||
|
INSERT INTO sys_menu (menu_id, parent_id, name, url, perms, type, icon, order_num, gmt_create, gmt_modified)
|
||||||
|
VALUES (300, 0, '网站管理', '', '', 0, 'fa fa-television', 6, null, null);
|
||||||
|
|
||||||
|
INSERT
|
||||||
|
INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (301, 300, '网站信息', 'novel/websiteInfo', 'novel:websiteInfo:websiteInfo', '1', 'fa', '6');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 300);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 301);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (310, 300, '友情链接', 'novel/friendLink', 'novel:friendLink:friendLink', '1', 'fa', '16');
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (311, 310, '查看', null, 'novel:friendLink:detail', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (312, 310, '新增', null, 'novel:friendLink:add', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (313, 310, '修改', null, 'novel:friendLink:edit', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (314, 310, '删除', null, 'novel:friendLink:remove', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (315, 310, '批量删除', null, 'novel:friendLink:batchRemove', '2', null, '6');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 310);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 311);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 312);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 313);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 314);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 315);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO sys_menu (menu_id, parent_id, name, url, perms, type, icon, order_num, gmt_create, gmt_modified)
|
||||||
|
VALUES (400, 0, '会员管理', '', '', 0, 'fa fa-vcard', 9, null, null);
|
||||||
|
|
||||||
|
INSERT
|
||||||
|
INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (401, 400, '会员列表', 'novel/user', 'novel:user:user', '1', 'fa', '6');
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 400);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 401);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO sys_menu (menu_id, parent_id, name, url, perms, type, icon, order_num, gmt_create, gmt_modified)
|
||||||
|
VALUES (500, 0, '订单管理', '', '', 0, 'fa fa-money', 19, null, null);
|
||||||
|
|
||||||
|
INSERT
|
||||||
|
INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (501, 500, '订单列表', 'novel/pay', 'novel:pay:pay', '1', 'fa', '6');
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 500);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 501);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO sys_menu (menu_id, parent_id, name, url, perms, type, icon, order_num, gmt_create, gmt_modified)
|
||||||
|
VALUES (600, 0, '小说管理', '', '', 0, 'fa fa-book', 15, null, null);
|
||||||
|
|
||||||
|
INSERT
|
||||||
|
INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (601, 600, '小说列表', 'novel/book', 'novel:book:book', '1', 'fa', '6');
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 600);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 601);
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (602, 601, '删除', null, 'novel:book:remove', '2', null, '6');
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 602);
|
||||||
|
|
||||||
|
INSERT
|
||||||
|
INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (603, 600, '评论管理', 'novel/bookComment', 'novel:bookComment:bookComment', '1', 'fa', '10');
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 603);
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (604, 603, '删除', null, 'novel:bookComment:remove', '2', null, '6');
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 604);
|
51
doc/sql/20230418.sql
Normal file
51
doc/sql/20230418.sql
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('轮播图', '0', 'book_rec_type', '小说推荐类型', 0, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('顶部小说栏', '1', 'book_rec_type', '小说推荐类型', 1, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('本周强推', '2', 'book_rec_type', '小说推荐类型', 2, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('热门推荐', '3', 'book_rec_type', '小说推荐类型', 3, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('精品推荐', '4', 'book_rec_type', '小说推荐类型', 4, null, null, null, null, null, '', null);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (320, '300', '小说推荐', 'novel/bookSetting', 'novel:bookSetting:bookSetting', '1', 'fa', '6');
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (321, '320', '查看', null, 'novel:bookSetting:detail', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (322, '320', '新增', null, 'novel:bookSetting:add', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (323, '320', '修改', null, 'novel:bookSetting:edit', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (324, '320', '删除', null, 'novel:bookSetting:remove', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (325, '320', '批量删除', null, 'novel:bookSetting:batchRemove', '2', null, '6');
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 320);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 321);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 322);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 323);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 324);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 325);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (410, '400', '会员反馈', 'novel/userFeedback', 'novel:userFeedback:userFeedback', '1', 'fa', '16');
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 410);
|
3002
doc/sql/novel_plus.sql
Normal file
3002
doc/sql/novel_plus.sql
Normal file
File diff suppressed because it is too large
Load Diff
3
doc/sql/readme.md
Normal file
3
doc/sql/readme.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
1. novel_plus.sql 为全量 sql 文件,yyyyMMdd.sql 为增量 sql 文件
|
||||||
|
2. 第一次安装只需要执行 novel_plus.sql 文件即可
|
||||||
|
3. 后续版本升级需要根据上次代码版本的时间,执行该日期之后的增量 sql 文件(简单来说就是 sql 文件夹中相较于上次多出来的 sql 文件)
|
6
novel-admin/Dockerfile
Normal file
6
novel-admin/Dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM java:8
|
||||||
|
ADD novel-admin-1.0.0.jar /root
|
||||||
|
ENV dburl=""
|
||||||
|
ENV username=""
|
||||||
|
ENV password=""
|
||||||
|
ENTRYPOINT ["sh","-c","java -Dspring.datasource.url=${dburl} -Dspring.datasource.username=${username} -Dspring.datasource.password=${password} -jar /root/novel-admin-1.0.0.jar"]
|
@ -1,5 +0,0 @@
|
|||||||
2020-05-13 21:52:00,972 INFO (StartupInfoLogger.java:50)- Starting TestDemo on USER-20180729KA with PID 3532 (started by Administrator in E:\baseprojectparent\novel-plus\novel-admin)
|
|
||||||
2020-05-13 21:52:01,113 DEBUG (StartupInfoLogger.java:53)- Running with Spring Boot v2.0.1.RELEASE, Spring v5.0.5.RELEASE
|
|
||||||
2020-05-13 21:52:01,131 INFO (SpringApplication.java:663)- The following profiles are active: dev
|
|
||||||
2020-05-13 21:52:54,469 DEBUG (ApplicationContextRegister.java:29)- ApplicationContext registed-->org.springframework.web.context.support.GenericWebApplicationContext@5b529706: startup date [Wed May 13 21:52:01 CST 2020]; root of context hierarchy
|
|
||||||
2020-05-13 21:53:49,622 INFO (StartupInfoLogger.java:59)- Started TestDemo in 114.268 seconds (JVM running for 124.957)
|
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<artifactId>novel-admin</artifactId>
|
<artifactId>novel-admin</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>4.1.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>novel-admin</name>
|
<name>novel-admin</name>
|
||||||
@ -14,7 +14,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>2.0.1.RELEASE</version>
|
<version>2.1.8.RELEASE</version>
|
||||||
<relativePath/>
|
<relativePath/>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
@ -24,6 +24,7 @@
|
|||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<velocity.version>1.7</velocity.version>
|
<velocity.version>1.7</velocity.version>
|
||||||
<activiti.version>5.22.0</activiti.version>
|
<activiti.version>5.22.0</activiti.version>
|
||||||
|
<sharding.jdbc.version>3.0.0</sharding.jdbc.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -106,7 +107,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-spring</artifactId>
|
<artifactId>shiro-spring</artifactId>
|
||||||
<version>1.3.2</version>
|
<version>1.7.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- shiro ehcache -->
|
<!-- shiro ehcache -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -137,10 +138,6 @@
|
|||||||
<artifactId>velocity</artifactId>
|
<artifactId>velocity</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-cache</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!--<dependency>-->
|
<!--<dependency>-->
|
||||||
<!--<groupId>org.springframework.boot</groupId>-->
|
<!--<groupId>org.springframework.boot</groupId>-->
|
||||||
<!--<artifactId>spring-boot-starter-data-redis</artifactId>-->
|
<!--<artifactId>spring-boot-starter-data-redis</artifactId>-->
|
||||||
@ -199,14 +196,16 @@
|
|||||||
<version>1.4</version>
|
<version>1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- ehchache -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>io.shardingsphere</groupId>
|
||||||
<artifactId>spring-boot-starter-cache</artifactId>
|
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
|
||||||
|
<version>${sharding.jdbc.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.ehcache</groupId>
|
<groupId>io.shardingsphere</groupId>
|
||||||
<artifactId>ehcache</artifactId>
|
<artifactId>sharding-jdbc-spring-namespace</artifactId>
|
||||||
|
<version>${sharding.jdbc.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--war包部署需要-->
|
<!--war包部署需要-->
|
||||||
@ -228,17 +227,17 @@
|
|||||||
<!--<scope>provided</scope>-->
|
<!--<scope>provided</scope>-->
|
||||||
<!--</dependency>-->
|
<!--</dependency>-->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<!-- <build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<!--<plugin>
|
<!–<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<executable>true</executable>
|
<executable>true</executable>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>-->
|
</plugin>–>
|
||||||
<!--SpringBoot项目默认使用spring-boot-maven-plugin,要打成被其他项目引用的jar包,需要更换此插件-->
|
<!–SpringBoot项目默认使用spring-boot-maven-plugin,要打成被其他项目引用的jar包,需要更换此插件–>
|
||||||
<!-- <plugin>
|
<!– <plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
@ -246,23 +245,79 @@
|
|||||||
<target>1.8</target>
|
<target>1.8</target>
|
||||||
<encoding>UTF-8</encoding>
|
<encoding>UTF-8</encoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>-->
|
</plugin>–>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
</build>-->
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
<version>1.8</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<tasks>
|
||||||
|
<!-- 文件夹 -->
|
||||||
|
<copy todir="${project.build.directory}/build/config" overwrite="true">
|
||||||
|
<fileset dir="${basedir}/src/main/build/config">
|
||||||
|
<include name="*.*"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
<copy file="${project.build.directory}/${project.artifactId}-${project.version}.jar"
|
||||||
|
tofile="${project.build.directory}/build/${project.artifactId}.jar"/>
|
||||||
|
|
||||||
|
<fixcrlf srcdir="${basedir}/src/main/build/scripts" eol="unix"/>
|
||||||
|
<copy todir="${project.build.directory}/build/bin">
|
||||||
|
<fileset dir="${basedir}/src/main/build/scripts">
|
||||||
|
<include name="*.sh"/>
|
||||||
|
<include name="*.txt"/>
|
||||||
|
<include name="*.bat"/>
|
||||||
|
</fileset>
|
||||||
|
</copy>
|
||||||
|
<zip destfile='${project.build.directory}/build/${project.artifactId}.zip'>
|
||||||
|
<zipfileset filemode="755" dir='${project.build.directory}/build/'/>
|
||||||
|
</zip>
|
||||||
|
</tasks>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<!--<distributionManagement>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>nexus_release</id>
|
<id>ali</id>
|
||||||
<name>release</name>
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
<url>http://47.106.243.172:8081/nexus/content/repositories/releases/</url>
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
<snapshotRepository>
|
</repositories>
|
||||||
<id>nexus_snapshots</id>
|
<pluginRepositories>
|
||||||
<name>snapshots</name>
|
<pluginRepository>
|
||||||
<url>http://47.106.243.172:8081/nexus/content/repositories/snapshots/</url>
|
<id>ali-plugin</id>
|
||||||
</snapshotRepository>
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
</distributionManagement>-->
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
</project>
|
</project>
|
||||||
|
20
novel-admin/src/main/build/config/application-prod.yml
Normal file
20
novel-admin/src/main/build/config/application-prod.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#端口号
|
||||||
|
server:
|
||||||
|
port: 8088
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
url: jdbc:mysql://127.0.0.1:3306/novel_plus?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: test123456
|
||||||
|
redis:
|
||||||
|
host: 127.0.0.1
|
||||||
|
port: 6379
|
||||||
|
password: test123456
|
||||||
|
|
||||||
|
sharding:
|
||||||
|
jdbc:
|
||||||
|
datasource:
|
||||||
|
ds0:
|
||||||
|
jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: test123456
|
94
novel-admin/src/main/build/scripts/novel-admin.sh
Normal file
94
novel-admin/src/main/build/scripts/novel-admin.sh
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
APP_NAME=novel-admin
|
||||||
|
JAR_NAME=$APP_NAME\.jar
|
||||||
|
#PID 代表是PID文件
|
||||||
|
PID=$APP_NAME\.pid
|
||||||
|
|
||||||
|
|
||||||
|
#使用说明,用来提示输入参数
|
||||||
|
usage() {
|
||||||
|
echo "Usage: ./novel-admin.sh [start|stop|restart|status]"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
#检查程序是否在运行
|
||||||
|
is_exist(){
|
||||||
|
pid=`ps -ef|grep $JAR_NAME|grep -v grep|awk '{print $2}' `
|
||||||
|
#如果不存在返回1,存在返回0
|
||||||
|
if [ -z "${pid}" ]; then
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#启动方法
|
||||||
|
start(){
|
||||||
|
is_exist
|
||||||
|
if [ $? -eq "0" ]; then
|
||||||
|
echo ">>> 小说精品屋后台正在运行 PID = ${pid} <<<"
|
||||||
|
else
|
||||||
|
echo ">>> 小说精品屋后台开始启动 <<<"
|
||||||
|
nohup java -jar -Dspring.profiles.active=prod $JAR_NAME >/dev/null 2>&1 &
|
||||||
|
sleep 20
|
||||||
|
echo $! > $PID
|
||||||
|
echo ">>> 小说精品屋后台启动完成 PID = $! <<<"
|
||||||
|
status
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#停止方法
|
||||||
|
stop(){
|
||||||
|
#is_exist
|
||||||
|
pidf=$(cat $PID)
|
||||||
|
#echo "$pidf"
|
||||||
|
echo ">>> 小说精品屋后台 PID = $pidf 开始停止 <<<"
|
||||||
|
kill $pidf
|
||||||
|
rm -rf $PID
|
||||||
|
sleep 2
|
||||||
|
is_exist
|
||||||
|
if [ $? -eq "0" ]; then
|
||||||
|
echo ">>> 小说精品屋后台 PID = $pid 开始强制停止 <<<"
|
||||||
|
kill -9 $pid
|
||||||
|
sleep 2
|
||||||
|
status
|
||||||
|
else
|
||||||
|
status
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#输出运行状态
|
||||||
|
status(){
|
||||||
|
is_exist
|
||||||
|
if [ $? -eq "0" ]; then
|
||||||
|
echo ">>> 小说精品屋后台正在运行 PID = ${pid} <<<"
|
||||||
|
else
|
||||||
|
echo ">>> 小说精品屋后台没有运行 <<<"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#重启
|
||||||
|
restart(){
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
#根据输入参数,选择执行对应方法,不输入则执行使用说明
|
||||||
|
case "$1" in
|
||||||
|
"start")
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
"stop")
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
"status")
|
||||||
|
status
|
||||||
|
;;
|
||||||
|
"restart")
|
||||||
|
restart
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
exit 0
|
@ -1,25 +1,37 @@
|
|||||||
package com.java2nb;
|
package com.java2nb;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.CommandLineRunner;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
//关闭SpringSecurity的功能
|
import java.net.InetAddress;
|
||||||
@EnableAutoConfiguration(exclude = {
|
|
||||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
|
||||||
})
|
|
||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
@ServletComponentScan
|
@ServletComponentScan
|
||||||
@MapperScan("com.java2nb.*.dao")
|
@MapperScan("com.java2nb.*.dao")
|
||||||
@SpringBootApplication
|
@SpringBootApplication(exclude = {
|
||||||
|
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||||
|
})
|
||||||
@EnableCaching
|
@EnableCaching
|
||||||
|
@Slf4j
|
||||||
public class AdminApplication {
|
public class AdminApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(AdminApplication.class, args);
|
SpringApplication.run(AdminApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
|
||||||
|
return args -> {
|
||||||
|
log.info("项目启动啦,访问路径:{}", "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + ctx.getEnvironment().getProperty("server.port"));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.java2nb.common.config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 11797
|
||||||
|
*/
|
||||||
|
public interface CacheKey {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页小说设置
|
||||||
|
*/
|
||||||
|
String INDEX_BOOK_SETTINGS_KEY = "indexBookSettingsKey";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页新闻
|
||||||
|
*/
|
||||||
|
String INDEX_NEWS_KEY = "indexNewsKey";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页点击榜单
|
||||||
|
*/
|
||||||
|
String INDEX_CLICK_BANK_BOOK_KEY = "indexClickBankBookKey";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页友情链接
|
||||||
|
*/
|
||||||
|
String INDEX_LINK_KEY = "indexLinkKey";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页新书榜单
|
||||||
|
*/
|
||||||
|
String INDEX_NEW_BOOK_KEY = "indexNewBookKey";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页更新榜单
|
||||||
|
*/
|
||||||
|
String INDEX_UPDATE_BOOK_KEY = "indexUpdateBookKey";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板目录保存key
|
||||||
|
*/
|
||||||
|
String TEMPLATE_DIR_KEY = "templateDirKey";
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正在运行的爬虫线程存储KEY前缀
|
||||||
|
*/
|
||||||
|
String RUNNING_CRAWL_THREAD_KEY_PREFIX = "runningCrawlTreadDataKeyPrefix";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上一次搜索引擎更新的时间
|
||||||
|
*/
|
||||||
|
String ES_LAST_UPDATE_TIME = "esLastUpdateTime";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索引擎转换锁
|
||||||
|
*/
|
||||||
|
String ES_TRANS_LOCK = "esTransLock";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上一次搜索引擎是否更新过小说点击量
|
||||||
|
*/
|
||||||
|
String ES_IS_UPDATE_VISIT = "esIsUpdateVisit";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累积的小说点击量
|
||||||
|
*/
|
||||||
|
String BOOK_ADD_VISIT_COUNT = "bookAddVisitCount";
|
||||||
|
/**
|
||||||
|
* 测试爬虫规则缓存
|
||||||
|
*/
|
||||||
|
String BOOK_TEST_PARSE = "testParse";
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package com.java2nb.common.config;
|
package com.java2nb.common.config;
|
||||||
|
|
||||||
public class Constant {
|
public class Constant {
|
||||||
|
|
||||||
//演示系统账户
|
//演示系统账户
|
||||||
public static String DEMO_ACCOUNT = "test";
|
public static String DEMO_ACCOUNT = "test";
|
||||||
//自动去除表前缀
|
//自动去除表前缀
|
||||||
@ -16,9 +17,11 @@ public class Constant {
|
|||||||
//部门根节点id
|
//部门根节点id
|
||||||
public static Long DEPT_ROOT_ID = 0l;
|
public static Long DEPT_ROOT_ID = 0l;
|
||||||
//缓存方式
|
//缓存方式
|
||||||
public static String CACHE_TYPE_REDIS ="redis";
|
public static String CACHE_TYPE_REDIS = "redis";
|
||||||
|
|
||||||
public static String LOG_ERROR = "error";
|
public static String LOG_ERROR = "error";
|
||||||
|
|
||||||
|
public static final String UPLOAD_FILES_PREFIX = "/files/";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
package com.java2nb.common.config;
|
|
||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
|
||||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
|
||||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
|
||||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
public class RedisConfig {
|
|
||||||
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
|
|
||||||
|
|
||||||
|
|
||||||
RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
|
|
||||||
|
|
||||||
|
|
||||||
template.setConnectionFactory(factory);
|
|
||||||
|
|
||||||
|
|
||||||
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
|
|
||||||
|
|
||||||
|
|
||||||
ObjectMapper om = new ObjectMapper();
|
|
||||||
|
|
||||||
|
|
||||||
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
|
||||||
|
|
||||||
|
|
||||||
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
|
|
||||||
|
|
||||||
|
|
||||||
jackson2JsonRedisSerializer.setObjectMapper(om);
|
|
||||||
|
|
||||||
|
|
||||||
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
|
|
||||||
|
|
||||||
|
|
||||||
// key采用String的序列化方式
|
|
||||||
|
|
||||||
|
|
||||||
template.setKeySerializer(stringRedisSerializer);
|
|
||||||
|
|
||||||
|
|
||||||
// hash的key也采用String的序列化方式
|
|
||||||
|
|
||||||
|
|
||||||
template.setHashKeySerializer(stringRedisSerializer);
|
|
||||||
|
|
||||||
|
|
||||||
// value序列化方式采用jackson
|
|
||||||
|
|
||||||
|
|
||||||
template.setValueSerializer(jackson2JsonRedisSerializer);
|
|
||||||
|
|
||||||
|
|
||||||
// hash的value序列化方式采用jackson
|
|
||||||
|
|
||||||
|
|
||||||
template.setHashValueSerializer(jackson2JsonRedisSerializer);
|
|
||||||
|
|
||||||
|
|
||||||
template.afterPropertiesSet();
|
|
||||||
|
|
||||||
|
|
||||||
return template;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -5,11 +5,8 @@ import com.java2nb.common.redis.shiro.RedisCacheManager;
|
|||||||
import com.java2nb.common.redis.shiro.RedisManager;
|
import com.java2nb.common.redis.shiro.RedisManager;
|
||||||
import com.java2nb.common.redis.shiro.RedisSessionDAO;
|
import com.java2nb.common.redis.shiro.RedisSessionDAO;
|
||||||
import com.java2nb.system.shiro.UserRealm;
|
import com.java2nb.system.shiro.UserRealm;
|
||||||
import net.sf.ehcache.CacheManager;
|
|
||||||
import org.apache.shiro.cache.ehcache.EhCacheManager;
|
|
||||||
import org.apache.shiro.mgt.SecurityManager;
|
import org.apache.shiro.mgt.SecurityManager;
|
||||||
import org.apache.shiro.session.SessionListener;
|
import org.apache.shiro.session.SessionListener;
|
||||||
import org.apache.shiro.session.mgt.eis.MemorySessionDAO;
|
|
||||||
import org.apache.shiro.session.mgt.eis.SessionDAO;
|
import org.apache.shiro.session.mgt.eis.SessionDAO;
|
||||||
import org.apache.shiro.spring.LifecycleBeanPostProcessor;
|
import org.apache.shiro.spring.LifecycleBeanPostProcessor;
|
||||||
import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
|
import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
|
||||||
@ -29,6 +26,7 @@ import java.util.LinkedHashMap;
|
|||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class ShiroConfig {
|
public class ShiroConfig {
|
||||||
|
|
||||||
@Value("${spring.redis.host}")
|
@Value("${spring.redis.host}")
|
||||||
private String host;
|
private String host;
|
||||||
@Value("${spring.redis.password}")
|
@Value("${spring.redis.password}")
|
||||||
@ -38,9 +36,6 @@ public class ShiroConfig {
|
|||||||
@Value("${spring.redis.timeout}")
|
@Value("${spring.redis.timeout}")
|
||||||
private int timeout;
|
private int timeout;
|
||||||
|
|
||||||
@Value("${spring.cache.type}")
|
|
||||||
private String cacheType ;
|
|
||||||
|
|
||||||
@Value("${server.session-timeout}")
|
@Value("${server.session-timeout}")
|
||||||
private int tomcatTimeout;
|
private int tomcatTimeout;
|
||||||
|
|
||||||
@ -67,17 +62,16 @@ public class ShiroConfig {
|
|||||||
shiroFilterFactoryBean.setSuccessUrl("/index");
|
shiroFilterFactoryBean.setSuccessUrl("/index");
|
||||||
shiroFilterFactoryBean.setUnauthorizedUrl("/403");
|
shiroFilterFactoryBean.setUnauthorizedUrl("/403");
|
||||||
LinkedHashMap<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
|
LinkedHashMap<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
|
||||||
filterChainDefinitionMap.put("/login","anon");
|
filterChainDefinitionMap.put("/login", "anon");
|
||||||
filterChainDefinitionMap.put("/getVerify","anon");
|
filterChainDefinitionMap.put("/getVerify", "anon");
|
||||||
filterChainDefinitionMap.put("/css/**", "anon");
|
filterChainDefinitionMap.put("/css/**", "anon");
|
||||||
filterChainDefinitionMap.put("/js/**", "anon");
|
filterChainDefinitionMap.put("/js/**", "anon");
|
||||||
filterChainDefinitionMap.put("/fonts/**", "anon");
|
filterChainDefinitionMap.put("/fonts/**", "anon");
|
||||||
filterChainDefinitionMap.put("/img/**", "anon");
|
filterChainDefinitionMap.put("/img/**", "anon");
|
||||||
filterChainDefinitionMap.put("/docs/**", "anon");
|
filterChainDefinitionMap.put("/docs/**", "anon");
|
||||||
filterChainDefinitionMap.put("/layuimini/**", "anon");
|
filterChainDefinitionMap.put("/layuimini/**", "anon");
|
||||||
filterChainDefinitionMap.put("/druid/**", "anon");
|
|
||||||
filterChainDefinitionMap.put("/upload/**", "anon");
|
filterChainDefinitionMap.put("/upload/**", "anon");
|
||||||
filterChainDefinitionMap.put("/files/**", "anon");
|
filterChainDefinitionMap.put(Constant.UPLOAD_FILES_PREFIX + "**", "anon");
|
||||||
filterChainDefinitionMap.put("/logout", "logout");
|
filterChainDefinitionMap.put("/logout", "logout");
|
||||||
filterChainDefinitionMap.put("/blog", "anon");
|
filterChainDefinitionMap.put("/blog", "anon");
|
||||||
filterChainDefinitionMap.put("/blog/open/**", "anon");
|
filterChainDefinitionMap.put("/blog/open/**", "anon");
|
||||||
@ -93,11 +87,7 @@ public class ShiroConfig {
|
|||||||
//设置realm.
|
//设置realm.
|
||||||
securityManager.setRealm(userRealm());
|
securityManager.setRealm(userRealm());
|
||||||
// 自定义缓存实现 使用redis
|
// 自定义缓存实现 使用redis
|
||||||
if (Constant.CACHE_TYPE_REDIS.equals(cacheType)) {
|
|
||||||
securityManager.setCacheManager(rediscacheManager());
|
securityManager.setCacheManager(rediscacheManager());
|
||||||
} else {
|
|
||||||
securityManager.setCacheManager(ehCacheManager());
|
|
||||||
}
|
|
||||||
securityManager.setSessionManager(sessionManager());
|
securityManager.setSessionManager(sessionManager());
|
||||||
return securityManager;
|
return securityManager;
|
||||||
}
|
}
|
||||||
@ -109,8 +99,7 @@ public class ShiroConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启shiro aop注解支持.
|
* 开启shiro aop注解支持. 使用代理方式;所以需要开启代码支持;
|
||||||
* 使用代理方式;所以需要开启代码支持;
|
|
||||||
*
|
*
|
||||||
* @param securityManager
|
* @param securityManager
|
||||||
* @return
|
* @return
|
||||||
@ -139,8 +128,7 @@ public class ShiroConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cacheManager 缓存 redis实现
|
* cacheManager 缓存 redis实现 使用的是shiro-redis开源插件
|
||||||
* 使用的是shiro-redis开源插件
|
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -152,8 +140,7 @@ public class ShiroConfig {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RedisSessionDAO shiro sessionDao层的实现 通过redis
|
* RedisSessionDAO shiro sessionDao层的实现 通过redis 使用的是shiro-redis开源插件
|
||||||
* 使用的是shiro-redis开源插件
|
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public RedisSessionDAO redisSessionDAO() {
|
public RedisSessionDAO redisSessionDAO() {
|
||||||
@ -164,11 +151,7 @@ public class ShiroConfig {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public SessionDAO sessionDAO() {
|
public SessionDAO sessionDAO() {
|
||||||
if (Constant.CACHE_TYPE_REDIS.equals(cacheType)) {
|
|
||||||
return redisSessionDAO();
|
return redisSessionDAO();
|
||||||
} else {
|
|
||||||
return new MemorySessionDAO();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -185,19 +168,4 @@ public class ShiroConfig {
|
|||||||
return sessionManager;
|
return sessionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
|
||||||
public EhCacheManager ehCacheManager() {
|
|
||||||
EhCacheManager em = new EhCacheManager();
|
|
||||||
em.setCacheManager(cacheManager());
|
|
||||||
return em;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean("cacheManager2")
|
|
||||||
CacheManager cacheManager(){
|
|
||||||
return CacheManager.create();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,14 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
class WebConfigurer extends WebMvcConfigurerAdapter {
|
class WebConfigurer extends WebMvcConfigurerAdapter {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
JnConfig jnConfig;
|
JnConfig jnConfig;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
registry.addResourceHandler("/files/**").addResourceLocations("file:///"+ jnConfig.getUploadPath());
|
registry.addResourceHandler(Constant.UPLOAD_FILES_PREFIX + "**")
|
||||||
|
.addResourceLocations("file:///" + jnConfig.getUploadPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,12 +1,10 @@
|
|||||||
package com.java2nb.common.controller;
|
package com.java2nb.common.controller;
|
||||||
|
|
||||||
|
import com.java2nb.common.config.Constant;
|
||||||
import com.java2nb.common.config.JnConfig;
|
import com.java2nb.common.config.JnConfig;
|
||||||
import com.java2nb.common.domain.FileDO;
|
import com.java2nb.common.domain.FileDO;
|
||||||
import com.java2nb.common.service.FileService;
|
import com.java2nb.common.service.FileService;
|
||||||
import com.java2nb.common.utils.*;
|
import com.java2nb.common.utils.*;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@ -14,7 +12,11 @@ import org.springframework.ui.Model;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.*;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -115,7 +117,8 @@ public class FileController extends BaseController {
|
|||||||
if ("test".equals(getUsername())) {
|
if ("test".equals(getUsername())) {
|
||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
}
|
}
|
||||||
String fileName = jnConfig.getUploadPath() + sysFileService.get(id).getUrl().replace("/files/", "");
|
String fileName =
|
||||||
|
jnConfig.getUploadPath() + sysFileService.get(id).getUrl().replace(Constant.UPLOAD_FILES_PREFIX, "");
|
||||||
if (sysFileService.remove(id) > 0) {
|
if (sysFileService.remove(id) > 0) {
|
||||||
boolean b = FileUtil.deleteFile(fileName);
|
boolean b = FileUtil.deleteFile(fileName);
|
||||||
if (!b) {
|
if (!b) {
|
||||||
@ -148,22 +151,23 @@ public class FileController extends BaseController {
|
|||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
}
|
}
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
String year = DateUtils.format(date,DateUtils.YEAR_PATTERN);
|
String year = DateUtils.format(date, DateUtils.YEAR_PATTERN);
|
||||||
String month = DateUtils.format(date,DateUtils.MONTH_PATTERN);
|
String month = DateUtils.format(date, DateUtils.MONTH_PATTERN);
|
||||||
String day = DateUtils.format(date,DateUtils.DAY_PATTERN);
|
String day = DateUtils.format(date, DateUtils.DAY_PATTERN);
|
||||||
|
|
||||||
String fileName = file.getOriginalFilename();
|
String fileName = file.getOriginalFilename();
|
||||||
String fileDir = year+"/"+month+"/"+day + "/";
|
String fileDir = year + "/" + month + "/" + day + "/";
|
||||||
fileName = FileUtil.renameToUUID(fileName);
|
fileName = FileUtil.renameToUUID(fileName);
|
||||||
FileDO sysFile = new FileDO(FileType.fileType(fileName), "/files/" + fileDir + fileName, date);
|
FileDO sysFile = new FileDO(FileType.fileType(fileName), Constant.UPLOAD_FILES_PREFIX + fileDir + fileName,
|
||||||
|
date);
|
||||||
try {
|
try {
|
||||||
FileUtil.uploadFile(file.getBytes(), jnConfig.getUploadPath()+fileDir, fileName);
|
FileUtil.uploadFile(file.getBytes(), jnConfig.getUploadPath() + fileDir, fileName);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return R.error();
|
return R.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sysFileService.save(sysFile) > 0) {
|
if (sysFileService.save(sysFile) > 0) {
|
||||||
return R.ok().put("fileName",sysFile.getUrl());
|
return R.ok().put("fileName", sysFile.getUrl());
|
||||||
}
|
}
|
||||||
return R.error();
|
return R.error();
|
||||||
}
|
}
|
||||||
@ -172,7 +176,7 @@ public class FileController extends BaseController {
|
|||||||
* 文件下载
|
* 文件下载
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/download")
|
@RequestMapping(value = "/download")
|
||||||
public void fileDownload(String filePath,String fileName, HttpServletResponse resp) throws Exception {
|
public void fileDownload(String filePath, String fileName, HttpServletResponse resp) throws Exception {
|
||||||
String realFilePath = jnConfig.getUploadPath() + filePath;
|
String realFilePath = jnConfig.getUploadPath() + filePath;
|
||||||
InputStream in = new FileInputStream(realFilePath);
|
InputStream in = new FileInputStream(realFilePath);
|
||||||
//设置响应头,对文件进行url编码
|
//设置响应头,对文件进行url编码
|
||||||
|
@ -1,28 +1,33 @@
|
|||||||
package com.java2nb.common.dao;
|
package com.java2nb.common.dao;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface GeneratorMapper {
|
public interface GeneratorMapper {
|
||||||
@Select("select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables"
|
|
||||||
+ " where table_schema = (select database()) and table_name like concat('%',#{tableName},'%')")
|
@Select(
|
||||||
|
"select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables"
|
||||||
|
+ " where table_schema = 'novel_plus' and table_name like concat('%',#{tableName},'%')")
|
||||||
List<Map<String, Object>> list(@Param("tableName") String tableName);
|
List<Map<String, Object>> list(@Param("tableName") String tableName);
|
||||||
|
|
||||||
@Select("select count(*) from information_schema.tables where table_schema = (select database())")
|
@Select("select count(*) from information_schema.tables where table_schema = 'novel_plus'")
|
||||||
int count(Map<String, Object> map);
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
@Select("select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables \r\n"
|
@Select(
|
||||||
+ " where table_schema = (select database()) and table_name = #{tableName}")
|
"select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables \r\n"
|
||||||
|
+ " where table_schema = 'novel_plus' and table_name = #{tableName}")
|
||||||
Map<String, String> get(String tableName);
|
Map<String, String> get(String tableName);
|
||||||
|
|
||||||
@Select("select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns\r\n"
|
@Select(
|
||||||
+ " where table_name = #{tableName} and table_schema = (select database()) order by ordinal_position")
|
"select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns\r\n"
|
||||||
|
+ " where table_name = #{tableName} and table_schema = 'novel_plus' order by ordinal_position")
|
||||||
List<Map<String, String>> listColumns(String tableName);
|
List<Map<String, String>> listColumns(String tableName);
|
||||||
|
|
||||||
@Select("select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns\r\n"
|
@Select(
|
||||||
+ " where table_name = #{tableName} and table_schema = (select database()) and column_key = 'PRI' limit 1")
|
"select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns\r\n"
|
||||||
|
+ " where table_name = #{tableName} and table_schema = 'novel_plus' and column_key = 'PRI' limit 1")
|
||||||
Map<String, String> getPriColumn(String tableName);
|
Map<String, String> getPriColumn(String tableName);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package com.java2nb.common.domain;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,6 +14,7 @@ import java.util.Date;
|
|||||||
* @date 2019-09-29 18:28:07
|
* @date 2019-09-29 18:28:07
|
||||||
*/
|
*/
|
||||||
public class DictDO implements Serializable {
|
public class DictDO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
//编号
|
//编号
|
||||||
@ -49,150 +50,175 @@ public class DictDO implements Serializable {
|
|||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:编号
|
* 获取:编号
|
||||||
*/
|
*/
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:标签名
|
* 设置:标签名
|
||||||
*/
|
*/
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:标签名
|
* 获取:标签名
|
||||||
*/
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:数据值
|
* 设置:数据值
|
||||||
*/
|
*/
|
||||||
public void setValue(String value) {
|
public void setValue(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:数据值
|
* 获取:数据值
|
||||||
*/
|
*/
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:类型
|
* 设置:类型
|
||||||
*/
|
*/
|
||||||
public void setType(String type) {
|
public void setType(String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:类型
|
* 获取:类型
|
||||||
*/
|
*/
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:描述
|
* 设置:描述
|
||||||
*/
|
*/
|
||||||
public void setDescription(String description) {
|
public void setDescription(String description) {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:描述
|
* 获取:描述
|
||||||
*/
|
*/
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:排序(升序)
|
* 设置:排序(升序)
|
||||||
*/
|
*/
|
||||||
public void setSort(BigDecimal sort) {
|
public void setSort(BigDecimal sort) {
|
||||||
this.sort = sort;
|
this.sort = sort;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:排序(升序)
|
* 获取:排序(升序)
|
||||||
*/
|
*/
|
||||||
public BigDecimal getSort() {
|
public BigDecimal getSort() {
|
||||||
return sort;
|
return sort;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:父级编号
|
* 设置:父级编号
|
||||||
*/
|
*/
|
||||||
public void setParentId(Long parentId) {
|
public void setParentId(Long parentId) {
|
||||||
this.parentId = parentId;
|
this.parentId = parentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:父级编号
|
* 获取:父级编号
|
||||||
*/
|
*/
|
||||||
public Long getParentId() {
|
public Long getParentId() {
|
||||||
return parentId;
|
return parentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:创建者
|
* 设置:创建者
|
||||||
*/
|
*/
|
||||||
public void setCreateBy(Integer createBy) {
|
public void setCreateBy(Integer createBy) {
|
||||||
this.createBy = createBy;
|
this.createBy = createBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:创建者
|
* 获取:创建者
|
||||||
*/
|
*/
|
||||||
public Integer getCreateBy() {
|
public Integer getCreateBy() {
|
||||||
return createBy;
|
return createBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:创建时间
|
* 设置:创建时间
|
||||||
*/
|
*/
|
||||||
public void setCreateDate(Date createDate) {
|
public void setCreateDate(Date createDate) {
|
||||||
this.createDate = createDate;
|
this.createDate = createDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:创建时间
|
* 获取:创建时间
|
||||||
*/
|
*/
|
||||||
public Date getCreateDate() {
|
public Date getCreateDate() {
|
||||||
return createDate;
|
return createDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:更新者
|
* 设置:更新者
|
||||||
*/
|
*/
|
||||||
public void setUpdateBy(Long updateBy) {
|
public void setUpdateBy(Long updateBy) {
|
||||||
this.updateBy = updateBy;
|
this.updateBy = updateBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:更新者
|
* 获取:更新者
|
||||||
*/
|
*/
|
||||||
public Long getUpdateBy() {
|
public Long getUpdateBy() {
|
||||||
return updateBy;
|
return updateBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:更新时间
|
* 设置:更新时间
|
||||||
*/
|
*/
|
||||||
public void setUpdateDate(Date updateDate) {
|
public void setUpdateDate(Date updateDate) {
|
||||||
this.updateDate = updateDate;
|
this.updateDate = updateDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:更新时间
|
* 获取:更新时间
|
||||||
*/
|
*/
|
||||||
public Date getUpdateDate() {
|
public Date getUpdateDate() {
|
||||||
return updateDate;
|
return updateDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:备注信息
|
* 设置:备注信息
|
||||||
*/
|
*/
|
||||||
public void setRemarks(String remarks) {
|
public void setRemarks(String remarks) {
|
||||||
this.remarks = remarks;
|
this.remarks = remarks;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:备注信息
|
* 获取:备注信息
|
||||||
*/
|
*/
|
||||||
public String getRemarks() {
|
public String getRemarks() {
|
||||||
return remarks;
|
return remarks;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:删除标记
|
* 设置:删除标记
|
||||||
*/
|
*/
|
||||||
public void setDelFlag(String delFlag) {
|
public void setDelFlag(String delFlag) {
|
||||||
this.delFlag = delFlag;
|
this.delFlag = delFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取:删除标记
|
* 获取:删除标记
|
||||||
*/
|
*/
|
||||||
@ -218,4 +244,29 @@ public class DictDO implements Serializable {
|
|||||||
", delFlag='" + delFlag + '\'' +
|
", delFlag='" + delFlag + '\'' +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
DictDO dictDO = (DictDO) o;
|
||||||
|
return Objects.equals(id, dictDO.id) && Objects.equals(name, dictDO.name)
|
||||||
|
&& Objects.equals(value, dictDO.value) && Objects.equals(type, dictDO.type)
|
||||||
|
&& Objects.equals(description, dictDO.description) && Objects.equals(sort, dictDO.sort)
|
||||||
|
&& Objects.equals(parentId, dictDO.parentId) && Objects.equals(createBy, dictDO.createBy)
|
||||||
|
&& Objects.equals(createDate, dictDO.createDate) && Objects.equals(updateBy,
|
||||||
|
dictDO.updateBy) && Objects.equals(updateDate, dictDO.updateDate) && Objects.equals(remarks,
|
||||||
|
dictDO.remarks) && Objects.equals(delFlag, dictDO.delFlag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id, name, value, type, description, sort, parentId, createBy, createDate, updateBy,
|
||||||
|
updateDate,
|
||||||
|
remarks, delFlag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package com.java2nb.common.service.impl;
|
package com.java2nb.common.service.impl;
|
||||||
|
|
||||||
|
import com.java2nb.common.dao.DictDao;
|
||||||
|
import com.java2nb.common.domain.DictDO;
|
||||||
|
import com.java2nb.common.service.DictService;
|
||||||
import com.java2nb.common.utils.StringUtils;
|
import com.java2nb.common.utils.StringUtils;
|
||||||
import com.java2nb.system.domain.UserDO;
|
import com.java2nb.system.domain.UserDO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -9,14 +12,12 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import com.java2nb.common.dao.DictDao;
|
|
||||||
import com.java2nb.common.domain.DictDO;
|
|
||||||
import com.java2nb.common.service.DictService;
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class DictServiceImpl implements DictService {
|
public class DictServiceImpl implements DictService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DictDao dictDao;
|
private DictDao dictDao;
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ public class DictServiceImpl implements DictService {
|
|||||||
@Override
|
@Override
|
||||||
|
|
||||||
public List<DictDO> listType() {
|
public List<DictDO> listType() {
|
||||||
return dictDao.listType();
|
return dictDao.listType().stream().distinct().collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,58 +1,60 @@
|
|||||||
package com.java2nb.common.service.impl;
|
package com.java2nb.common.service.impl;
|
||||||
|
|
||||||
|
import com.java2nb.common.config.Constant;
|
||||||
import com.java2nb.common.config.JnConfig;
|
import com.java2nb.common.config.JnConfig;
|
||||||
|
import com.java2nb.common.dao.FileDao;
|
||||||
|
import com.java2nb.common.domain.FileDO;
|
||||||
|
import com.java2nb.common.service.FileService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.java2nb.common.dao.FileDao;
|
|
||||||
import com.java2nb.common.domain.FileDO;
|
|
||||||
import com.java2nb.common.service.FileService;
|
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class FileServiceImpl implements FileService {
|
public class FileServiceImpl implements FileService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileDao sysFileMapper;
|
private FileDao sysFileMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private JnConfig jnConfig;
|
private JnConfig jnConfig;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FileDO get(Long id){
|
public FileDO get(Long id) {
|
||||||
return sysFileMapper.get(id);
|
return sysFileMapper.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FileDO> list(Map<String, Object> map){
|
public List<FileDO> list(Map<String, Object> map) {
|
||||||
return sysFileMapper.list(map);
|
return sysFileMapper.list(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(Map<String, Object> map){
|
public int count(Map<String, Object> map) {
|
||||||
return sysFileMapper.count(map);
|
return sysFileMapper.count(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int save(FileDO sysFile){
|
public int save(FileDO sysFile) {
|
||||||
return sysFileMapper.save(sysFile);
|
return sysFileMapper.save(sysFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(FileDO sysFile){
|
public int update(FileDO sysFile) {
|
||||||
return sysFileMapper.update(sysFile);
|
return sysFileMapper.update(sysFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int remove(Long id){
|
public int remove(Long id) {
|
||||||
return sysFileMapper.remove(id);
|
return sysFileMapper.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchRemove(Long[] ids){
|
public int batchRemove(Long[] ids) {
|
||||||
return sysFileMapper.batchRemove(ids);
|
return sysFileMapper.batchRemove(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +62,7 @@ public class FileServiceImpl implements FileService {
|
|||||||
public Boolean isExist(String url) {
|
public Boolean isExist(String url) {
|
||||||
Boolean isExist = false;
|
Boolean isExist = false;
|
||||||
if (!StringUtils.isEmpty(url)) {
|
if (!StringUtils.isEmpty(url)) {
|
||||||
String filePath = url.replace("/files/", "");
|
String filePath = url.replace(Constant.UPLOAD_FILES_PREFIX, "");
|
||||||
filePath = jnConfig.getUploadPath() + filePath;
|
filePath = jnConfig.getUploadPath() + filePath;
|
||||||
File file = new File(filePath);
|
File file = new File(filePath);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
@ -69,4 +71,4 @@ public class FileServiceImpl implements FileService {
|
|||||||
}
|
}
|
||||||
return isExist;
|
return isExist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
package com.java2nb.common.utils;
|
package com.java2nb.common.utils;
|
||||||
|
|
||||||
|
import lombok.SneakyThrows;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期处理
|
* 日期处理
|
||||||
@ -91,4 +95,37 @@ public class DateUtils {
|
|||||||
r += "前";
|
r += "前";
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取过去第几天的日期
|
||||||
|
*
|
||||||
|
* @param past
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@SneakyThrows
|
||||||
|
public static String getPastDate(int past,Date date) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - past);
|
||||||
|
Date today = calendar.getTime();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
return sdf.format(today);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取过去几天的日期集合
|
||||||
|
*
|
||||||
|
* @param past
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<String> getDateList(int past,Date date) {
|
||||||
|
List<String> result = new ArrayList<>(past);
|
||||||
|
for(int i = past - 1 ; i > 0 ; i--){
|
||||||
|
result.add(getPastDate(i,date));
|
||||||
|
}
|
||||||
|
//今天的日期
|
||||||
|
result.add(new SimpleDateFormat("yyyy-MM-dd").format(date));
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,601 +0,0 @@
|
|||||||
package com.java2nb.common.utils;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@Slf4j
|
|
||||||
public final class RedisUtil {
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisTemplate<String, Object> redisTemplate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 指定缓存失效时间
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param time 时间(秒)
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
public boolean expire(String key, long time) {
|
|
||||||
try {
|
|
||||||
if (time > 0) {
|
|
||||||
redisTemplate.expire(key, time, TimeUnit.SECONDS);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据key 获取过期时间
|
|
||||||
*
|
|
||||||
* @param key 键 不能为null
|
|
||||||
* @return 时间(秒) 返回0代表为永久有效
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
public long getExpire(String key) {
|
|
||||||
return redisTemplate.getExpire(key, TimeUnit.SECONDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断key是否存在
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @return true 存在 false不存在
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
public boolean hasKey(String key) {
|
|
||||||
try {
|
|
||||||
return redisTemplate.hasKey(key);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除缓存
|
|
||||||
*
|
|
||||||
* @param key 可以传一个值 或多个
|
|
||||||
*/
|
|
||||||
public void del(String... key) {
|
|
||||||
if (key != null && key.length > 0) {
|
|
||||||
if (key.length == 1) {
|
|
||||||
redisTemplate.delete(key[0]);
|
|
||||||
} else {
|
|
||||||
redisTemplate.delete(CollectionUtils.arrayToList(key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 普通缓存获取
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @return 值
|
|
||||||
*/
|
|
||||||
public Object get(String key) {
|
|
||||||
return key == null ? null : redisTemplate.opsForValue().get(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 普通缓存放入
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @return true成功 false失败
|
|
||||||
*/
|
|
||||||
public boolean set(String key, Object value) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForValue().set(key, value);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 普通缓存放入并设置时间
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期
|
|
||||||
* @return true成功 false 失败
|
|
||||||
*/
|
|
||||||
public boolean set(String key, Object value, long time) {
|
|
||||||
try {
|
|
||||||
if (time > 0) {
|
|
||||||
redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
|
|
||||||
} else {
|
|
||||||
set(key, value);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 递增
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param delta 要增加几(大于0)
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public long incr(String key, long delta) {
|
|
||||||
if (delta < 0) {
|
|
||||||
throw new RuntimeException("递增因子必须大于0");
|
|
||||||
}
|
|
||||||
return redisTemplate.opsForValue().increment(key, delta);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 递减
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param delta 要减少几(小于0)
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public long decr(String key, long delta) {
|
|
||||||
if (delta < 0) {
|
|
||||||
throw new RuntimeException("递减因子必须大于0");
|
|
||||||
}
|
|
||||||
return redisTemplate.opsForValue().increment(key, -delta);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ================================Map=================================
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* HashGet
|
|
||||||
*
|
|
||||||
* @param key 键 不能为null
|
|
||||||
* @param item 项 不能为null
|
|
||||||
* @return 值
|
|
||||||
*/
|
|
||||||
public Object hget(String key, String item) {
|
|
||||||
return redisTemplate.opsForHash().get(key, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取hashKey对应的所有键值
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @return 对应的多个键值
|
|
||||||
*/
|
|
||||||
public Map<Object, Object> hmget(String key) {
|
|
||||||
return redisTemplate.opsForHash().entries(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* HashSet
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param map 对应多个键值
|
|
||||||
* @return true 成功 false 失败
|
|
||||||
*/
|
|
||||||
public boolean hmset(String key, Map<String, Object> map) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForHash().putAll(key, map);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* HashSet 并设置时间
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param map 对应多个键值
|
|
||||||
* @param time 时间(秒)
|
|
||||||
* @return true成功 false失败
|
|
||||||
*/
|
|
||||||
public boolean hmset(String key, Map<String, Object> map, long time) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForHash().putAll(key, map);
|
|
||||||
if (time > 0) {
|
|
||||||
expire(key, time);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 向一张hash表中放入数据,如果不存在将创建
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param item 项
|
|
||||||
* @param value 值
|
|
||||||
* @return true 成功 false失败
|
|
||||||
*/
|
|
||||||
public boolean hset(String key, String item, Object value) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForHash().put(key, item, value);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 向一张hash表中放入数据,如果不存在将创建
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param item 项
|
|
||||||
* @param value 值
|
|
||||||
* @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
|
|
||||||
* @return true 成功 false失败
|
|
||||||
*/
|
|
||||||
public boolean hset(String key, String item, Object value, long time) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForHash().put(key, item, value);
|
|
||||||
if (time > 0) {
|
|
||||||
expire(key, time);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除hash表中的值
|
|
||||||
*
|
|
||||||
* @param key 键 不能为null
|
|
||||||
* @param item 项 可以使多个 不能为null
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
public void hdel(String key, Object... item) {
|
|
||||||
redisTemplate.opsForHash().delete(key, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断hash表中是否有该项的值
|
|
||||||
*
|
|
||||||
* @param key 键 不能为null
|
|
||||||
* @param item 项 不能为null
|
|
||||||
* @return true 存在 false不存在
|
|
||||||
*/
|
|
||||||
public boolean hHasKey(String key, String item) {
|
|
||||||
return redisTemplate.opsForHash().hasKey(key, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hash递增 如果不存在,就会创建一个 并把新增后的值返回
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param item 项
|
|
||||||
* @param by 要增加几(大于0)
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public double hincr(String key, String item, double by) {
|
|
||||||
return redisTemplate.opsForHash().increment(key, item, by);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hash递减
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param item 项
|
|
||||||
* @param by 要减少记(小于0)
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public double hdecr(String key, String item, double by) {
|
|
||||||
return redisTemplate.opsForHash().increment(key, item, -by);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据key获取Set中的所有值
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Set<Object> sGet(String key) {
|
|
||||||
try {
|
|
||||||
return redisTemplate.opsForSet().members(key);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据value从一个set中查询,是否存在
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @return true 存在 false不存在
|
|
||||||
*/
|
|
||||||
public boolean sHasKey(String key, Object value) {
|
|
||||||
try {
|
|
||||||
return redisTemplate.opsForSet().isMember(key, value);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将数据放入set缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param values 值 可以是多个
|
|
||||||
* @return 成功个数
|
|
||||||
*/
|
|
||||||
public long sSet(String key, Object... values) {
|
|
||||||
try {
|
|
||||||
return redisTemplate.opsForSet().add(key, values);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将set数据放入缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param time 时间(秒)
|
|
||||||
* @param values 值 可以是多个
|
|
||||||
* @return 成功个数
|
|
||||||
*/
|
|
||||||
public long sSetAndTime(String key, long time, Object... values) {
|
|
||||||
try {
|
|
||||||
Long count = redisTemplate.opsForSet().add(key, values);
|
|
||||||
if (time > 0)
|
|
||||||
expire(key, time);
|
|
||||||
return count;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取set缓存的长度
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public long sGetSetSize(String key) {
|
|
||||||
try {
|
|
||||||
return redisTemplate.opsForSet().size(key);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 移除值为value的
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param values 值 可以是多个
|
|
||||||
* @return 移除的个数
|
|
||||||
*/
|
|
||||||
public long setRemove(String key, Object... values) {
|
|
||||||
try {
|
|
||||||
Long count = redisTemplate.opsForSet().remove(key, values);
|
|
||||||
return count;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取list缓存的内容
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param start 开始
|
|
||||||
* @param end 结束 0 到 -代表所有值
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public List<Object> lGet(String key, long start, long end) {
|
|
||||||
try {
|
|
||||||
return redisTemplate.opsForList().range(key, start, end);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取list缓存的长度
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public long lGetListSize(String key) {
|
|
||||||
try {
|
|
||||||
return redisTemplate.opsForList().size(key);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过索引 获取list中的值
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param index 索引 index>=0时, 0 表头, 第二个元素,依次类推;index<0时,-,表尾,-倒数第二个元素,依次类推
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Object lGetIndex(String key, long index) {
|
|
||||||
try {
|
|
||||||
return redisTemplate.opsForList().index(key, index);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将list放入缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public boolean lSet(String key, Object value) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForList().rightPush(key, value);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将list放入缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @param time 时间(秒)
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public boolean lSet(String key, Object value, long time) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForList().rightPush(key, value);
|
|
||||||
if (time > 0)
|
|
||||||
expire(key, time);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将list放入缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public boolean lSet(String key, List<Object> value) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForList().rightPushAll(key, value);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将list放入缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @param time 时间(秒)
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public boolean lSet(String key, List<Object> value, long time) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForList().rightPushAll(key, value);
|
|
||||||
if (time > 0)
|
|
||||||
expire(key, time);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据索引修改list中的某条数据
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param index 索引
|
|
||||||
* @param value 值
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public boolean lUpdateIndex(String key, long index, Object value) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForList().set(key, index, value);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 移除N个值为value
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param count 移除多少个
|
|
||||||
* @param value 值
|
|
||||||
* @return 移除的个数
|
|
||||||
*/
|
|
||||||
public long lRemove(String key, long count, Object value) {
|
|
||||||
try {
|
|
||||||
Long remove = redisTemplate.opsForList().remove(key, count, value);
|
|
||||||
return remove;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage(),e);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -14,7 +14,7 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe
|
|||||||
/**
|
/**
|
||||||
* 假如有有html 代码是自己传来的 需要设定对应的name 不过滤
|
* 假如有有html 代码是自己传来的 需要设定对应的name 不过滤
|
||||||
*/
|
*/
|
||||||
private static final List<String> noFilterNames = Arrays.asList("attach","push_ip");
|
private static final List<String> noFilterNames = Arrays.asList("attach","push_ip","content");
|
||||||
|
|
||||||
public XssAndSqlHttpServletRequestWrapper(HttpServletRequest request) {
|
public XssAndSqlHttpServletRequestWrapper(HttpServletRequest request) {
|
||||||
super(request);
|
super(request);
|
||||||
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookCommentDO;
|
||||||
|
import com.java2nb.novel.service.BookCommentService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说评论表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 21:59:28
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/bookComment")
|
||||||
|
public class BookCommentController {
|
||||||
|
@Autowired
|
||||||
|
private BookCommentService bookCommentService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:bookComment:bookComment")
|
||||||
|
String BookComment() {
|
||||||
|
return "novel/bookComment/bookComment";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取小说评论表列表", notes = "获取小说评论表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:bookComment:bookComment")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<BookCommentDO> bookCommentList = bookCommentService.list(query);
|
||||||
|
int total = bookCommentService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(bookCommentList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增小说评论表页面", notes = "新增小说评论表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:bookComment:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/bookComment/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改小说评论表页面", notes = "修改小说评论表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:bookComment:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookCommentDO bookComment = bookCommentService.get(id);
|
||||||
|
model.addAttribute("bookComment", bookComment);
|
||||||
|
return "novel/bookComment/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看小说评论表页面", notes = "查看小说评论表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:bookComment:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookCommentDO bookComment = bookCommentService.get(id);
|
||||||
|
model.addAttribute("bookComment", bookComment);
|
||||||
|
return "novel/bookComment/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增小说评论表", notes = "新增小说评论表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:bookComment:add")
|
||||||
|
public R save( BookCommentDO bookComment) {
|
||||||
|
if (bookCommentService.save(bookComment) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改小说评论表", notes = "修改小说评论表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:bookComment:edit")
|
||||||
|
public R update( BookCommentDO bookComment) {
|
||||||
|
bookCommentService.update(bookComment);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除小说评论表", notes = "删除小说评论表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:bookComment:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (bookCommentService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除小说评论表", notes = "批量删除小说评论表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:bookComment:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
bookCommentService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookContentDO;
|
||||||
|
import com.java2nb.novel.service.BookContentService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说内容表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 19:52:06
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/bookContent")
|
||||||
|
public class BookContentController {
|
||||||
|
@Autowired
|
||||||
|
private BookContentService bookContentService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:bookContent:bookContent")
|
||||||
|
String BookContent() {
|
||||||
|
return "novel/bookContent/bookContent";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取小说内容表列表", notes = "获取小说内容表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:bookContent:bookContent")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<BookContentDO> bookContentList = bookContentService.list(query);
|
||||||
|
int total = bookContentService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(bookContentList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增小说内容表页面", notes = "新增小说内容表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:bookContent:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/bookContent/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改小说内容表页面", notes = "修改小说内容表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:bookContent:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookContentDO bookContent = bookContentService.get(id);
|
||||||
|
model.addAttribute("bookContent", bookContent);
|
||||||
|
return "novel/bookContent/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看小说内容表页面", notes = "查看小说内容表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:bookContent:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookContentDO bookContent = bookContentService.get(id);
|
||||||
|
model.addAttribute("bookContent", bookContent);
|
||||||
|
return "novel/bookContent/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增小说内容表", notes = "新增小说内容表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:bookContent:add")
|
||||||
|
public R save( BookContentDO bookContent) {
|
||||||
|
if (bookContentService.save(bookContent) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改小说内容表", notes = "修改小说内容表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:bookContent:edit")
|
||||||
|
public R update( BookContentDO bookContent) {
|
||||||
|
bookContentService.update(bookContent);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除小说内容表", notes = "删除小说内容表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:bookContent:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (bookContentService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除小说内容表", notes = "批量删除小说内容表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:bookContent:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
bookContentService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
import com.java2nb.novel.service.BookService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:46
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/book")
|
||||||
|
public class BookController {
|
||||||
|
@Autowired
|
||||||
|
private BookService bookService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:book:book")
|
||||||
|
String Book() {
|
||||||
|
return "novel/book/book";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取小说表列表", notes = "获取小说表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:book:book")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<BookDO> bookList = bookService.list(query);
|
||||||
|
int total = bookService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(bookList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增小说表页面", notes = "新增小说表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:book:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/book/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改小说表页面", notes = "修改小说表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:book:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookDO book = bookService.get(id);
|
||||||
|
model.addAttribute("book", book);
|
||||||
|
return "novel/book/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看小说表页面", notes = "查看小说表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:book:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookDO book = bookService.get(id);
|
||||||
|
model.addAttribute("book", book);
|
||||||
|
return "novel/book/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增小说表", notes = "新增小说表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:book:add")
|
||||||
|
public R save( BookDO book) {
|
||||||
|
if (bookService.save(book) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改小说表", notes = "修改小说表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:book:edit")
|
||||||
|
public R update( BookDO book) {
|
||||||
|
bookService.update(book);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除小说表", notes = "删除小说表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:book:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (bookService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除小说表", notes = "批量删除小说表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:book:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
bookService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookIndexDO;
|
||||||
|
import com.java2nb.novel.service.BookIndexService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说目录表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 19:51:54
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/bookIndex")
|
||||||
|
public class BookIndexController {
|
||||||
|
@Autowired
|
||||||
|
private BookIndexService bookIndexService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:bookIndex:bookIndex")
|
||||||
|
String BookIndex() {
|
||||||
|
return "novel/bookIndex/bookIndex";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取小说目录表列表", notes = "获取小说目录表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:bookIndex:bookIndex")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<BookIndexDO> bookIndexList = bookIndexService.list(query);
|
||||||
|
int total = bookIndexService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(bookIndexList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增小说目录表页面", notes = "新增小说目录表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:bookIndex:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/bookIndex/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改小说目录表页面", notes = "修改小说目录表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:bookIndex:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookIndexDO bookIndex = bookIndexService.get(id);
|
||||||
|
model.addAttribute("bookIndex", bookIndex);
|
||||||
|
return "novel/bookIndex/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看小说目录表页面", notes = "查看小说目录表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:bookIndex:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookIndexDO bookIndex = bookIndexService.get(id);
|
||||||
|
model.addAttribute("bookIndex", bookIndex);
|
||||||
|
return "novel/bookIndex/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增小说目录表", notes = "新增小说目录表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:bookIndex:add")
|
||||||
|
public R save( BookIndexDO bookIndex) {
|
||||||
|
if (bookIndexService.save(bookIndex) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改小说目录表", notes = "修改小说目录表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:bookIndex:edit")
|
||||||
|
public R update( BookIndexDO bookIndex) {
|
||||||
|
bookIndexService.update(bookIndex);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除小说目录表", notes = "删除小说目录表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:bookIndex:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (bookIndexService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除小说目录表", notes = "批量删除小说目录表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:bookIndex:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
bookIndexService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,134 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import com.java2nb.common.config.CacheKey;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
import com.java2nb.novel.domain.BookSettingDO;
|
||||||
|
import com.java2nb.novel.service.BookSettingService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页小说推荐
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 10:01:13
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/bookSetting")
|
||||||
|
public class BookSettingController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BookSettingService bookSettingService;
|
||||||
|
@Autowired
|
||||||
|
private StringRedisTemplate redisTemplate;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:bookSetting:bookSetting")
|
||||||
|
String BookSetting() {
|
||||||
|
return "novel/bookSetting/bookSetting";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取首页小说设置表列表", notes = "获取首页小说设置表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:bookSetting:bookSetting")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<BookSettingDO> bookSettingList = bookSettingService.list(query);
|
||||||
|
int total = bookSettingService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(bookSettingList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增首页小说设置表页面", notes = "新增首页小说设置表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:bookSetting:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/bookSetting/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改首页小说设置表页面", notes = "修改首页小说设置表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:bookSetting:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookSettingDO bookSetting = bookSettingService.get(id);
|
||||||
|
model.addAttribute("bookSetting", bookSetting);
|
||||||
|
return "novel/bookSetting/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看首页小说设置表页面", notes = "查看首页小说设置表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:bookSetting:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookSettingDO bookSetting = bookSettingService.get(id);
|
||||||
|
model.addAttribute("bookSetting", bookSetting);
|
||||||
|
return "novel/bookSetting/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增首页小说设置表", notes = "新增首页小说设置表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:bookSetting:add")
|
||||||
|
public R save(BookSettingDO bookSetting) {
|
||||||
|
if (bookSettingService.save(bookSetting) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改首页小说设置表", notes = "修改首页小说设置表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:bookSetting:edit")
|
||||||
|
public R update(BookSettingDO bookSetting) {
|
||||||
|
bookSettingService.update(bookSetting);
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_BOOK_SETTINGS_KEY);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除首页小说设置表", notes = "删除首页小说设置表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:bookSetting:remove")
|
||||||
|
public R remove(Long id) {
|
||||||
|
if (bookSettingService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除首页小说设置表", notes = "批量删除首页小说设置表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:bookSetting:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
bookSettingService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
import com.java2nb.novel.service.CategoryService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/category")
|
||||||
|
public class CategoryController {
|
||||||
|
@Autowired
|
||||||
|
private CategoryService categoryService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:category:category")
|
||||||
|
String Category() {
|
||||||
|
return "novel/category/category";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取新闻类别表列表", notes = "获取新闻类别表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:category:category")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<CategoryDO> categoryList = categoryService.list(query);
|
||||||
|
int total = categoryService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(categoryList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增新闻类别表页面", notes = "新增新闻类别表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:category:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/category/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改新闻类别表页面", notes = "修改新闻类别表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:category:edit")
|
||||||
|
String edit(@PathVariable("id") Integer id, Model model) {
|
||||||
|
CategoryDO category = categoryService.get(id);
|
||||||
|
model.addAttribute("category", category);
|
||||||
|
return "novel/category/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看新闻类别表页面", notes = "查看新闻类别表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:category:detail")
|
||||||
|
String detail(@PathVariable("id") Integer id, Model model) {
|
||||||
|
CategoryDO category = categoryService.get(id);
|
||||||
|
model.addAttribute("category", category);
|
||||||
|
return "novel/category/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增新闻类别表", notes = "新增新闻类别表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:category:add")
|
||||||
|
public R save( CategoryDO category) {
|
||||||
|
if (categoryService.save(category) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改新闻类别表", notes = "修改新闻类别表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:category:edit")
|
||||||
|
public R update( CategoryDO category) {
|
||||||
|
categoryService.update(category);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除新闻类别表", notes = "删除新闻类别表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:category:remove")
|
||||||
|
public R remove( Integer id) {
|
||||||
|
if (categoryService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除新闻类别表", notes = "批量删除新闻类别表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:category:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Integer[] ids) {
|
||||||
|
categoryService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import com.java2nb.common.config.CacheKey;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
import com.java2nb.novel.domain.FriendLinkDO;
|
||||||
|
import com.java2nb.novel.service.FriendLinkService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 15:12:25
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/friendLink")
|
||||||
|
public class FriendLinkController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FriendLinkService friendLinkService;
|
||||||
|
@Autowired
|
||||||
|
private RedisTemplate<Object, Object> redisTemplate;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:friendLink:friendLink")
|
||||||
|
String FriendLink() {
|
||||||
|
return "novel/friendLink/friendLink";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取列表", notes = "获取列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:friendLink:friendLink")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<FriendLinkDO> friendLinkList = friendLinkService.list(query);
|
||||||
|
int total = friendLinkService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(friendLinkList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增页面", notes = "新增页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:friendLink:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/friendLink/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改页面", notes = "修改页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:friendLink:edit")
|
||||||
|
String edit(@PathVariable("id") Integer id, Model model) {
|
||||||
|
FriendLinkDO friendLink = friendLinkService.get(id);
|
||||||
|
model.addAttribute("friendLink", friendLink);
|
||||||
|
return "novel/friendLink/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看页面", notes = "查看页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:friendLink:detail")
|
||||||
|
String detail(@PathVariable("id") Integer id, Model model) {
|
||||||
|
FriendLinkDO friendLink = friendLinkService.get(id);
|
||||||
|
model.addAttribute("friendLink", friendLink);
|
||||||
|
return "novel/friendLink/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增", notes = "新增")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:friendLink:add")
|
||||||
|
public R save(FriendLinkDO friendLink) {
|
||||||
|
if (friendLinkService.save(friendLink) > 0) {
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_LINK_KEY);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改", notes = "修改")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:friendLink:edit")
|
||||||
|
public R update(FriendLinkDO friendLink) {
|
||||||
|
friendLinkService.update(friendLink);
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_LINK_KEY);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除", notes = "删除")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:friendLink:remove")
|
||||||
|
public R remove(Integer id) {
|
||||||
|
if (friendLinkService.remove(id) > 0) {
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_LINK_KEY);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除", notes = "批量删除")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:friendLink:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Integer[] ids) {
|
||||||
|
friendLinkService.batchRemove(ids);
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_LINK_KEY);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,137 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import com.java2nb.common.config.CacheKey;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
import com.java2nb.novel.service.NewsService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/news")
|
||||||
|
public class NewsController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private NewsService newsService;
|
||||||
|
@Autowired
|
||||||
|
private RedisTemplate<Object, Object> redisTemplate;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:news:news")
|
||||||
|
String News() {
|
||||||
|
return "novel/news/news";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取新闻表列表", notes = "获取新闻表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:news:news")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<NewsDO> newsList = newsService.list(query);
|
||||||
|
int total = newsService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(newsList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增新闻表页面", notes = "新增新闻表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:news:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/news/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改新闻表页面", notes = "修改新闻表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:news:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
NewsDO news = newsService.get(id);
|
||||||
|
model.addAttribute("news", news);
|
||||||
|
return "novel/news/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看新闻表页面", notes = "查看新闻表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:news:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
NewsDO news = newsService.get(id);
|
||||||
|
model.addAttribute("news", news);
|
||||||
|
return "novel/news/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增新闻表", notes = "新增新闻表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:news:add")
|
||||||
|
public R save(NewsDO news) {
|
||||||
|
if (newsService.save(news) > 0) {
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_NEWS_KEY);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改新闻表", notes = "修改新闻表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:news:edit")
|
||||||
|
public R update(NewsDO news) {
|
||||||
|
newsService.update(news);
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_NEWS_KEY);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除新闻表", notes = "删除新闻表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:news:remove")
|
||||||
|
public R remove(Long id) {
|
||||||
|
if (newsService.remove(id) > 0) {
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_NEWS_KEY);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除新闻表", notes = "批量删除新闻表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:news:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
newsService.batchRemove(ids);
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_NEWS_KEY);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.PayDO;
|
||||||
|
import com.java2nb.novel.service.PayService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:57
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/pay")
|
||||||
|
public class PayController {
|
||||||
|
@Autowired
|
||||||
|
private PayService payService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:pay:pay")
|
||||||
|
String Pay() {
|
||||||
|
return "novel/pay/pay";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取充值订单列表", notes = "获取充值订单列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:pay:pay")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<PayDO> payList = payService.list(query);
|
||||||
|
int total = payService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(payList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增充值订单页面", notes = "新增充值订单页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:pay:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/pay/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改充值订单页面", notes = "修改充值订单页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:pay:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
PayDO pay = payService.get(id);
|
||||||
|
model.addAttribute("pay", pay);
|
||||||
|
return "novel/pay/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看充值订单页面", notes = "查看充值订单页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:pay:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
PayDO pay = payService.get(id);
|
||||||
|
model.addAttribute("pay", pay);
|
||||||
|
return "novel/pay/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增充值订单", notes = "新增充值订单")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:pay:add")
|
||||||
|
public R save( PayDO pay) {
|
||||||
|
if (payService.save(pay) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改充值订单", notes = "修改充值订单")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:pay:edit")
|
||||||
|
public R update( PayDO pay) {
|
||||||
|
payService.update(pay);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除充值订单", notes = "删除充值订单")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:pay:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (payService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除充值订单", notes = "批量删除充值订单")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:pay:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
payService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import com.java2nb.common.utils.DateUtils;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
import com.java2nb.novel.service.AuthorService;
|
||||||
|
import com.java2nb.novel.service.BookService;
|
||||||
|
import com.java2nb.novel.service.PayService;
|
||||||
|
import com.java2nb.novel.service.UserService;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:40:12
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/stat")
|
||||||
|
public class StatController {
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AuthorService authorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BookService bookService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PayService orderPayService;
|
||||||
|
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/countSta")
|
||||||
|
public R countUser() {
|
||||||
|
Map map = new HashMap<>(0);
|
||||||
|
int userCount = userService.count(map);
|
||||||
|
int authorCount = authorService.count(map);
|
||||||
|
int bookCount = bookService.count(map);
|
||||||
|
int orderCount = orderPayService.count(map);
|
||||||
|
return R.ok().put("userCount",userCount)
|
||||||
|
.put("authorCount",authorCount)
|
||||||
|
.put("bookCount",bookCount)
|
||||||
|
.put("orderCount",orderCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/tableSta")
|
||||||
|
@SneakyThrows
|
||||||
|
public R tableSta() {
|
||||||
|
Date currentDate = new Date();
|
||||||
|
List<String> dateList = DateUtils.getDateList(7,currentDate);
|
||||||
|
Date minDate = new SimpleDateFormat("yyyy-MM-dd").parse(dateList.get(0));
|
||||||
|
Map<Object,Object> userTableSta = userService.tableSta(minDate);
|
||||||
|
Map<Object,Object> bookTableSta = bookService.tableSta(minDate);
|
||||||
|
Map<Object,Object> authorTableSta = authorService.tableSta(minDate);
|
||||||
|
Map<Object,Object> orderTableSta = orderPayService.tableSta(minDate);
|
||||||
|
return R.ok().put("dateList",dateList)
|
||||||
|
.put("userTableSta",userTableSta)
|
||||||
|
.put("bookTableSta",bookTableSta)
|
||||||
|
.put("authorTableSta",authorTableSta)
|
||||||
|
.put("orderTableSta",orderTableSta)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserDO;
|
||||||
|
import com.java2nb.novel.service.UserService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:08
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/user")
|
||||||
|
public class UserController {
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:user:user")
|
||||||
|
String User() {
|
||||||
|
return "novel/user/user";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取列表", notes = "获取列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:user:user")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<UserDO> userList = userService.list(query);
|
||||||
|
int total = userService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(userList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增页面", notes = "新增页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:user:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/user/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改页面", notes = "修改页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:user:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
UserDO user = userService.get(id);
|
||||||
|
model.addAttribute("user", user);
|
||||||
|
return "novel/user/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看页面", notes = "查看页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:user:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
UserDO user = userService.get(id);
|
||||||
|
model.addAttribute("user", user);
|
||||||
|
return "novel/user/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增", notes = "新增")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:user:add")
|
||||||
|
public R save( UserDO user) {
|
||||||
|
if (userService.save(user) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改", notes = "修改")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:user:edit")
|
||||||
|
public R update( UserDO user) {
|
||||||
|
userService.update(user);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除", notes = "删除")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:user:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (userService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除", notes = "批量删除")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:user:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
userService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserFeedbackDO;
|
||||||
|
import com.java2nb.novel.service.UserFeedbackService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 11:08:54
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/userFeedback")
|
||||||
|
public class UserFeedbackController {
|
||||||
|
@Autowired
|
||||||
|
private UserFeedbackService userFeedbackService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:userFeedback:userFeedback")
|
||||||
|
String UserFeedback() {
|
||||||
|
return "novel/userFeedback/userFeedback";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取列表", notes = "获取列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:userFeedback:userFeedback")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<UserFeedbackDO> userFeedbackList = userFeedbackService.list(query);
|
||||||
|
int total = userFeedbackService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(userFeedbackList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增页面", notes = "新增页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:userFeedback:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/userFeedback/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改页面", notes = "修改页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:userFeedback:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
UserFeedbackDO userFeedback = userFeedbackService.get(id);
|
||||||
|
model.addAttribute("userFeedback", userFeedback);
|
||||||
|
return "novel/userFeedback/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看页面", notes = "查看页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:userFeedback:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
UserFeedbackDO userFeedback = userFeedbackService.get(id);
|
||||||
|
model.addAttribute("userFeedback", userFeedback);
|
||||||
|
return "novel/userFeedback/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增", notes = "新增")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:userFeedback:add")
|
||||||
|
public R save( UserFeedbackDO userFeedback) {
|
||||||
|
if (userFeedbackService.save(userFeedback) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改", notes = "修改")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:userFeedback:edit")
|
||||||
|
public R update( UserFeedbackDO userFeedback) {
|
||||||
|
userFeedbackService.update(userFeedback);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除", notes = "删除")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:userFeedback:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (userFeedbackService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除", notes = "批量删除")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:userFeedback:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
userFeedbackService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
import com.java2nb.novel.domain.WebsiteInfoDO;
|
||||||
|
import com.java2nb.novel.service.WebsiteInfoService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 11:05:43
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/websiteInfo")
|
||||||
|
public class WebsiteInfoController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WebsiteInfoService websiteInfoService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:websiteInfo:websiteInfo")
|
||||||
|
String detail(Model model) {
|
||||||
|
WebsiteInfoDO websiteInfo = websiteInfoService.get(1L);
|
||||||
|
model.addAttribute("websiteInfo", websiteInfo);
|
||||||
|
return "novel/websiteInfo/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改网站信息表", notes = "修改网站信息表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:websiteInfo:edit")
|
||||||
|
public R update(WebsiteInfoDO websiteInfo) {
|
||||||
|
websiteInfoService.update(websiteInfo);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -2,6 +2,7 @@ package com.java2nb.novel.dao;
|
|||||||
|
|
||||||
import com.java2nb.novel.domain.AuthorDO;
|
import com.java2nb.novel.domain.AuthorDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -29,4 +30,6 @@ public interface AuthorDao {
|
|||||||
int remove(Long id);
|
int remove(Long id);
|
||||||
|
|
||||||
int batchRemove(Long[] ids);
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
List<Map<Object, Object>> tableSta(Date minDate);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookCommentDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说评论表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 21:59:28
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BookCommentDao {
|
||||||
|
|
||||||
|
BookCommentDO get(Long id);
|
||||||
|
|
||||||
|
List<BookCommentDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(BookCommentDO bookComment);
|
||||||
|
|
||||||
|
int update(BookCommentDO bookComment);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookContentDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说内容表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 19:52:06
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BookContentDao {
|
||||||
|
|
||||||
|
BookContentDO get(Long id);
|
||||||
|
|
||||||
|
List<BookContentDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(BookContentDO bookContent);
|
||||||
|
|
||||||
|
int update(BookContentDO bookContent);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
int removeByIndexIds(Long[] indexIds);
|
||||||
|
}
|
38
novel-admin/src/main/java/com/java2nb/novel/dao/BookDao.java
Normal file
38
novel-admin/src/main/java/com/java2nb/novel/dao/BookDao.java
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:46
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BookDao {
|
||||||
|
|
||||||
|
BookDO get(Long id);
|
||||||
|
|
||||||
|
List<BookDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(BookDO book);
|
||||||
|
|
||||||
|
int update(BookDO book);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
List<Map<Object, Object>> tableSta(Date minDate);
|
||||||
|
|
||||||
|
List<BookDO> batchGet(List<Long> ids);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookIndexDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说目录表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 19:51:54
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BookIndexDao {
|
||||||
|
|
||||||
|
BookIndexDO get(Long id);
|
||||||
|
|
||||||
|
List<BookIndexDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(BookIndexDO bookIndex);
|
||||||
|
|
||||||
|
int update(BookIndexDO bookIndex);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
List<Long> getIdsByBookId(Long bookId);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookSettingDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页小说设置表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 10:01:13
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BookSettingDao {
|
||||||
|
|
||||||
|
BookSettingDO get(Long id);
|
||||||
|
|
||||||
|
List<BookSettingDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(BookSettingDO bookSetting);
|
||||||
|
|
||||||
|
int update(BookSettingDO bookSetting);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CategoryDao {
|
||||||
|
|
||||||
|
CategoryDO get(Integer id);
|
||||||
|
|
||||||
|
List<CategoryDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(CategoryDO category);
|
||||||
|
|
||||||
|
int update(CategoryDO category);
|
||||||
|
|
||||||
|
int remove(Integer id);
|
||||||
|
|
||||||
|
int batchRemove(Integer[] ids);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.FriendLinkDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 15:12:25
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface FriendLinkDao {
|
||||||
|
|
||||||
|
FriendLinkDO get(Integer id);
|
||||||
|
|
||||||
|
List<FriendLinkDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(FriendLinkDO friendLink);
|
||||||
|
|
||||||
|
int update(FriendLinkDO friendLink);
|
||||||
|
|
||||||
|
int remove(Integer id);
|
||||||
|
|
||||||
|
int batchRemove(Integer[] ids);
|
||||||
|
}
|
32
novel-admin/src/main/java/com/java2nb/novel/dao/NewsDao.java
Normal file
32
novel-admin/src/main/java/com/java2nb/novel/dao/NewsDao.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface NewsDao {
|
||||||
|
|
||||||
|
NewsDO get(Long id);
|
||||||
|
|
||||||
|
List<NewsDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(NewsDO news);
|
||||||
|
|
||||||
|
int update(NewsDO news);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
35
novel-admin/src/main/java/com/java2nb/novel/dao/PayDao.java
Normal file
35
novel-admin/src/main/java/com/java2nb/novel/dao/PayDao.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.PayDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:57
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface PayDao {
|
||||||
|
|
||||||
|
PayDO get(Long id);
|
||||||
|
|
||||||
|
List<PayDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(PayDO pay);
|
||||||
|
|
||||||
|
int update(PayDO pay);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
List<Map<Object, Object>> tableSta(Date minDate);
|
||||||
|
}
|
35
novel-admin/src/main/java/com/java2nb/novel/dao/UserDao.java
Normal file
35
novel-admin/src/main/java/com/java2nb/novel/dao/UserDao.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:08
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserDao {
|
||||||
|
|
||||||
|
UserDO get(Long id);
|
||||||
|
|
||||||
|
List<UserDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(UserDO user);
|
||||||
|
|
||||||
|
int update(UserDO user);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
List<Map<Object, Object>> tableSta(Date minDate);
|
||||||
|
|
||||||
|
List<UserDO> batchGet(List<Long> userIds);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserFeedbackDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 11:08:54
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserFeedbackDao {
|
||||||
|
|
||||||
|
UserFeedbackDO get(Long id);
|
||||||
|
|
||||||
|
List<UserFeedbackDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(UserFeedbackDO userFeedback);
|
||||||
|
|
||||||
|
int update(UserFeedbackDO userFeedback);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.WebsiteInfoDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 11:05:43
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface WebsiteInfoDao {
|
||||||
|
|
||||||
|
WebsiteInfoDO get(Long id);
|
||||||
|
|
||||||
|
List<WebsiteInfoDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(WebsiteInfoDO websiteInfo);
|
||||||
|
|
||||||
|
int update(WebsiteInfoDO websiteInfo);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,165 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说评论表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 21:59:28
|
||||||
|
*/
|
||||||
|
public class BookCommentDO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//小说ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long bookId;
|
||||||
|
//评价内容
|
||||||
|
private String commentContent;
|
||||||
|
//回复数量
|
||||||
|
private Integer replyCount;
|
||||||
|
//审核状态,0:待审核,1:审核通过,2:审核不通过
|
||||||
|
private Integer auditStatus;
|
||||||
|
//评价时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//评价人
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
|
||||||
|
private String bookName;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
public String getBookName() {
|
||||||
|
return bookName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBookName(String bookName) {
|
||||||
|
this.bookName = bookName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:小说ID
|
||||||
|
*/
|
||||||
|
public void setBookId(Long bookId) {
|
||||||
|
this.bookId = bookId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:小说ID
|
||||||
|
*/
|
||||||
|
public Long getBookId() {
|
||||||
|
return bookId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:评价内容
|
||||||
|
*/
|
||||||
|
public void setCommentContent(String commentContent) {
|
||||||
|
this.commentContent = commentContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:评价内容
|
||||||
|
*/
|
||||||
|
public String getCommentContent() {
|
||||||
|
return commentContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:回复数量
|
||||||
|
*/
|
||||||
|
public void setReplyCount(Integer replyCount) {
|
||||||
|
this.replyCount = replyCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:回复数量
|
||||||
|
*/
|
||||||
|
public Integer getReplyCount() {
|
||||||
|
return replyCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:审核状态,0:待审核,1:审核通过,2:审核不通过
|
||||||
|
*/
|
||||||
|
public void setAuditStatus(Integer auditStatus) {
|
||||||
|
this.auditStatus = auditStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:审核状态,0:待审核,1:审核通过,2:审核不通过
|
||||||
|
*/
|
||||||
|
public Integer getAuditStatus() {
|
||||||
|
return auditStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:评价时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:评价时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:评价人
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:评价人
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说内容表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 19:52:06
|
||||||
|
*/
|
||||||
|
public class BookContentDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//目录ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long indexId;
|
||||||
|
//小说章节内容
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:目录ID
|
||||||
|
*/
|
||||||
|
public void setIndexId(Long indexId) {
|
||||||
|
this.indexId = indexId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:目录ID
|
||||||
|
*/
|
||||||
|
public Long getIndexId() {
|
||||||
|
return indexId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:小说章节内容
|
||||||
|
*/
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:小说章节内容
|
||||||
|
*/
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
}
|
455
novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java
Normal file
455
novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java
Normal file
@ -0,0 +1,455 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 17:42:55
|
||||||
|
*/
|
||||||
|
public class BookDO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//作品方向,0:男频,1:女频'
|
||||||
|
private Integer workDirection;
|
||||||
|
//分类ID
|
||||||
|
private Integer catId;
|
||||||
|
//分类名
|
||||||
|
private String catName;
|
||||||
|
//小说封面
|
||||||
|
private String picUrl;
|
||||||
|
//小说名
|
||||||
|
private String bookName;
|
||||||
|
//作者id
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long authorId;
|
||||||
|
//作者名
|
||||||
|
private String authorName;
|
||||||
|
//书籍描述
|
||||||
|
private String bookDesc;
|
||||||
|
//评分,预留字段
|
||||||
|
private Float score;
|
||||||
|
//书籍状态,0:连载中,1:已完结
|
||||||
|
private Integer bookStatus;
|
||||||
|
//点击量
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long visitCount;
|
||||||
|
//总字数
|
||||||
|
private Integer wordCount;
|
||||||
|
//评论数
|
||||||
|
private Integer commentCount;
|
||||||
|
//昨日订阅数
|
||||||
|
private Integer yesterdayBuy;
|
||||||
|
//最新目录ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long lastIndexId;
|
||||||
|
//最新目录名
|
||||||
|
private String lastIndexName;
|
||||||
|
//最新目录更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date lastIndexUpdateTime;
|
||||||
|
//是否收费,1:收费,0:免费
|
||||||
|
private Integer isVip;
|
||||||
|
//状态,0:入库,1:上架
|
||||||
|
private Integer status;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//爬虫源站ID
|
||||||
|
private Integer crawlSourceId;
|
||||||
|
//抓取的源站小说ID
|
||||||
|
private String crawlBookId;
|
||||||
|
//最后一次的抓取时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date crawlLastTime;
|
||||||
|
//是否已停止更新,0:未停止,1:已停止
|
||||||
|
private Integer crawlIsStop;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:作品方向,0:男频,1:女频'
|
||||||
|
*/
|
||||||
|
public void setWorkDirection(Integer workDirection) {
|
||||||
|
this.workDirection = workDirection;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:作品方向,0:男频,1:女频'
|
||||||
|
*/
|
||||||
|
public Integer getWorkDirection() {
|
||||||
|
return workDirection;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:分类ID
|
||||||
|
*/
|
||||||
|
public void setCatId(Integer catId) {
|
||||||
|
this.catId = catId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:分类ID
|
||||||
|
*/
|
||||||
|
public Integer getCatId() {
|
||||||
|
return catId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:分类名
|
||||||
|
*/
|
||||||
|
public void setCatName(String catName) {
|
||||||
|
this.catName = catName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:分类名
|
||||||
|
*/
|
||||||
|
public String getCatName() {
|
||||||
|
return catName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:小说封面
|
||||||
|
*/
|
||||||
|
public void setPicUrl(String picUrl) {
|
||||||
|
this.picUrl = picUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:小说封面
|
||||||
|
*/
|
||||||
|
public String getPicUrl() {
|
||||||
|
return picUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:小说名
|
||||||
|
*/
|
||||||
|
public void setBookName(String bookName) {
|
||||||
|
this.bookName = bookName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:小说名
|
||||||
|
*/
|
||||||
|
public String getBookName() {
|
||||||
|
return bookName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:作者id
|
||||||
|
*/
|
||||||
|
public void setAuthorId(Long authorId) {
|
||||||
|
this.authorId = authorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:作者id
|
||||||
|
*/
|
||||||
|
public Long getAuthorId() {
|
||||||
|
return authorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:作者名
|
||||||
|
*/
|
||||||
|
public void setAuthorName(String authorName) {
|
||||||
|
this.authorName = authorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:作者名
|
||||||
|
*/
|
||||||
|
public String getAuthorName() {
|
||||||
|
return authorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:书籍描述
|
||||||
|
*/
|
||||||
|
public void setBookDesc(String bookDesc) {
|
||||||
|
this.bookDesc = bookDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:书籍描述
|
||||||
|
*/
|
||||||
|
public String getBookDesc() {
|
||||||
|
return bookDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:评分,预留字段
|
||||||
|
*/
|
||||||
|
public void setScore(Float score) {
|
||||||
|
this.score = score;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:评分,预留字段
|
||||||
|
*/
|
||||||
|
public Float getScore() {
|
||||||
|
return score;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:书籍状态,0:连载中,1:已完结
|
||||||
|
*/
|
||||||
|
public void setBookStatus(Integer bookStatus) {
|
||||||
|
this.bookStatus = bookStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:书籍状态,0:连载中,1:已完结
|
||||||
|
*/
|
||||||
|
public Integer getBookStatus() {
|
||||||
|
return bookStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:点击量
|
||||||
|
*/
|
||||||
|
public void setVisitCount(Long visitCount) {
|
||||||
|
this.visitCount = visitCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:点击量
|
||||||
|
*/
|
||||||
|
public Long getVisitCount() {
|
||||||
|
return visitCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:总字数
|
||||||
|
*/
|
||||||
|
public void setWordCount(Integer wordCount) {
|
||||||
|
this.wordCount = wordCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:总字数
|
||||||
|
*/
|
||||||
|
public Integer getWordCount() {
|
||||||
|
return wordCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:评论数
|
||||||
|
*/
|
||||||
|
public void setCommentCount(Integer commentCount) {
|
||||||
|
this.commentCount = commentCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:评论数
|
||||||
|
*/
|
||||||
|
public Integer getCommentCount() {
|
||||||
|
return commentCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:昨日订阅数
|
||||||
|
*/
|
||||||
|
public void setYesterdayBuy(Integer yesterdayBuy) {
|
||||||
|
this.yesterdayBuy = yesterdayBuy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:昨日订阅数
|
||||||
|
*/
|
||||||
|
public Integer getYesterdayBuy() {
|
||||||
|
return yesterdayBuy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:最新目录ID
|
||||||
|
*/
|
||||||
|
public void setLastIndexId(Long lastIndexId) {
|
||||||
|
this.lastIndexId = lastIndexId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:最新目录ID
|
||||||
|
*/
|
||||||
|
public Long getLastIndexId() {
|
||||||
|
return lastIndexId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:最新目录名
|
||||||
|
*/
|
||||||
|
public void setLastIndexName(String lastIndexName) {
|
||||||
|
this.lastIndexName = lastIndexName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:最新目录名
|
||||||
|
*/
|
||||||
|
public String getLastIndexName() {
|
||||||
|
return lastIndexName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:最新目录更新时间
|
||||||
|
*/
|
||||||
|
public void setLastIndexUpdateTime(Date lastIndexUpdateTime) {
|
||||||
|
this.lastIndexUpdateTime = lastIndexUpdateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:最新目录更新时间
|
||||||
|
*/
|
||||||
|
public Date getLastIndexUpdateTime() {
|
||||||
|
return lastIndexUpdateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:是否收费,1:收费,0:免费
|
||||||
|
*/
|
||||||
|
public void setIsVip(Integer isVip) {
|
||||||
|
this.isVip = isVip;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:是否收费,1:收费,0:免费
|
||||||
|
*/
|
||||||
|
public Integer getIsVip() {
|
||||||
|
return isVip;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:状态,0:入库,1:上架
|
||||||
|
*/
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:状态,0:入库,1:上架
|
||||||
|
*/
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:爬虫源站ID
|
||||||
|
*/
|
||||||
|
public void setCrawlSourceId(Integer crawlSourceId) {
|
||||||
|
this.crawlSourceId = crawlSourceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:爬虫源站ID
|
||||||
|
*/
|
||||||
|
public Integer getCrawlSourceId() {
|
||||||
|
return crawlSourceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:抓取的源站小说ID
|
||||||
|
*/
|
||||||
|
public void setCrawlBookId(String crawlBookId) {
|
||||||
|
this.crawlBookId = crawlBookId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:抓取的源站小说ID
|
||||||
|
*/
|
||||||
|
public String getCrawlBookId() {
|
||||||
|
return crawlBookId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:最后一次的抓取时间
|
||||||
|
*/
|
||||||
|
public void setCrawlLastTime(Date crawlLastTime) {
|
||||||
|
this.crawlLastTime = crawlLastTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:最后一次的抓取时间
|
||||||
|
*/
|
||||||
|
public Date getCrawlLastTime() {
|
||||||
|
return crawlLastTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:是否已停止更新,0:未停止,1:已停止
|
||||||
|
*/
|
||||||
|
public void setCrawlIsStop(Integer crawlIsStop) {
|
||||||
|
this.crawlIsStop = crawlIsStop;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:是否已停止更新,0:未停止,1:已停止
|
||||||
|
*/
|
||||||
|
public Integer getCrawlIsStop() {
|
||||||
|
return crawlIsStop;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,177 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说目录表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 19:51:54
|
||||||
|
*/
|
||||||
|
public class BookIndexDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//小说ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long bookId;
|
||||||
|
//目录号
|
||||||
|
private Integer indexNum;
|
||||||
|
//目录名
|
||||||
|
private String indexName;
|
||||||
|
//字数
|
||||||
|
private Integer wordCount;
|
||||||
|
//是否收费,1:收费,0:免费
|
||||||
|
private Integer isVip;
|
||||||
|
//章节费用(屋币)
|
||||||
|
private Integer bookPrice;
|
||||||
|
//存储方式
|
||||||
|
private String storageType;
|
||||||
|
//
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:小说ID
|
||||||
|
*/
|
||||||
|
public void setBookId(Long bookId) {
|
||||||
|
this.bookId = bookId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:小说ID
|
||||||
|
*/
|
||||||
|
public Long getBookId() {
|
||||||
|
return bookId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:目录号
|
||||||
|
*/
|
||||||
|
public void setIndexNum(Integer indexNum) {
|
||||||
|
this.indexNum = indexNum;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:目录号
|
||||||
|
*/
|
||||||
|
public Integer getIndexNum() {
|
||||||
|
return indexNum;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:目录名
|
||||||
|
*/
|
||||||
|
public void setIndexName(String indexName) {
|
||||||
|
this.indexName = indexName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:目录名
|
||||||
|
*/
|
||||||
|
public String getIndexName() {
|
||||||
|
return indexName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:字数
|
||||||
|
*/
|
||||||
|
public void setWordCount(Integer wordCount) {
|
||||||
|
this.wordCount = wordCount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:字数
|
||||||
|
*/
|
||||||
|
public Integer getWordCount() {
|
||||||
|
return wordCount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:是否收费,1:收费,0:免费
|
||||||
|
*/
|
||||||
|
public void setIsVip(Integer isVip) {
|
||||||
|
this.isVip = isVip;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:是否收费,1:收费,0:免费
|
||||||
|
*/
|
||||||
|
public Integer getIsVip() {
|
||||||
|
return isVip;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:章节费用(屋币)
|
||||||
|
*/
|
||||||
|
public void setBookPrice(Integer bookPrice) {
|
||||||
|
this.bookPrice = bookPrice;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:章节费用(屋币)
|
||||||
|
*/
|
||||||
|
public Integer getBookPrice() {
|
||||||
|
return bookPrice;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:存储方式
|
||||||
|
*/
|
||||||
|
public void setStorageType(String storageType) {
|
||||||
|
this.storageType = storageType;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:存储方式
|
||||||
|
*/
|
||||||
|
public String getStorageType() {
|
||||||
|
return storageType;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,175 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页小说设置表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 10:01:13
|
||||||
|
*/
|
||||||
|
public class BookSettingDO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//小说ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long bookId;
|
||||||
|
//排序号
|
||||||
|
private Integer sort;
|
||||||
|
//类型,0:轮播图,1:顶部小说栏设置,2:本周强推,3:热门推荐,4:精品推荐
|
||||||
|
private Integer type;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//创建人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
//更新人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long updateUserId;
|
||||||
|
|
||||||
|
private String bookName;
|
||||||
|
|
||||||
|
public String getBookName() {
|
||||||
|
return bookName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBookName(String bookName) {
|
||||||
|
this.bookName = bookName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:小说ID
|
||||||
|
*/
|
||||||
|
public void setBookId(Long bookId) {
|
||||||
|
this.bookId = bookId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:小说ID
|
||||||
|
*/
|
||||||
|
public Long getBookId() {
|
||||||
|
return bookId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:排序号
|
||||||
|
*/
|
||||||
|
public void setSort(Integer sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:排序号
|
||||||
|
*/
|
||||||
|
public Integer getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:类型,0:轮播图,1:顶部小说栏设置,2:本周强推,3:热门推荐,4:精品推荐
|
||||||
|
*/
|
||||||
|
public void setType(Integer type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:类型,0:轮播图,1:顶部小说栏设置,2:本周强推,3:热门推荐,4:精品推荐
|
||||||
|
*/
|
||||||
|
public Integer getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:创建人ID
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:创建人ID
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:更新人ID
|
||||||
|
*/
|
||||||
|
public void setUpdateUserId(Long updateUserId) {
|
||||||
|
this.updateUserId = updateUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:更新人ID
|
||||||
|
*/
|
||||||
|
public Long getUpdateUserId() {
|
||||||
|
return updateUserId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
public class CategoryDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
private Integer id;
|
||||||
|
//分类名
|
||||||
|
private String name;
|
||||||
|
//排序
|
||||||
|
private Integer sort;
|
||||||
|
//
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
//
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long updateUserId;
|
||||||
|
//
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:分类名
|
||||||
|
*/
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:分类名
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:排序
|
||||||
|
*/
|
||||||
|
public void setSort(Integer sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:排序
|
||||||
|
*/
|
||||||
|
public Integer getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setUpdateUserId(Long updateUserId) {
|
||||||
|
this.updateUserId = updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Long getUpdateUserId() {
|
||||||
|
return updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,163 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 15:12:25
|
||||||
|
*/
|
||||||
|
public class FriendLinkDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
private Integer id;
|
||||||
|
//链接名
|
||||||
|
private String linkName;
|
||||||
|
//链接url
|
||||||
|
private String linkUrl;
|
||||||
|
//排序号
|
||||||
|
private Integer sort;
|
||||||
|
//是否开启,0:不开启,1:开启
|
||||||
|
private Integer isOpen;
|
||||||
|
//创建人id
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//更新者用户id
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long updateUserId;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:链接名
|
||||||
|
*/
|
||||||
|
public void setLinkName(String linkName) {
|
||||||
|
this.linkName = linkName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:链接名
|
||||||
|
*/
|
||||||
|
public String getLinkName() {
|
||||||
|
return linkName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:链接url
|
||||||
|
*/
|
||||||
|
public void setLinkUrl(String linkUrl) {
|
||||||
|
this.linkUrl = linkUrl;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:链接url
|
||||||
|
*/
|
||||||
|
public String getLinkUrl() {
|
||||||
|
return linkUrl;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:排序号
|
||||||
|
*/
|
||||||
|
public void setSort(Integer sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:排序号
|
||||||
|
*/
|
||||||
|
public Integer getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:是否开启,0:不开启,1:开启
|
||||||
|
*/
|
||||||
|
public void setIsOpen(Integer isOpen) {
|
||||||
|
this.isOpen = isOpen;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:是否开启,0:不开启,1:开启
|
||||||
|
*/
|
||||||
|
public Integer getIsOpen() {
|
||||||
|
return isOpen;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建人id
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:创建人id
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新者用户id
|
||||||
|
*/
|
||||||
|
public void setUpdateUserId(Long updateUserId) {
|
||||||
|
this.updateUserId = updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新者用户id
|
||||||
|
*/
|
||||||
|
public Long getUpdateUserId() {
|
||||||
|
return updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
}
|
180
novel-admin/src/main/java/com/java2nb/novel/domain/NewsDO.java
Normal file
180
novel-admin/src/main/java/com/java2nb/novel/domain/NewsDO.java
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
public class NewsDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//类别ID
|
||||||
|
private Integer catId;
|
||||||
|
//分类名
|
||||||
|
private String catName;
|
||||||
|
//来源
|
||||||
|
private String sourceName;
|
||||||
|
//标题
|
||||||
|
private String title;
|
||||||
|
//内容
|
||||||
|
private String content;
|
||||||
|
//发布时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//发布人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
//更新人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long updateUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:类别ID
|
||||||
|
*/
|
||||||
|
public void setCatId(Integer catId) {
|
||||||
|
this.catId = catId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:类别ID
|
||||||
|
*/
|
||||||
|
public Integer getCatId() {
|
||||||
|
return catId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:分类名
|
||||||
|
*/
|
||||||
|
public void setCatName(String catName) {
|
||||||
|
this.catName = catName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:分类名
|
||||||
|
*/
|
||||||
|
public String getCatName() {
|
||||||
|
return catName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:来源
|
||||||
|
*/
|
||||||
|
public void setSourceName(String sourceName) {
|
||||||
|
this.sourceName = sourceName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:来源
|
||||||
|
*/
|
||||||
|
public String getSourceName() {
|
||||||
|
return sourceName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:标题
|
||||||
|
*/
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:标题
|
||||||
|
*/
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:内容
|
||||||
|
*/
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:内容
|
||||||
|
*/
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:发布时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:发布时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:发布人ID
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:发布人ID
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新人ID
|
||||||
|
*/
|
||||||
|
public void setUpdateUserId(Long updateUserId) {
|
||||||
|
this.updateUserId = updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新人ID
|
||||||
|
*/
|
||||||
|
public Long getUpdateUserId() {
|
||||||
|
return updateUserId;
|
||||||
|
}
|
||||||
|
}
|
188
novel-admin/src/main/java/com/java2nb/novel/domain/PayDO.java
Normal file
188
novel-admin/src/main/java/com/java2nb/novel/domain/PayDO.java
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:57
|
||||||
|
*/
|
||||||
|
public class PayDO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//保留
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long outTradeNo;
|
||||||
|
//订单号
|
||||||
|
private String tradeNo;
|
||||||
|
//保留
|
||||||
|
private Integer payChannel;
|
||||||
|
//交易香蕉币
|
||||||
|
private Integer totalAmount;
|
||||||
|
//支付用户ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long userId;
|
||||||
|
//支付状态:0:支付失败,1:支付成功,2:待支付
|
||||||
|
private Integer payStatus;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:保留
|
||||||
|
*/
|
||||||
|
public void setOutTradeNo(Long outTradeNo) {
|
||||||
|
this.outTradeNo = outTradeNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:保留
|
||||||
|
*/
|
||||||
|
public Long getOutTradeNo() {
|
||||||
|
return outTradeNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:订单号
|
||||||
|
*/
|
||||||
|
public void setTradeNo(String tradeNo) {
|
||||||
|
this.tradeNo = tradeNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:订单号
|
||||||
|
*/
|
||||||
|
public String getTradeNo() {
|
||||||
|
return tradeNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:保留
|
||||||
|
*/
|
||||||
|
public void setPayChannel(Integer payChannel) {
|
||||||
|
this.payChannel = payChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:保留
|
||||||
|
*/
|
||||||
|
public Integer getPayChannel() {
|
||||||
|
return payChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:交易香蕉币
|
||||||
|
*/
|
||||||
|
public void setTotalAmount(Integer totalAmount) {
|
||||||
|
this.totalAmount = totalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:交易香蕉币
|
||||||
|
*/
|
||||||
|
public Integer getTotalAmount() {
|
||||||
|
return totalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:支付用户ID
|
||||||
|
*/
|
||||||
|
public void setUserId(Long userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:支付用户ID
|
||||||
|
*/
|
||||||
|
public Long getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:支付状态:0:支付失败,1:支付成功,2:待支付
|
||||||
|
*/
|
||||||
|
public void setPayStatus(Integer payStatus) {
|
||||||
|
this.payStatus = payStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:支付状态:0:支付失败,1:支付成功,2:待支付
|
||||||
|
*/
|
||||||
|
public Integer getPayStatus() {
|
||||||
|
return payStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
}
|
177
novel-admin/src/main/java/com/java2nb/novel/domain/UserDO.java
Normal file
177
novel-admin/src/main/java/com/java2nb/novel/domain/UserDO.java
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:08
|
||||||
|
*/
|
||||||
|
public class UserDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//登录名
|
||||||
|
private String username;
|
||||||
|
//登录密码
|
||||||
|
private String password;
|
||||||
|
//昵称
|
||||||
|
private String nickName;
|
||||||
|
//用户头像
|
||||||
|
private String userPhoto;
|
||||||
|
//用户性别,0:男,1:女
|
||||||
|
private Integer userSex;
|
||||||
|
//账户余额
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long accountBalance;
|
||||||
|
//用户状态,0:正常
|
||||||
|
private Integer status;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:登录名
|
||||||
|
*/
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:登录名
|
||||||
|
*/
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:登录密码
|
||||||
|
*/
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:登录密码
|
||||||
|
*/
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:昵称
|
||||||
|
*/
|
||||||
|
public void setNickName(String nickName) {
|
||||||
|
this.nickName = nickName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:昵称
|
||||||
|
*/
|
||||||
|
public String getNickName() {
|
||||||
|
return nickName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:用户头像
|
||||||
|
*/
|
||||||
|
public void setUserPhoto(String userPhoto) {
|
||||||
|
this.userPhoto = userPhoto;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:用户头像
|
||||||
|
*/
|
||||||
|
public String getUserPhoto() {
|
||||||
|
return userPhoto;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:用户性别,0:男,1:女
|
||||||
|
*/
|
||||||
|
public void setUserSex(Integer userSex) {
|
||||||
|
this.userSex = userSex;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:用户性别,0:男,1:女
|
||||||
|
*/
|
||||||
|
public Integer getUserSex() {
|
||||||
|
return userSex;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:账户余额
|
||||||
|
*/
|
||||||
|
public void setAccountBalance(Long accountBalance) {
|
||||||
|
this.accountBalance = accountBalance;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:账户余额
|
||||||
|
*/
|
||||||
|
public Long getAccountBalance() {
|
||||||
|
return accountBalance;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:用户状态,0:正常
|
||||||
|
*/
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:用户状态,0:正常
|
||||||
|
*/
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 11:08:54
|
||||||
|
*/
|
||||||
|
public class UserFeedbackDO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键id
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//用户id
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long userId;
|
||||||
|
//反馈内容
|
||||||
|
private String content;
|
||||||
|
//反馈时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键id
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:主键id
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:用户id
|
||||||
|
*/
|
||||||
|
public void setUserId(Long userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:用户id
|
||||||
|
*/
|
||||||
|
public Long getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:反馈内容
|
||||||
|
*/
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:反馈内容
|
||||||
|
*/
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:反馈时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:反馈时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,208 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 11:05:43
|
||||||
|
*/
|
||||||
|
public class WebsiteInfoDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//网站名
|
||||||
|
private String name;
|
||||||
|
//网站域名
|
||||||
|
private String domain;
|
||||||
|
//SEO关键词
|
||||||
|
private String keyword;
|
||||||
|
//网站描述
|
||||||
|
private String description;
|
||||||
|
//站长QQ
|
||||||
|
private String qq;
|
||||||
|
//网站logo图片(默认)
|
||||||
|
private String logo;
|
||||||
|
//网站logo图片(深色)
|
||||||
|
private String logoDark;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//创建人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
//更新人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long updateUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:网站名
|
||||||
|
*/
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:网站名
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:网站域名
|
||||||
|
*/
|
||||||
|
public void setDomain(String domain) {
|
||||||
|
this.domain = domain;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:网站域名
|
||||||
|
*/
|
||||||
|
public String getDomain() {
|
||||||
|
return domain;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:SEO关键词
|
||||||
|
*/
|
||||||
|
public void setKeyword(String keyword) {
|
||||||
|
this.keyword = keyword;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:SEO关键词
|
||||||
|
*/
|
||||||
|
public String getKeyword() {
|
||||||
|
return keyword;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:网站描述
|
||||||
|
*/
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:网站描述
|
||||||
|
*/
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:站长QQ
|
||||||
|
*/
|
||||||
|
public void setQq(String qq) {
|
||||||
|
this.qq = qq;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:站长QQ
|
||||||
|
*/
|
||||||
|
public String getQq() {
|
||||||
|
return qq;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:网站logo图片(默认)
|
||||||
|
*/
|
||||||
|
public void setLogo(String logo) {
|
||||||
|
this.logo = logo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:网站logo图片(默认)
|
||||||
|
*/
|
||||||
|
public String getLogo() {
|
||||||
|
return logo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:网站logo图片(深色)
|
||||||
|
*/
|
||||||
|
public void setLogoDark(String logoDark) {
|
||||||
|
this.logoDark = logoDark;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:网站logo图片(深色)
|
||||||
|
*/
|
||||||
|
public String getLogoDark() {
|
||||||
|
return logoDark;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建人ID
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:创建人ID
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新人ID
|
||||||
|
*/
|
||||||
|
public void setUpdateUserId(Long updateUserId) {
|
||||||
|
this.updateUserId = updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新人ID
|
||||||
|
*/
|
||||||
|
public Long getUpdateUserId() {
|
||||||
|
return updateUserId;
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@ package com.java2nb.novel.service;
|
|||||||
|
|
||||||
import com.java2nb.novel.domain.AuthorDO;
|
import com.java2nb.novel.domain.AuthorDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -27,4 +28,6 @@ public interface AuthorService {
|
|||||||
int remove(Long id);
|
int remove(Long id);
|
||||||
|
|
||||||
int batchRemove(Long[] ids);
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
Map<Object, Object> tableSta(Date minDate);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookCommentDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说评论表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 21:59:28
|
||||||
|
*/
|
||||||
|
public interface BookCommentService {
|
||||||
|
|
||||||
|
BookCommentDO get(Long id);
|
||||||
|
|
||||||
|
List<BookCommentDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(BookCommentDO bookComment);
|
||||||
|
|
||||||
|
int update(BookCommentDO bookComment);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookContentDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说内容表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 19:52:06
|
||||||
|
*/
|
||||||
|
public interface BookContentService {
|
||||||
|
|
||||||
|
BookContentDO get(Long id);
|
||||||
|
|
||||||
|
List<BookContentDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(BookContentDO bookContent);
|
||||||
|
|
||||||
|
int update(BookContentDO bookContent);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookIndexDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说目录表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 19:51:54
|
||||||
|
*/
|
||||||
|
public interface BookIndexService {
|
||||||
|
|
||||||
|
BookIndexDO get(Long id);
|
||||||
|
|
||||||
|
List<BookIndexDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(BookIndexDO bookIndex);
|
||||||
|
|
||||||
|
int update(BookIndexDO bookIndex);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:46
|
||||||
|
*/
|
||||||
|
public interface BookService {
|
||||||
|
|
||||||
|
BookDO get(Long id);
|
||||||
|
|
||||||
|
List<BookDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(BookDO book);
|
||||||
|
|
||||||
|
int update(BookDO book);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
Map<Object, Object> tableSta(Date minDate);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookSettingDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页小说设置表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 10:01:13
|
||||||
|
*/
|
||||||
|
public interface BookSettingService {
|
||||||
|
|
||||||
|
BookSettingDO get(Long id);
|
||||||
|
|
||||||
|
List<BookSettingDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(BookSettingDO bookSetting);
|
||||||
|
|
||||||
|
int update(BookSettingDO bookSetting);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
public interface CategoryService {
|
||||||
|
|
||||||
|
CategoryDO get(Integer id);
|
||||||
|
|
||||||
|
List<CategoryDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(CategoryDO category);
|
||||||
|
|
||||||
|
int update(CategoryDO category);
|
||||||
|
|
||||||
|
int remove(Integer id);
|
||||||
|
|
||||||
|
int batchRemove(Integer[] ids);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.FriendLinkDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 15:12:25
|
||||||
|
*/
|
||||||
|
public interface FriendLinkService {
|
||||||
|
|
||||||
|
FriendLinkDO get(Integer id);
|
||||||
|
|
||||||
|
List<FriendLinkDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(FriendLinkDO friendLink);
|
||||||
|
|
||||||
|
int update(FriendLinkDO friendLink);
|
||||||
|
|
||||||
|
int remove(Integer id);
|
||||||
|
|
||||||
|
int batchRemove(Integer[] ids);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
public interface NewsService {
|
||||||
|
|
||||||
|
NewsDO get(Long id);
|
||||||
|
|
||||||
|
List<NewsDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(NewsDO news);
|
||||||
|
|
||||||
|
int update(NewsDO news);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.PayDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:57
|
||||||
|
*/
|
||||||
|
public interface PayService {
|
||||||
|
|
||||||
|
PayDO get(Long id);
|
||||||
|
|
||||||
|
List<PayDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(PayDO pay);
|
||||||
|
|
||||||
|
int update(PayDO pay);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
Map<Object, Object> tableSta(Date minDate);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserFeedbackDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 11:08:54
|
||||||
|
*/
|
||||||
|
public interface UserFeedbackService {
|
||||||
|
|
||||||
|
UserFeedbackDO get(Long id);
|
||||||
|
|
||||||
|
List<UserFeedbackDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(UserFeedbackDO userFeedback);
|
||||||
|
|
||||||
|
int update(UserFeedbackDO userFeedback);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:08
|
||||||
|
*/
|
||||||
|
public interface UserService {
|
||||||
|
|
||||||
|
UserDO get(Long id);
|
||||||
|
|
||||||
|
List<UserDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(UserDO user);
|
||||||
|
|
||||||
|
int update(UserDO user);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
Map<Object, Object> tableSta(Date minDate);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.WebsiteInfoDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-14 11:05:43
|
||||||
|
*/
|
||||||
|
public interface WebsiteInfoService {
|
||||||
|
|
||||||
|
WebsiteInfoDO get(Long id);
|
||||||
|
|
||||||
|
List<WebsiteInfoDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(WebsiteInfoDO websiteInfo);
|
||||||
|
|
||||||
|
int update(WebsiteInfoDO websiteInfo);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -3,8 +3,10 @@ package com.java2nb.novel.service.impl;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.java2nb.novel.dao.AuthorDao;
|
import com.java2nb.novel.dao.AuthorDao;
|
||||||
import com.java2nb.novel.domain.AuthorDO;
|
import com.java2nb.novel.domain.AuthorDO;
|
||||||
@ -52,4 +54,13 @@ public class AuthorServiceImpl implements AuthorService {
|
|||||||
return authorDao.batchRemove(ids);
|
return authorDao.batchRemove(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Object, Object> tableSta(Date minDate) {
|
||||||
|
List<Map<Object, Object>> maps = authorDao.tableSta(minDate);
|
||||||
|
|
||||||
|
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("authorCount")));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,77 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.BookCommentDao;
|
||||||
|
import com.java2nb.novel.dao.BookDao;
|
||||||
|
import com.java2nb.novel.dao.UserDao;
|
||||||
|
import com.java2nb.novel.domain.BookCommentDO;
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
import com.java2nb.novel.domain.UserDO;
|
||||||
|
import com.java2nb.novel.service.BookCommentService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BookCommentServiceImpl implements BookCommentService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BookCommentDao bookCommentDao;
|
||||||
|
@Autowired
|
||||||
|
private BookDao bookDao;
|
||||||
|
@Autowired
|
||||||
|
private UserDao userDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BookCommentDO get(Long id) {
|
||||||
|
return bookCommentDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BookCommentDO> list(Map<String, Object> map) {
|
||||||
|
List<BookCommentDO> list = bookCommentDao.list(map);
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
List<Long> bookIds = list.stream().map(BookCommentDO::getBookId).collect(Collectors.toList());
|
||||||
|
Map<Long, String> bookNameMap = bookDao.batchGet(bookIds).stream()
|
||||||
|
.collect(Collectors.toMap(BookDO::getId, BookDO::getBookName));
|
||||||
|
List<Long> userIds = list.stream().map(BookCommentDO::getCreateUserId).collect(Collectors.toList());
|
||||||
|
Map<Long, String> userNameMap = userDao.batchGet(userIds).stream()
|
||||||
|
.collect(Collectors.toMap(UserDO::getId, UserDO::getUsername));
|
||||||
|
list.forEach(v -> {
|
||||||
|
v.setBookName(bookNameMap.get(v.getBookId()));
|
||||||
|
v.setUserName(userNameMap.get(v.getCreateUserId()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map) {
|
||||||
|
return bookCommentDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(BookCommentDO bookComment) {
|
||||||
|
return bookCommentDao.save(bookComment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(BookCommentDO bookComment) {
|
||||||
|
return bookCommentDao.update(bookComment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id) {
|
||||||
|
return bookCommentDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids) {
|
||||||
|
return bookCommentDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.BookContentDao;
|
||||||
|
import com.java2nb.novel.domain.BookContentDO;
|
||||||
|
import com.java2nb.novel.service.BookContentService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BookContentServiceImpl implements BookContentService {
|
||||||
|
@Autowired
|
||||||
|
private BookContentDao bookContentDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BookContentDO get(Long id){
|
||||||
|
return bookContentDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BookContentDO> list(Map<String, Object> map){
|
||||||
|
return bookContentDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return bookContentDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(BookContentDO bookContent){
|
||||||
|
return bookContentDao.save(bookContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(BookContentDO bookContent){
|
||||||
|
return bookContentDao.update(bookContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return bookContentDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return bookContentDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.BookIndexDao;
|
||||||
|
import com.java2nb.novel.domain.BookIndexDO;
|
||||||
|
import com.java2nb.novel.service.BookIndexService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BookIndexServiceImpl implements BookIndexService {
|
||||||
|
@Autowired
|
||||||
|
private BookIndexDao bookIndexDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BookIndexDO get(Long id){
|
||||||
|
return bookIndexDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BookIndexDO> list(Map<String, Object> map){
|
||||||
|
return bookIndexDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return bookIndexDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(BookIndexDO bookIndex){
|
||||||
|
return bookIndexDao.save(bookIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(BookIndexDO bookIndex){
|
||||||
|
return bookIndexDao.update(bookIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return bookIndexDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return bookIndexDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.BookContentDao;
|
||||||
|
import com.java2nb.novel.dao.BookDao;
|
||||||
|
import com.java2nb.novel.dao.BookIndexDao;
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
import com.java2nb.novel.service.BookService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BookServiceImpl implements BookService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BookDao bookDao;
|
||||||
|
@Autowired
|
||||||
|
private BookIndexDao bookIndexDao;
|
||||||
|
@Autowired
|
||||||
|
private BookContentDao bookContentDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BookDO get(Long id) {
|
||||||
|
return bookDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BookDO> list(Map<String, Object> map) {
|
||||||
|
return bookDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map) {
|
||||||
|
return bookDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(BookDO book) {
|
||||||
|
return bookDao.save(book);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(BookDO book) {
|
||||||
|
return bookDao.update(book);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public int remove(Long id) {
|
||||||
|
List<Long> indexIds = bookIndexDao.getIdsByBookId(id);
|
||||||
|
if (!CollectionUtils.isEmpty(indexIds)) {
|
||||||
|
Long[] indexIdArray = indexIds.toArray(new Long[0]);
|
||||||
|
bookIndexDao.batchRemove(indexIdArray);
|
||||||
|
bookContentDao.removeByIndexIds(indexIdArray);
|
||||||
|
}
|
||||||
|
return bookDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids) {
|
||||||
|
return bookDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Object, Object> tableSta(Date minDate) {
|
||||||
|
List<Map<Object, Object>> maps = bookDao.tableSta(minDate);
|
||||||
|
|
||||||
|
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("bookCount")));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.BookDao;
|
||||||
|
import com.java2nb.novel.dao.BookSettingDao;
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
import com.java2nb.novel.domain.BookSettingDO;
|
||||||
|
import com.java2nb.novel.service.BookSettingService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BookSettingServiceImpl implements BookSettingService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BookSettingDao bookSettingDao;
|
||||||
|
@Autowired
|
||||||
|
private BookDao bookDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BookSettingDO get(Long id) {
|
||||||
|
return bookSettingDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BookSettingDO> list(Map<String, Object> map) {
|
||||||
|
List<BookSettingDO> list = bookSettingDao.list(map);
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
List<Long> bookIds = list.stream().map(BookSettingDO::getBookId).collect(Collectors.toList());
|
||||||
|
Map<Long, String> bookNameMap = bookDao.batchGet(bookIds).stream()
|
||||||
|
.collect(Collectors.toMap(BookDO::getId, BookDO::getBookName));
|
||||||
|
list = list.stream().filter(v -> bookNameMap.containsKey(v.getBookId())).collect(Collectors.toList());
|
||||||
|
list.forEach(v -> v.setBookName(bookNameMap.get(v.getBookId())));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map) {
|
||||||
|
return bookSettingDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(BookSettingDO bookSetting) {
|
||||||
|
return bookSettingDao.save(bookSetting);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(BookSettingDO bookSetting) {
|
||||||
|
return bookSettingDao.update(bookSetting);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id) {
|
||||||
|
return bookSettingDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids) {
|
||||||
|
return bookSettingDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.CategoryDao;
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
import com.java2nb.novel.service.CategoryService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CategoryServiceImpl implements CategoryService {
|
||||||
|
@Autowired
|
||||||
|
private CategoryDao categoryDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CategoryDO get(Integer id){
|
||||||
|
return categoryDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CategoryDO> list(Map<String, Object> map){
|
||||||
|
return categoryDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return categoryDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(CategoryDO category){
|
||||||
|
category.setCreateTime(new Date());
|
||||||
|
return categoryDao.save(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(CategoryDO category){
|
||||||
|
category.setUpdateTime(new Date());
|
||||||
|
return categoryDao.update(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Integer id){
|
||||||
|
return categoryDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Integer[] ids){
|
||||||
|
return categoryDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.FriendLinkDao;
|
||||||
|
import com.java2nb.novel.domain.FriendLinkDO;
|
||||||
|
import com.java2nb.novel.service.FriendLinkService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class FriendLinkServiceImpl implements FriendLinkService {
|
||||||
|
@Autowired
|
||||||
|
private FriendLinkDao friendLinkDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FriendLinkDO get(Integer id){
|
||||||
|
return friendLinkDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FriendLinkDO> list(Map<String, Object> map){
|
||||||
|
return friendLinkDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return friendLinkDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(FriendLinkDO friendLink){
|
||||||
|
return friendLinkDao.save(friendLink);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(FriendLinkDO friendLink){
|
||||||
|
return friendLinkDao.update(friendLink);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Integer id){
|
||||||
|
return friendLinkDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Integer[] ids){
|
||||||
|
return friendLinkDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user