mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-01 23:26:38 +00:00
Compare commits
47 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
268
README.md
268
README.md
@ -1,4 +1,4 @@
|
|||||||
[]( https://www.kuaidaili.com/?ref=mdpz65syhqup )
|
[]( https://cloud.tencent.com/act/cps/redirect?redirect=2446&cps_key=736e609d66e0ac4e57813316cec6fd0b&from=console )
|
||||||
|
|
||||||
<p align="center">
|
<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 stars" src="https://img.shields.io/github/stars/201206030/novel-plus?logo=github"></a>
|
||||||
@ -8,40 +8,35 @@
|
|||||||
<a href="https://github.com/201206030/novel-plus"><img src="https://visitor-badge.glitch.me/badge?page_id=201206030.novel-plus" alt="visitors"></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>
|
||||||
|
|
||||||
#### 官网
|
<p align="center">
|
||||||
|
👉 <a href='https://novel.xxyopen.com'>官网</a> | 👉 <a href='http://47.106.243.172:8888'>演示站点</a> | 👉 <a href='https://docs.xxyopen.com/course/novelplus/'>项目文档(含安装教程)</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
https://201206030.github.io
|
## 项目介绍
|
||||||
|
|
||||||
#### 学习版
|
|
||||||
|
|
||||||
[基于 Spring Boot 3 + Vue 3 开发的前后端分离学习型小说项目](https://github.com/201206030/novel)
|
|
||||||
|
|
||||||
#### 微服务版
|
|
||||||
|
|
||||||
[Github](https://github.com/201206030/novel-cloud) | [码云](https://gitee.com/novel_dev_team/novel-cloud)
|
|
||||||
|
|
||||||
#### 演示地址
|
|
||||||
|
|
||||||
[点击前往](http://47.106.243.172:8888/)
|
|
||||||
|
|
||||||
#### 项目介绍
|
|
||||||
|
|
||||||
novel-plus 是一个多端(PC、WAP)阅读,功能完善的原创文学 CMS
|
novel-plus 是一个多端(PC、WAP)阅读,功能完善的原创文学 CMS
|
||||||
系统。由前台门户系统、作家后台管理系统、平台后台管理系统和爬虫管理系统等多个子系统构成,包括小说推荐、作品检索、小说排行、小说阅读、小说评论、会员中心、作家专区等功能,支持自定义多模版、可拓展的多种小说内容存储方式(内置数据库分表存储和
|
系统。由前台门户系统、作家后台管理系统、平台后台管理系统和爬虫管理系统等多个子系统构成,包括小说推荐、作品检索、小说排行、小说阅读、小说评论、会员中心、作家专区等功能,支持自定义多模版、可拓展的多种小说内容存储方式(内置数据库分表存储和
|
||||||
TXT 文本存储)、阅读主题切换、多爬虫源自动采集和更新数据、会员充值、订阅模式、新闻发布和实时统计报表。
|
TXT 文本存储)、阅读主题切换、多爬虫源自动采集和更新数据、会员充值、订阅模式、新闻发布和实时统计报表。
|
||||||
|
|
||||||
#### 项目结构
|
## 项目地址
|
||||||
|
|
||||||
|
- 学习版:[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)
|
||||||
|
|
||||||
|
## 项目结构
|
||||||
|
|
||||||
```
|
```
|
||||||
novel-plus -- 父工程
|
novel-plus -- 父工程
|
||||||
├── novel-common -- 通用模块
|
├── novel-common -- 通用模块
|
||||||
├── novel-front -- 前台门户&作家后台管理子系统(可拆分)
|
├── novel-front -- 前台门户&作家后台
|
||||||
├── novel-crawl -- 爬虫管理子系统
|
├── novel-crawl -- 爬虫
|
||||||
├── novel-admin -- 平台后台管理子系统
|
├── novel-admin -- 管理后台
|
||||||
└── templates -- 前端模版
|
└── templates -- 前端模版
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 技术选型
|
## 技术选型
|
||||||
|
|
||||||
| 技术 | 说明
|
| 技术 | 说明
|
||||||
|---------------------| ---------------------------
|
|---------------------| ---------------------------
|
||||||
@ -49,240 +44,45 @@ novel-plus -- 父工程
|
|||||||
| MyBatis | 持久层 ORM 框架
|
| MyBatis | 持久层 ORM 框架
|
||||||
| MyBatis Dynamic SQL | Mybatis 动态 sql
|
| MyBatis Dynamic SQL | Mybatis 动态 sql
|
||||||
| PageHelper | MyBatis 分页插件
|
| PageHelper | MyBatis 分页插件
|
||||||
| MyBatisGenerator | 持久层代码生成插件
|
| MyBatis Generator | 持久层代码生成插件
|
||||||
| Sharding-Jdbc | 代码层分库分表中间件
|
| Sharding-JDBC | 代码层分库分表中间件
|
||||||
| JJWT | JWT 登录支持
|
| JJWT | JWT 登录支持
|
||||||
| SpringSecurity | 安全框架
|
| Spring Security | 安全框架
|
||||||
| Shiro | 安全框架
|
| Apache Shiro | 安全框架
|
||||||
| Ehcache | Java 进程内缓存框架(默认缓存)
|
| Redis | 缓存方案
|
||||||
| Redis | 分布式缓存(缓存替换方案,默认关闭,一行配置开启)
|
|
||||||
| Elasticsearch | 搜索引擎(搜索增强方案,默认关闭,一行配置开启)
|
|
||||||
| RabbitMQ | 消息队列(流量削峰,默认关闭,一行配置开启)
|
|
||||||
| Aliyun OSS | 阿里云对象存储服务(图片存储方式之一,一行配置即可切换)
|
| Aliyun OSS | 阿里云对象存储服务(图片存储方式之一,一行配置即可切换)
|
||||||
| FastDFS | 开源轻量级分布式文件系统(图片存储方式之一,一行配置即可切换)
|
| FastDFS | 开源轻量级分布式文件系统(图片存储方式之一,一行配置即可切换)
|
||||||
| Redisson | 实现分布式锁
|
|
||||||
| Lombok | 简化对象封装工具
|
| Lombok | 简化对象封装工具
|
||||||
| Docker | 应用容器引擎
|
| Docker | 应用容器引擎
|
||||||
| MySQL | 数据库服务
|
| MySQL | 数据库服务
|
||||||
| Thymeleaf | 模板引擎
|
| Thymeleaf | 模板引擎
|
||||||
| Layui | 前端 UI 框架
|
| Layui | 前端 UI 框架
|
||||||
|
|
||||||
#### 橙色主题模版截图
|
## 项目演示
|
||||||
|
|
||||||
##### PC站截图
|
https://www.bilibili.com/video/BV1Zo4y187Mi
|
||||||
|
|
||||||
1. 首页
|
## 增值服务
|
||||||
|
|
||||||

|
👉 [了解详情](https://novel.xxyopen.com/service.htm)
|
||||||
|
|
||||||
2. 分类索引页
|
## 微信公众号
|
||||||
|
|
||||||

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

|
||||||
|
|
||||||

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

|
|
||||||
|
|
||||||
4. 排行榜
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
5. 详情页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
6. 阅读页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
7. 用户中心
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
8. 充值
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
9. 作家专区
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
10. 购买
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
##### 手机站截图
|
|
||||||
|
|
||||||
1. 首页
|
|
||||||
|
|
||||||
<img src="https://s3.ax1x.com/2020/12/27/r5447n.jpg" alt="index" width="300" />
|
|
||||||
|
|
||||||
2. 小说列表页
|
|
||||||
|
|
||||||
<img src="https://s3.ax1x.com/2020/12/27/r55xKg.jpg" alt="微信图片_20190904181558" width="300" />
|
|
||||||
|
|
||||||
3. 小说详情页
|
|
||||||
|
|
||||||
<img src="https://s3.ax1x.com/2020/12/28/roZWOf.jpg" alt="QQ图片20191018161901" width="300" />
|
|
||||||
|
|
||||||
4. 小说阅读页
|
|
||||||
|
|
||||||
<img src="https://s3.ax1x.com/2020/12/27/r55Stx.jpg" alt="QQ图片20191018161901" width="300" />
|
|
||||||
|
|
||||||
##### 爬虫管理系统截图
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
##### 后台管理系统截图
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### 深色主题模版截图
|
|
||||||
|
|
||||||
##### PC站截图
|
|
||||||
|
|
||||||
1. 首页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
##### 手机站截图
|
|
||||||
|
|
||||||
1. 首页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
4. 小说详情页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
5. 目录页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
5. 小说阅读页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### 蓝色主题模版截图(更新中)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### 源码安装教程
|
|
||||||
|
|
||||||
- JDK 安装
|
|
||||||
|
|
||||||
建议[安装 JDK 8](https://docs.oracle.com/javase/8/docs/technotes/guides/install/linux_jdk.html)
|
|
||||||
|
|
||||||
- MySQL 安装:
|
|
||||||
|
|
||||||
1. [安装 MySQL 服务](https://dev.mysql.com/doc/refman/8.0/en/linux-installation.html)
|
|
||||||
2. 修改 MySQL`max_allowed_packet `配置(建议 100 M)
|
|
||||||
3. 新建数据库,设置编码为 utf8mb4
|
|
||||||
4. 执行 doc/sql/novel_plus.sql 脚本文件
|
|
||||||
|
|
||||||
- Maven 安装
|
|
||||||
|
|
||||||
[安装 Apache Maven](https://maven.apache.org/install.html)
|
|
||||||
|
|
||||||
- 源码打包
|
|
||||||
|
|
||||||
novel-plus 根目录下执行打包命令`mvn clean package -Dmaven.test.skip`
|
|
||||||
|
|
||||||
- 爬虫安装
|
|
||||||
|
|
||||||
1. 上传 novel-crawl/target/build/novel-crawl.zip 压缩包到 Linux 服务器的 novel-crawl 目录
|
|
||||||
2. 使用`unzip novel-crawl.zip`命令解压 novel-crawl.zip
|
|
||||||
3. 修改 `config/application-common-prod.yml` 文件中的数据库配置
|
|
||||||
4. 修改 `config/application-common-prod.yml` 文件中的管理员账号密码
|
|
||||||
5. 根据需要[设置爬虫的代理IP](https://github.com/201206030/novel-plus/wiki/%E7%88%AC%E8%99%AB%E7%A8%8B%E5%BA%8F-HTTP-%E4%BB%A3%E7%90%86%E8%AE%BE%E7%BD%AE)
|
|
||||||
6. novel-crawl 目录下使用`bin/novel-crawl.sh start`命令启动爬虫程序
|
|
||||||
7. 打开浏览器,默认`8083`端口访问
|
|
||||||
8. 选择已有或新增爬虫源(支持自定义爬虫规则),点击`开启`按钮,开始采集小说数据
|
|
||||||
9. novel-crawl 目录下使用`bin/novel-crawl.sh stop`命令停止爬虫程序
|
|
||||||
10. novel-crawl 目录下使用`bin/novel-crawl.sh restart`命令重启爬虫程序
|
|
||||||
11. novel-crawl 目录下使用`bin/novel-crawl.sh status`命令查看爬虫程序的运行状态
|
|
||||||
|
|
||||||
- 前台安装
|
|
||||||
|
|
||||||
1. 上传 novel-front/target/build/novel-front.zip 压缩包到 Linux 服务器的 novel-front 目录
|
|
||||||
2. 使用`unzip novel-front.zip`命令解压 novel-front.zip
|
|
||||||
3. 修改 `config/application-common-prod.yml` 文件中的数据库配置
|
|
||||||
4. 修改 `config/application-website.yml` 配置文件中的网站信息
|
|
||||||
5. novel-front 目录下使用`bin/novel-front.sh start`命令启动前台程序
|
|
||||||
6. 打开浏览器,默认`8085`端口访问
|
|
||||||
7. novel-front 目录下使用`bin/novel-front.sh stop`命令停止前台程序
|
|
||||||
8. novel-front 目录下使用`bin/novel-front.sh restart`命令重启前台程序
|
|
||||||
9. novel-front 目录下使用`bin/novel-front.sh status`命令查看前台程序的运行状态
|
|
||||||
|
|
||||||
- 后台安装
|
|
||||||
|
|
||||||
1. 上传 novel-admin/target/build/novel-admin.zip 压缩包到 Linux 服务器的 novel-admin 目录
|
|
||||||
2. 使用`unzip novel-admin.zip`命令解压 novel-admin.zip
|
|
||||||
3. 修改 `config/application-prod.yml` 文件中的数据库配置
|
|
||||||
4. novel-admin 目录下使用`bin/novel-admin.sh start`命令启动后台程序
|
|
||||||
5. 打开浏览器,默认`8088`端口访问
|
|
||||||
6. novel-admin 目录下使用`bin/novel-admin.sh stop`命令停止后台程序
|
|
||||||
7. novel-admin 目录下使用`bin/novel-admin.sh restart`命令重启后台程序
|
|
||||||
8. novel-admin 目录下使用`bin/novel-admin.sh status`命令查看后台程序的运行状态
|
|
||||||
|
|
||||||
**注:部分环境(如新版 Mac OS 系统)获取不到主机 IP,需要手动修改 hosts 文件,增加 IP-主机名(通过 hostname 命令查看主机名)的映射。**
|
|
||||||
|
|
||||||
#### 代码仓库
|
|
||||||
|
|
||||||
Github 仓库地址: https://github.com/201206030/novel-plus
|
|
||||||
|
|
||||||
Gitee 仓库地址: https://gitee.com/novel_dev_team/novel-plus
|
|
||||||
|
|
||||||
#### QQ 交流群
|
|
||||||
|
|
||||||
[点击前往官网查看](https://xiongxyang.gitee.io/service.htm)
|
|
||||||
|
|
||||||
#### 微信交流群
|
|
||||||
|
|
||||||
微信群二维码会过期,所以每周在公众号更新一次,请关注公众号“**xxyopen**”回复关键词“**微信群**”获取。
|
|
||||||
|
|
||||||
问问题的三要素
|
|
||||||
|
|
||||||
1. 说明背景,使用了哪个模块,要做什么?
|
|
||||||
|
|
||||||
2. 怎么输入或操作的得到了什么结果? 截图,日志
|
|
||||||
|
|
||||||
3. 哪里不明白或有什么疑问 ?
|
|
||||||
|
|
||||||
#### 微信公众号(发布最新更新资讯、最新前端模版、最新爬虫规则、技术文档等)
|
|
||||||
|
|
||||||

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

|

|
||||||
|
|
||||||
#### 免责声明
|
## 免责声明
|
||||||
|
|
||||||
本项目提供的爬虫工具仅用于采集项目初期的测试数据,请勿用于商业盈利。 用户使用本系统从事任何违法违规的事情,一切后果由用户自行承担,作者不承担任何责任。
|
本项目提供的爬虫工具仅用于采集项目初期的测试数据,请勿用于商业盈利。 用户使用本系统从事任何违法违规的事情,一切后果由用户自行承担,作者不承担任何责任。
|
||||||
|
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);
|
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<artifactId>novel-admin</artifactId>
|
<artifactId>novel-admin</artifactId>
|
||||||
<version>3.6.2</version>
|
<version>4.0.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>
|
||||||
@ -195,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包部署需要-->
|
||||||
@ -293,16 +296,28 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</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>
|
||||||
|
@ -6,5 +6,15 @@ spring:
|
|||||||
url: jdbc:mysql://127.0.0.1:3306/novel_plus?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/novel_plus?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: test123456
|
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
|
||||||
|
@ -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,8 +62,8 @@ 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");
|
||||||
@ -76,7 +71,7 @@ public class ShiroConfig {
|
|||||||
filterChainDefinitionMap.put("/docs/**", "anon");
|
filterChainDefinitionMap.put("/docs/**", "anon");
|
||||||
filterChainDefinitionMap.put("/layuimini/**", "anon");
|
filterChainDefinitionMap.put("/layuimini/**", "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");
|
||||||
@ -92,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;
|
||||||
}
|
}
|
||||||
@ -108,8 +99,7 @@ public class ShiroConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启shiro aop注解支持.
|
* 开启shiro aop注解支持. 使用代理方式;所以需要开启代码支持;
|
||||||
* 使用代理方式;所以需要开启代码支持;
|
|
||||||
*
|
*
|
||||||
* @param securityManager
|
* @param securityManager
|
||||||
* @return
|
* @return
|
||||||
@ -138,8 +128,7 @@ public class ShiroConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cacheManager 缓存 redis实现
|
* cacheManager 缓存 redis实现 使用的是shiro-redis开源插件
|
||||||
* 使用的是shiro-redis开源插件
|
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -151,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() {
|
||||||
@ -163,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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -184,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
|
|
||||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
@Override
|
||||||
registry.addResourceHandler("/files/**").addResourceLocations("file:///"+ jnConfig.getUploadPath());
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
}
|
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;
|
||||||
@ -32,165 +34,167 @@ import java.util.Map;
|
|||||||
@RequestMapping("/common/sysFile")
|
@RequestMapping("/common/sysFile")
|
||||||
public class FileController extends BaseController {
|
public class FileController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileService sysFileService;
|
private FileService sysFileService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private JnConfig jnConfig;
|
private JnConfig jnConfig;
|
||||||
|
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
@RequiresPermissions("common:sysFile:sysFile")
|
@RequiresPermissions("common:sysFile:sysFile")
|
||||||
String sysFile(Model model) {
|
String sysFile(Model model) {
|
||||||
Map<String, Object> params = new HashMap<>(16);
|
Map<String, Object> params = new HashMap<>(16);
|
||||||
return "common/file/file";
|
return "common/file/file";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RequiresPermissions("common:sysFile:sysFile")
|
@RequiresPermissions("common:sysFile:sysFile")
|
||||||
public PageBean list(@RequestParam Map<String, Object> params) {
|
public PageBean list(@RequestParam Map<String, Object> params) {
|
||||||
// 查询列表数据
|
// 查询列表数据
|
||||||
Query query = new Query(params);
|
Query query = new Query(params);
|
||||||
List<FileDO> sysFileList = sysFileService.list(query);
|
List<FileDO> sysFileList = sysFileService.list(query);
|
||||||
int total = sysFileService.count(query);
|
int total = sysFileService.count(query);
|
||||||
PageBean pageBean = new PageBean(sysFileList, total);
|
PageBean pageBean = new PageBean(sysFileList, total);
|
||||||
return pageBean;
|
return pageBean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/add")
|
@GetMapping("/add")
|
||||||
// @RequiresPermissions("common:bComments")
|
// @RequiresPermissions("common:bComments")
|
||||||
String add() {
|
String add() {
|
||||||
return "common/sysFile/add";
|
return "common/sysFile/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/edit")
|
@GetMapping("/edit")
|
||||||
// @RequiresPermissions("common:bComments")
|
// @RequiresPermissions("common:bComments")
|
||||||
String edit(Long id, Model model) {
|
String edit(Long id, Model model) {
|
||||||
FileDO sysFile = sysFileService.get(id);
|
FileDO sysFile = sysFileService.get(id);
|
||||||
model.addAttribute("sysFile", sysFile);
|
model.addAttribute("sysFile", sysFile);
|
||||||
return "common/sysFile/edit";
|
return "common/sysFile/edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 信息
|
* 信息
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/info/{id}")
|
@RequestMapping("/info/{id}")
|
||||||
@RequiresPermissions("common:info")
|
@RequiresPermissions("common:info")
|
||||||
public R info(@PathVariable("id") Long id) {
|
public R info(@PathVariable("id") Long id) {
|
||||||
FileDO sysFile = sysFileService.get(id);
|
FileDO sysFile = sysFileService.get(id);
|
||||||
return R.ok().put("sysFile", sysFile);
|
return R.ok().put("sysFile", sysFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
@RequiresPermissions("common:save")
|
@RequiresPermissions("common:save")
|
||||||
public R save(FileDO sysFile) {
|
public R save(FileDO sysFile) {
|
||||||
if (sysFileService.save(sysFile) > 0) {
|
if (sysFileService.save(sysFile) > 0) {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
return R.error();
|
return R.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/update")
|
@RequestMapping("/update")
|
||||||
@RequiresPermissions("common:update")
|
@RequiresPermissions("common:update")
|
||||||
public R update(@RequestBody FileDO sysFile) {
|
public R update(@RequestBody FileDO sysFile) {
|
||||||
sysFileService.update(sysFile);
|
sysFileService.update(sysFile);
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
// @RequiresPermissions("common:remove")
|
// @RequiresPermissions("common:remove")
|
||||||
public R remove(Long id, HttpServletRequest request) {
|
public R remove(Long id, HttpServletRequest request) {
|
||||||
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 =
|
||||||
if (sysFileService.remove(id) > 0) {
|
jnConfig.getUploadPath() + sysFileService.get(id).getUrl().replace(Constant.UPLOAD_FILES_PREFIX, "");
|
||||||
boolean b = FileUtil.deleteFile(fileName);
|
if (sysFileService.remove(id) > 0) {
|
||||||
if (!b) {
|
boolean b = FileUtil.deleteFile(fileName);
|
||||||
return R.error("数据库记录删除成功,文件删除失败");
|
if (!b) {
|
||||||
}
|
return R.error("数据库记录删除成功,文件删除失败");
|
||||||
return R.ok();
|
}
|
||||||
} else {
|
return R.ok();
|
||||||
return R.error();
|
} else {
|
||||||
}
|
return R.error();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@PostMapping("/batchRemove")
|
@PostMapping("/batchRemove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequiresPermissions("common:remove")
|
@RequiresPermissions("common:remove")
|
||||||
public R remove(@RequestParam("ids[]") Long[] ids) {
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
if ("test".equals(getUsername())) {
|
if ("test".equals(getUsername())) {
|
||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
}
|
}
|
||||||
sysFileService.batchRemove(ids);
|
sysFileService.batchRemove(ids);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PostMapping("/upload")
|
@PostMapping("/upload")
|
||||||
R upload(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
|
R upload(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
|
||||||
if ("test".equals(getUsername())) {
|
if ("test".equals(getUsername())) {
|
||||||
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,
|
||||||
try {
|
date);
|
||||||
FileUtil.uploadFile(file.getBytes(), jnConfig.getUploadPath()+fileDir, fileName);
|
try {
|
||||||
} catch (Exception e) {
|
FileUtil.uploadFile(file.getBytes(), jnConfig.getUploadPath() + fileDir, fileName);
|
||||||
return R.error();
|
} catch (Exception e) {
|
||||||
}
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件下载
|
* 文件下载
|
||||||
*/
|
*/
|
||||||
@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编码
|
||||||
fileName = URLEncoder.encode(fileName, "UTF-8");
|
fileName = URLEncoder.encode(fileName, "UTF-8");
|
||||||
resp.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
resp.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
||||||
|
|
||||||
resp.setContentLength(in.available());
|
resp.setContentLength(in.available());
|
||||||
|
|
||||||
OutputStream out = resp.getOutputStream();
|
OutputStream out = resp.getOutputStream();
|
||||||
byte[] b = new byte[1024];
|
byte[] b = new byte[1024];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
while ((len = in.read(b)) != -1) {
|
while ((len = in.read(b)) != -1) {
|
||||||
out.write(b, 0, len);
|
out.write(b, 0, len);
|
||||||
}
|
}
|
||||||
out.flush();
|
out.flush();
|
||||||
out.close();
|
out.close();
|
||||||
in.close();
|
in.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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},'%')")
|
|
||||||
List<Map<String, Object>> list(@Param("tableName") String tableName);
|
|
||||||
|
|
||||||
@Select("select count(*) from information_schema.tables where table_schema = (select database())")
|
@Select(
|
||||||
int count(Map<String, Object> map);
|
"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);
|
||||||
|
|
||||||
@Select("select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables \r\n"
|
@Select("select count(*) from information_schema.tables where table_schema = 'novel_plus'")
|
||||||
+ " where table_schema = (select database()) and table_name = #{tableName}")
|
int count(Map<String, Object> map);
|
||||||
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 table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables \r\n"
|
||||||
List<Map<String, String>> listColumns(String tableName);
|
+ " where table_schema = 'novel_plus' and table_name = #{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()) 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' order by ordinal_position")
|
||||||
|
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"
|
||||||
|
+ " 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,208 +14,259 @@ 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;
|
||||||
private Long id;
|
|
||||||
//标签名
|
|
||||||
private String name;
|
|
||||||
//数据值
|
|
||||||
private String value;
|
|
||||||
//类型
|
|
||||||
private String type;
|
|
||||||
//描述
|
|
||||||
private String description;
|
|
||||||
//排序(升序)
|
|
||||||
private BigDecimal sort;
|
|
||||||
//父级编号
|
|
||||||
private Long parentId;
|
|
||||||
//创建者
|
|
||||||
private Integer createBy;
|
|
||||||
//创建时间
|
|
||||||
private Date createDate;
|
|
||||||
//更新者
|
|
||||||
private Long updateBy;
|
|
||||||
//更新时间
|
|
||||||
private Date updateDate;
|
|
||||||
//备注信息
|
|
||||||
private String remarks;
|
|
||||||
//删除标记
|
|
||||||
private String delFlag;
|
|
||||||
|
|
||||||
/**
|
//编号
|
||||||
* 设置:编号
|
private Long id;
|
||||||
*/
|
//标签名
|
||||||
public void setId(Long id) {
|
private String name;
|
||||||
this.id = id;
|
//数据值
|
||||||
}
|
private String value;
|
||||||
/**
|
//类型
|
||||||
* 获取:编号
|
private String type;
|
||||||
*/
|
//描述
|
||||||
public Long getId() {
|
private String description;
|
||||||
return id;
|
//排序(升序)
|
||||||
}
|
private BigDecimal sort;
|
||||||
/**
|
//父级编号
|
||||||
* 设置:标签名
|
private Long parentId;
|
||||||
*/
|
//创建者
|
||||||
public void setName(String name) {
|
private Integer createBy;
|
||||||
this.name = name;
|
//创建时间
|
||||||
}
|
private Date createDate;
|
||||||
/**
|
//更新者
|
||||||
* 获取:标签名
|
private Long updateBy;
|
||||||
*/
|
//更新时间
|
||||||
public String getName() {
|
private Date updateDate;
|
||||||
return name;
|
//备注信息
|
||||||
}
|
private String remarks;
|
||||||
/**
|
//删除标记
|
||||||
* 设置:数据值
|
private String delFlag;
|
||||||
*/
|
|
||||||
public void setValue(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:数据值
|
|
||||||
*/
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:类型
|
|
||||||
*/
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:类型
|
|
||||||
*/
|
|
||||||
public String getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:描述
|
|
||||||
*/
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:描述
|
|
||||||
*/
|
|
||||||
public String getDescription() {
|
|
||||||
return description;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:排序(升序)
|
|
||||||
*/
|
|
||||||
public void setSort(BigDecimal sort) {
|
|
||||||
this.sort = sort;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:排序(升序)
|
|
||||||
*/
|
|
||||||
public BigDecimal getSort() {
|
|
||||||
return sort;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:父级编号
|
|
||||||
*/
|
|
||||||
public void setParentId(Long parentId) {
|
|
||||||
this.parentId = parentId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:父级编号
|
|
||||||
*/
|
|
||||||
public Long getParentId() {
|
|
||||||
return parentId;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:创建者
|
|
||||||
*/
|
|
||||||
public void setCreateBy(Integer createBy) {
|
|
||||||
this.createBy = createBy;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:创建者
|
|
||||||
*/
|
|
||||||
public Integer getCreateBy() {
|
|
||||||
return createBy;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:创建时间
|
|
||||||
*/
|
|
||||||
public void setCreateDate(Date createDate) {
|
|
||||||
this.createDate = createDate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:创建时间
|
|
||||||
*/
|
|
||||||
public Date getCreateDate() {
|
|
||||||
return createDate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:更新者
|
|
||||||
*/
|
|
||||||
public void setUpdateBy(Long updateBy) {
|
|
||||||
this.updateBy = updateBy;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:更新者
|
|
||||||
*/
|
|
||||||
public Long getUpdateBy() {
|
|
||||||
return updateBy;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:更新时间
|
|
||||||
*/
|
|
||||||
public void setUpdateDate(Date updateDate) {
|
|
||||||
this.updateDate = updateDate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:更新时间
|
|
||||||
*/
|
|
||||||
public Date getUpdateDate() {
|
|
||||||
return updateDate;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:备注信息
|
|
||||||
*/
|
|
||||||
public void setRemarks(String remarks) {
|
|
||||||
this.remarks = remarks;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:备注信息
|
|
||||||
*/
|
|
||||||
public String getRemarks() {
|
|
||||||
return remarks;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 设置:删除标记
|
|
||||||
*/
|
|
||||||
public void setDelFlag(String delFlag) {
|
|
||||||
this.delFlag = delFlag;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取:删除标记
|
|
||||||
*/
|
|
||||||
public String getDelFlag() {
|
|
||||||
return delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public String toString() {
|
* 设置:编号
|
||||||
return "DictDO{" +
|
*/
|
||||||
"id=" + id +
|
public void setId(Long id) {
|
||||||
", name='" + name + '\'' +
|
this.id = id;
|
||||||
", value='" + value + '\'' +
|
}
|
||||||
", type='" + type + '\'' +
|
|
||||||
", description='" + description + '\'' +
|
/**
|
||||||
", sort=" + sort +
|
* 获取:编号
|
||||||
", parentId=" + parentId +
|
*/
|
||||||
", createBy=" + createBy +
|
public Long getId() {
|
||||||
", createDate=" + createDate +
|
return id;
|
||||||
", updateBy=" + updateBy +
|
}
|
||||||
", updateDate=" + updateDate +
|
|
||||||
", remarks='" + remarks + '\'' +
|
/**
|
||||||
", delFlag='" + delFlag + '\'' +
|
* 设置:标签名
|
||||||
'}';
|
*/
|
||||||
}
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:标签名
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:数据值
|
||||||
|
*/
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:数据值
|
||||||
|
*/
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:类型
|
||||||
|
*/
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:类型
|
||||||
|
*/
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:描述
|
||||||
|
*/
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:描述
|
||||||
|
*/
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:排序(升序)
|
||||||
|
*/
|
||||||
|
public void setSort(BigDecimal sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:排序(升序)
|
||||||
|
*/
|
||||||
|
public BigDecimal getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:父级编号
|
||||||
|
*/
|
||||||
|
public void setParentId(Long parentId) {
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:父级编号
|
||||||
|
*/
|
||||||
|
public Long getParentId() {
|
||||||
|
return parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:创建者
|
||||||
|
*/
|
||||||
|
public void setCreateBy(Integer createBy) {
|
||||||
|
this.createBy = createBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:创建者
|
||||||
|
*/
|
||||||
|
public Integer getCreateBy() {
|
||||||
|
return createBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateDate(Date createDate) {
|
||||||
|
this.createDate = createDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateDate() {
|
||||||
|
return createDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:更新者
|
||||||
|
*/
|
||||||
|
public void setUpdateBy(Long updateBy) {
|
||||||
|
this.updateBy = updateBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:更新者
|
||||||
|
*/
|
||||||
|
public Long getUpdateBy() {
|
||||||
|
return updateBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateDate(Date updateDate) {
|
||||||
|
this.updateDate = updateDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateDate() {
|
||||||
|
return updateDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:备注信息
|
||||||
|
*/
|
||||||
|
public void setRemarks(String remarks) {
|
||||||
|
this.remarks = remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:备注信息
|
||||||
|
*/
|
||||||
|
public String getRemarks() {
|
||||||
|
return remarks;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:删除标记
|
||||||
|
*/
|
||||||
|
public void setDelFlag(String delFlag) {
|
||||||
|
this.delFlag = delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:删除标记
|
||||||
|
*/
|
||||||
|
public String getDelFlag() {
|
||||||
|
return delFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "DictDO{" +
|
||||||
|
"id=" + id +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
", value='" + value + '\'' +
|
||||||
|
", type='" + type + '\'' +
|
||||||
|
", description='" + description + '\'' +
|
||||||
|
", sort=" + sort +
|
||||||
|
", parentId=" + parentId +
|
||||||
|
", createBy=" + createBy +
|
||||||
|
", createDate=" + createDate +
|
||||||
|
", updateBy=" + updateBy +
|
||||||
|
", updateDate=" + updateDate +
|
||||||
|
", remarks='" + remarks + '\'' +
|
||||||
|
", 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,72 +1,74 @@
|
|||||||
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
|
|
||||||
private FileDao sysFileMapper;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private JnConfig jnConfig;
|
private FileDao sysFileMapper;
|
||||||
@Override
|
|
||||||
public FileDO get(Long id){
|
|
||||||
return sysFileMapper.get(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Autowired
|
||||||
public List<FileDO> list(Map<String, Object> map){
|
private JnConfig jnConfig;
|
||||||
return sysFileMapper.list(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(Map<String, Object> map){
|
public FileDO get(Long id) {
|
||||||
return sysFileMapper.count(map);
|
return sysFileMapper.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int save(FileDO sysFile){
|
public List<FileDO> list(Map<String, Object> map) {
|
||||||
return sysFileMapper.save(sysFile);
|
return sysFileMapper.list(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(FileDO sysFile){
|
public int count(Map<String, Object> map) {
|
||||||
return sysFileMapper.update(sysFile);
|
return sysFileMapper.count(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int remove(Long id){
|
public int save(FileDO sysFile) {
|
||||||
return sysFileMapper.remove(id);
|
return sysFileMapper.save(sysFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchRemove(Long[] ids){
|
public int update(FileDO sysFile) {
|
||||||
return sysFileMapper.batchRemove(ids);
|
return sysFileMapper.update(sysFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id) {
|
||||||
|
return sysFileMapper.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids) {
|
||||||
|
return sysFileMapper.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
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()) {
|
||||||
isExist = true;
|
isExist = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isExist;
|
return isExist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -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.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,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,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:detail")
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
@ -1,15 +1,15 @@
|
|||||||
package com.java2nb.novel.dao;
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
import com.java2nb.novel.domain.BookDO;
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小说表
|
* 小说表
|
||||||
|
*
|
||||||
* @author xiongxy
|
* @author xiongxy
|
||||||
* @email 1179705413@qq.com
|
* @email 1179705413@qq.com
|
||||||
* @date 2020-12-01 03:49:46
|
* @date 2020-12-01 03:49:46
|
||||||
@ -17,19 +17,22 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface BookDao {
|
public interface BookDao {
|
||||||
|
|
||||||
BookDO get(Long id);
|
BookDO get(Long id);
|
||||||
|
|
||||||
List<BookDO> list(Map<String,Object> map);
|
List<BookDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
int count(Map<String,Object> map);
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
int save(BookDO book);
|
int save(BookDO book);
|
||||||
|
|
||||||
int update(BookDO book);
|
int update(BookDO book);
|
||||||
|
|
||||||
int remove(Long id);
|
int remove(Long id);
|
||||||
|
|
||||||
int batchRemove(Long[] ids);
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
List<Map<Object, Object>> tableSta(Date minDate);
|
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.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);
|
||||||
|
}
|
@ -1,15 +1,13 @@
|
|||||||
package com.java2nb.novel.dao;
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
import com.java2nb.novel.domain.UserDO;
|
import com.java2nb.novel.domain.UserDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author xiongxy
|
* @author xiongxy
|
||||||
* @email 1179705413@qq.com
|
* @email 1179705413@qq.com
|
||||||
* @date 2020-12-01 03:49:08
|
* @date 2020-12-01 03:49:08
|
||||||
@ -17,19 +15,21 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface UserDao {
|
public interface UserDao {
|
||||||
|
|
||||||
UserDO get(Long id);
|
UserDO get(Long id);
|
||||||
|
|
||||||
List<UserDO> list(Map<String,Object> map);
|
List<UserDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
int count(Map<String,Object> map);
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
int save(UserDO user);
|
int save(UserDO user);
|
||||||
|
|
||||||
int update(UserDO user);
|
int update(UserDO user);
|
||||||
|
|
||||||
int remove(Long id);
|
int remove(Long id);
|
||||||
|
|
||||||
int batchRemove(Long[] ids);
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
List<Map<Object, Object>> tableSta(Date minDate);
|
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.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;
|
||||||
|
}
|
||||||
|
}
|
@ -1,17 +1,11 @@
|
|||||||
package com.java2nb.novel.domain;
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,475 +13,443 @@ import java.util.Date;
|
|||||||
*
|
*
|
||||||
* @author xiongxy
|
* @author xiongxy
|
||||||
* @email 1179705413@qq.com
|
* @email 1179705413@qq.com
|
||||||
* @date 2020-12-01 03:49:46
|
* @date 2023-04-14 17:42:55
|
||||||
*/
|
*/
|
||||||
public class BookDO implements Serializable {
|
public class BookDO implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
//主键
|
//主键
|
||||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
//所以通过序列化成字符串来解决
|
//所以通过序列化成字符串来解决
|
||||||
@JsonSerialize(using = LongToStringSerializer.class)
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
private Long id;
|
private Long id;
|
||||||
//作品方向,0:男频,1:女频'
|
//作品方向,0:男频,1:女频'
|
||||||
private Integer workDirection;
|
private Integer workDirection;
|
||||||
//分类ID
|
//分类ID
|
||||||
private Integer catId;
|
private Integer catId;
|
||||||
//分类名
|
//分类名
|
||||||
private String catName;
|
private String catName;
|
||||||
//子分类ID
|
//小说封面
|
||||||
private Integer catChildId;
|
private String picUrl;
|
||||||
//子分类名
|
//小说名
|
||||||
private String catChildName;
|
private String bookName;
|
||||||
//小说封面
|
//作者id
|
||||||
private String picUrl;
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
//小说名
|
//所以通过序列化成字符串来解决
|
||||||
private String bookName;
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
//男主角姓名
|
private Long authorId;
|
||||||
private String heroName;
|
//作者名
|
||||||
//女主角姓名
|
private String authorName;
|
||||||
private String ladyName;
|
//书籍描述
|
||||||
//作品风格,0:甜宠,1:虐恋,2:其他
|
private String bookDesc;
|
||||||
private Integer bookStyle;
|
//评分,预留字段
|
||||||
//作品标签
|
private Float score;
|
||||||
private String bookLabel;
|
//书籍状态,0:连载中,1:已完结
|
||||||
//作者id
|
private Integer bookStatus;
|
||||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
//点击量
|
||||||
//所以通过序列化成字符串来解决
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
@JsonSerialize(using = LongToStringSerializer.class)
|
//所以通过序列化成字符串来解决
|
||||||
private Long authorId;
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
//作者名
|
private Long visitCount;
|
||||||
private String authorName;
|
//总字数
|
||||||
//书籍描述
|
private Integer wordCount;
|
||||||
private String bookDesc;
|
//评论数
|
||||||
//评分,预留字段
|
private Integer commentCount;
|
||||||
private Float score;
|
//昨日订阅数
|
||||||
//书籍状态,0:连载中,1:已完结
|
private Integer yesterdayBuy;
|
||||||
private Integer bookStatus;
|
//最新目录ID
|
||||||
//点击量
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
//所以通过序列化成字符串来解决
|
||||||
//所以通过序列化成字符串来解决
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
@JsonSerialize(using = LongToStringSerializer.class)
|
private Long lastIndexId;
|
||||||
private Long visitCount;
|
//最新目录名
|
||||||
//总字数
|
private String lastIndexName;
|
||||||
private Integer wordCount;
|
//最新目录更新时间
|
||||||
//评论数
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Integer commentCount;
|
private Date lastIndexUpdateTime;
|
||||||
//昨日订阅数
|
//是否收费,1:收费,0:免费
|
||||||
private Integer yesterdayBuy;
|
private Integer isVip;
|
||||||
//最新目录ID
|
//状态,0:入库,1:上架
|
||||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
private Integer status;
|
||||||
//所以通过序列化成字符串来解决
|
//更新时间
|
||||||
@JsonSerialize(using = LongToStringSerializer.class)
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Long lastIndexId;
|
private Date updateTime;
|
||||||
//最新目录名
|
//创建时间
|
||||||
private String lastIndexName;
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
//最新目录更新时间
|
private Date createTime;
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
//爬虫源站ID
|
||||||
private Date lastIndexUpdateTime;
|
private Integer crawlSourceId;
|
||||||
//是否收费,1:收费,0:免费
|
//抓取的源站小说ID
|
||||||
private Integer isVip;
|
private String crawlBookId;
|
||||||
//状态,0:入库,1:上架
|
//最后一次的抓取时间
|
||||||
private Integer status;
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
//更新时间
|
private Date crawlLastTime;
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
//是否已停止更新,0:未停止,1:已停止
|
||||||
private Date updateTime;
|
private Integer crawlIsStop;
|
||||||
//创建时间
|
|
||||||
@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) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取:主键
|
/**
|
||||||
*/
|
* 获取:主键
|
||||||
public Long getId() {
|
*/
|
||||||
return id;
|
public Long getId() {
|
||||||
}
|
return id;
|
||||||
/**
|
}
|
||||||
* 设置:作品方向,0:男频,1:女频'
|
|
||||||
*/
|
/**
|
||||||
public void setWorkDirection(Integer workDirection) {
|
* 设置:作品方向,0:男频,1:女频'
|
||||||
this.workDirection = workDirection;
|
*/
|
||||||
}
|
public void setWorkDirection(Integer workDirection) {
|
||||||
/**
|
this.workDirection = workDirection;
|
||||||
* 获取:作品方向,0:男频,1:女频'
|
}
|
||||||
*/
|
|
||||||
public Integer getWorkDirection() {
|
/**
|
||||||
return workDirection;
|
* 获取:作品方向,0:男频,1:女频'
|
||||||
}
|
*/
|
||||||
/**
|
public Integer getWorkDirection() {
|
||||||
* 设置:分类ID
|
return workDirection;
|
||||||
*/
|
}
|
||||||
public void setCatId(Integer catId) {
|
|
||||||
this.catId = catId;
|
/**
|
||||||
}
|
* 设置:分类ID
|
||||||
/**
|
*/
|
||||||
* 获取:分类ID
|
public void setCatId(Integer catId) {
|
||||||
*/
|
this.catId = catId;
|
||||||
public Integer getCatId() {
|
}
|
||||||
return catId;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:分类ID
|
||||||
* 设置:分类名
|
*/
|
||||||
*/
|
public Integer getCatId() {
|
||||||
public void setCatName(String catName) {
|
return catId;
|
||||||
this.catName = catName;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 获取:分类名
|
* 设置:分类名
|
||||||
*/
|
*/
|
||||||
public String getCatName() {
|
public void setCatName(String catName) {
|
||||||
return catName;
|
this.catName = catName;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 设置:子分类ID
|
/**
|
||||||
*/
|
* 获取:分类名
|
||||||
public void setCatChildId(Integer catChildId) {
|
*/
|
||||||
this.catChildId = catChildId;
|
public String getCatName() {
|
||||||
}
|
return catName;
|
||||||
/**
|
}
|
||||||
* 获取:子分类ID
|
|
||||||
*/
|
/**
|
||||||
public Integer getCatChildId() {
|
* 设置:小说封面
|
||||||
return catChildId;
|
*/
|
||||||
}
|
public void setPicUrl(String picUrl) {
|
||||||
/**
|
this.picUrl = picUrl;
|
||||||
* 设置:子分类名
|
}
|
||||||
*/
|
|
||||||
public void setCatChildName(String catChildName) {
|
/**
|
||||||
this.catChildName = catChildName;
|
* 获取:小说封面
|
||||||
}
|
*/
|
||||||
/**
|
public String getPicUrl() {
|
||||||
* 获取:子分类名
|
return picUrl;
|
||||||
*/
|
}
|
||||||
public String getCatChildName() {
|
|
||||||
return catChildName;
|
/**
|
||||||
}
|
* 设置:小说名
|
||||||
/**
|
*/
|
||||||
* 设置:小说封面
|
public void setBookName(String bookName) {
|
||||||
*/
|
this.bookName = bookName;
|
||||||
public void setPicUrl(String picUrl) {
|
}
|
||||||
this.picUrl = picUrl;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:小说名
|
||||||
* 获取:小说封面
|
*/
|
||||||
*/
|
public String getBookName() {
|
||||||
public String getPicUrl() {
|
return bookName;
|
||||||
return picUrl;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 设置:小说名
|
* 设置:作者id
|
||||||
*/
|
*/
|
||||||
public void setBookName(String bookName) {
|
public void setAuthorId(Long authorId) {
|
||||||
this.bookName = bookName;
|
this.authorId = authorId;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取:小说名
|
/**
|
||||||
*/
|
* 获取:作者id
|
||||||
public String getBookName() {
|
*/
|
||||||
return bookName;
|
public Long getAuthorId() {
|
||||||
}
|
return authorId;
|
||||||
/**
|
}
|
||||||
* 设置:男主角姓名
|
|
||||||
*/
|
/**
|
||||||
public void setHeroName(String heroName) {
|
* 设置:作者名
|
||||||
this.heroName = heroName;
|
*/
|
||||||
}
|
public void setAuthorName(String authorName) {
|
||||||
/**
|
this.authorName = authorName;
|
||||||
* 获取:男主角姓名
|
}
|
||||||
*/
|
|
||||||
public String getHeroName() {
|
/**
|
||||||
return heroName;
|
* 获取:作者名
|
||||||
}
|
*/
|
||||||
/**
|
public String getAuthorName() {
|
||||||
* 设置:女主角姓名
|
return authorName;
|
||||||
*/
|
}
|
||||||
public void setLadyName(String ladyName) {
|
|
||||||
this.ladyName = ladyName;
|
/**
|
||||||
}
|
* 设置:书籍描述
|
||||||
/**
|
*/
|
||||||
* 获取:女主角姓名
|
public void setBookDesc(String bookDesc) {
|
||||||
*/
|
this.bookDesc = bookDesc;
|
||||||
public String getLadyName() {
|
}
|
||||||
return ladyName;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:书籍描述
|
||||||
* 设置:作品风格,0:甜宠,1:虐恋,2:其他
|
*/
|
||||||
*/
|
public String getBookDesc() {
|
||||||
public void setBookStyle(Integer bookStyle) {
|
return bookDesc;
|
||||||
this.bookStyle = bookStyle;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 获取:作品风格,0:甜宠,1:虐恋,2:其他
|
* 设置:评分,预留字段
|
||||||
*/
|
*/
|
||||||
public Integer getBookStyle() {
|
public void setScore(Float score) {
|
||||||
return bookStyle;
|
this.score = score;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 设置:作品标签
|
/**
|
||||||
*/
|
* 获取:评分,预留字段
|
||||||
public void setBookLabel(String bookLabel) {
|
*/
|
||||||
this.bookLabel = bookLabel;
|
public Float getScore() {
|
||||||
}
|
return score;
|
||||||
/**
|
}
|
||||||
* 获取:作品标签
|
|
||||||
*/
|
/**
|
||||||
public String getBookLabel() {
|
* 设置:书籍状态,0:连载中,1:已完结
|
||||||
return bookLabel;
|
*/
|
||||||
}
|
public void setBookStatus(Integer bookStatus) {
|
||||||
/**
|
this.bookStatus = bookStatus;
|
||||||
* 设置:作者id
|
}
|
||||||
*/
|
|
||||||
public void setAuthorId(Long authorId) {
|
/**
|
||||||
this.authorId = authorId;
|
* 获取:书籍状态,0:连载中,1:已完结
|
||||||
}
|
*/
|
||||||
/**
|
public Integer getBookStatus() {
|
||||||
* 获取:作者id
|
return bookStatus;
|
||||||
*/
|
}
|
||||||
public Long getAuthorId() {
|
|
||||||
return authorId;
|
/**
|
||||||
}
|
* 设置:点击量
|
||||||
/**
|
*/
|
||||||
* 设置:作者名
|
public void setVisitCount(Long visitCount) {
|
||||||
*/
|
this.visitCount = visitCount;
|
||||||
public void setAuthorName(String authorName) {
|
}
|
||||||
this.authorName = authorName;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:点击量
|
||||||
* 获取:作者名
|
*/
|
||||||
*/
|
public Long getVisitCount() {
|
||||||
public String getAuthorName() {
|
return visitCount;
|
||||||
return authorName;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 设置:书籍描述
|
* 设置:总字数
|
||||||
*/
|
*/
|
||||||
public void setBookDesc(String bookDesc) {
|
public void setWordCount(Integer wordCount) {
|
||||||
this.bookDesc = bookDesc;
|
this.wordCount = wordCount;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取:书籍描述
|
/**
|
||||||
*/
|
* 获取:总字数
|
||||||
public String getBookDesc() {
|
*/
|
||||||
return bookDesc;
|
public Integer getWordCount() {
|
||||||
}
|
return wordCount;
|
||||||
/**
|
}
|
||||||
* 设置:评分,预留字段
|
|
||||||
*/
|
/**
|
||||||
public void setScore(Float score) {
|
* 设置:评论数
|
||||||
this.score = score;
|
*/
|
||||||
}
|
public void setCommentCount(Integer commentCount) {
|
||||||
/**
|
this.commentCount = commentCount;
|
||||||
* 获取:评分,预留字段
|
}
|
||||||
*/
|
|
||||||
public Float getScore() {
|
/**
|
||||||
return score;
|
* 获取:评论数
|
||||||
}
|
*/
|
||||||
/**
|
public Integer getCommentCount() {
|
||||||
* 设置:书籍状态,0:连载中,1:已完结
|
return commentCount;
|
||||||
*/
|
}
|
||||||
public void setBookStatus(Integer bookStatus) {
|
|
||||||
this.bookStatus = bookStatus;
|
/**
|
||||||
}
|
* 设置:昨日订阅数
|
||||||
/**
|
*/
|
||||||
* 获取:书籍状态,0:连载中,1:已完结
|
public void setYesterdayBuy(Integer yesterdayBuy) {
|
||||||
*/
|
this.yesterdayBuy = yesterdayBuy;
|
||||||
public Integer getBookStatus() {
|
}
|
||||||
return bookStatus;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:昨日订阅数
|
||||||
* 设置:点击量
|
*/
|
||||||
*/
|
public Integer getYesterdayBuy() {
|
||||||
public void setVisitCount(Long visitCount) {
|
return yesterdayBuy;
|
||||||
this.visitCount = visitCount;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 获取:点击量
|
* 设置:最新目录ID
|
||||||
*/
|
*/
|
||||||
public Long getVisitCount() {
|
public void setLastIndexId(Long lastIndexId) {
|
||||||
return visitCount;
|
this.lastIndexId = lastIndexId;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 设置:总字数
|
/**
|
||||||
*/
|
* 获取:最新目录ID
|
||||||
public void setWordCount(Integer wordCount) {
|
*/
|
||||||
this.wordCount = wordCount;
|
public Long getLastIndexId() {
|
||||||
}
|
return lastIndexId;
|
||||||
/**
|
}
|
||||||
* 获取:总字数
|
|
||||||
*/
|
/**
|
||||||
public Integer getWordCount() {
|
* 设置:最新目录名
|
||||||
return wordCount;
|
*/
|
||||||
}
|
public void setLastIndexName(String lastIndexName) {
|
||||||
/**
|
this.lastIndexName = lastIndexName;
|
||||||
* 设置:评论数
|
}
|
||||||
*/
|
|
||||||
public void setCommentCount(Integer commentCount) {
|
/**
|
||||||
this.commentCount = commentCount;
|
* 获取:最新目录名
|
||||||
}
|
*/
|
||||||
/**
|
public String getLastIndexName() {
|
||||||
* 获取:评论数
|
return lastIndexName;
|
||||||
*/
|
}
|
||||||
public Integer getCommentCount() {
|
|
||||||
return commentCount;
|
/**
|
||||||
}
|
* 设置:最新目录更新时间
|
||||||
/**
|
*/
|
||||||
* 设置:昨日订阅数
|
public void setLastIndexUpdateTime(Date lastIndexUpdateTime) {
|
||||||
*/
|
this.lastIndexUpdateTime = lastIndexUpdateTime;
|
||||||
public void setYesterdayBuy(Integer yesterdayBuy) {
|
}
|
||||||
this.yesterdayBuy = yesterdayBuy;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:最新目录更新时间
|
||||||
* 获取:昨日订阅数
|
*/
|
||||||
*/
|
public Date getLastIndexUpdateTime() {
|
||||||
public Integer getYesterdayBuy() {
|
return lastIndexUpdateTime;
|
||||||
return yesterdayBuy;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 设置:最新目录ID
|
* 设置:是否收费,1:收费,0:免费
|
||||||
*/
|
*/
|
||||||
public void setLastIndexId(Long lastIndexId) {
|
public void setIsVip(Integer isVip) {
|
||||||
this.lastIndexId = lastIndexId;
|
this.isVip = isVip;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取:最新目录ID
|
/**
|
||||||
*/
|
* 获取:是否收费,1:收费,0:免费
|
||||||
public Long getLastIndexId() {
|
*/
|
||||||
return lastIndexId;
|
public Integer getIsVip() {
|
||||||
}
|
return isVip;
|
||||||
/**
|
}
|
||||||
* 设置:最新目录名
|
|
||||||
*/
|
/**
|
||||||
public void setLastIndexName(String lastIndexName) {
|
* 设置:状态,0:入库,1:上架
|
||||||
this.lastIndexName = lastIndexName;
|
*/
|
||||||
}
|
public void setStatus(Integer status) {
|
||||||
/**
|
this.status = status;
|
||||||
* 获取:最新目录名
|
}
|
||||||
*/
|
|
||||||
public String getLastIndexName() {
|
/**
|
||||||
return lastIndexName;
|
* 获取:状态,0:入库,1:上架
|
||||||
}
|
*/
|
||||||
/**
|
public Integer getStatus() {
|
||||||
* 设置:最新目录更新时间
|
return status;
|
||||||
*/
|
}
|
||||||
public void setLastIndexUpdateTime(Date lastIndexUpdateTime) {
|
|
||||||
this.lastIndexUpdateTime = lastIndexUpdateTime;
|
/**
|
||||||
}
|
* 设置:更新时间
|
||||||
/**
|
*/
|
||||||
* 获取:最新目录更新时间
|
public void setUpdateTime(Date updateTime) {
|
||||||
*/
|
this.updateTime = updateTime;
|
||||||
public Date getLastIndexUpdateTime() {
|
}
|
||||||
return lastIndexUpdateTime;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:更新时间
|
||||||
* 设置:是否收费,1:收费,0:免费
|
*/
|
||||||
*/
|
public Date getUpdateTime() {
|
||||||
public void setIsVip(Integer isVip) {
|
return updateTime;
|
||||||
this.isVip = isVip;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 获取:是否收费,1:收费,0:免费
|
* 设置:创建时间
|
||||||
*/
|
*/
|
||||||
public Integer getIsVip() {
|
public void setCreateTime(Date createTime) {
|
||||||
return isVip;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 设置:状态,0:入库,1:上架
|
/**
|
||||||
*/
|
* 获取:创建时间
|
||||||
public void setStatus(Integer status) {
|
*/
|
||||||
this.status = status;
|
public Date getCreateTime() {
|
||||||
}
|
return createTime;
|
||||||
/**
|
}
|
||||||
* 获取:状态,0:入库,1:上架
|
|
||||||
*/
|
/**
|
||||||
public Integer getStatus() {
|
* 设置:爬虫源站ID
|
||||||
return status;
|
*/
|
||||||
}
|
public void setCrawlSourceId(Integer crawlSourceId) {
|
||||||
/**
|
this.crawlSourceId = crawlSourceId;
|
||||||
* 设置:更新时间
|
}
|
||||||
*/
|
|
||||||
public void setUpdateTime(Date updateTime) {
|
/**
|
||||||
this.updateTime = updateTime;
|
* 获取:爬虫源站ID
|
||||||
}
|
*/
|
||||||
/**
|
public Integer getCrawlSourceId() {
|
||||||
* 获取:更新时间
|
return crawlSourceId;
|
||||||
*/
|
}
|
||||||
public Date getUpdateTime() {
|
|
||||||
return updateTime;
|
/**
|
||||||
}
|
* 设置:抓取的源站小说ID
|
||||||
/**
|
*/
|
||||||
* 设置:创建时间
|
public void setCrawlBookId(String crawlBookId) {
|
||||||
*/
|
this.crawlBookId = crawlBookId;
|
||||||
public void setCreateTime(Date createTime) {
|
}
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:抓取的源站小说ID
|
||||||
* 获取:创建时间
|
*/
|
||||||
*/
|
public String getCrawlBookId() {
|
||||||
public Date getCreateTime() {
|
return crawlBookId;
|
||||||
return createTime;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 设置:爬虫源站ID
|
* 设置:最后一次的抓取时间
|
||||||
*/
|
*/
|
||||||
public void setCrawlSourceId(Integer crawlSourceId) {
|
public void setCrawlLastTime(Date crawlLastTime) {
|
||||||
this.crawlSourceId = crawlSourceId;
|
this.crawlLastTime = crawlLastTime;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取:爬虫源站ID
|
/**
|
||||||
*/
|
* 获取:最后一次的抓取时间
|
||||||
public Integer getCrawlSourceId() {
|
*/
|
||||||
return crawlSourceId;
|
public Date getCrawlLastTime() {
|
||||||
}
|
return crawlLastTime;
|
||||||
/**
|
}
|
||||||
* 设置:抓取的源站小说ID
|
|
||||||
*/
|
/**
|
||||||
public void setCrawlBookId(String crawlBookId) {
|
* 设置:是否已停止更新,0:未停止,1:已停止
|
||||||
this.crawlBookId = crawlBookId;
|
*/
|
||||||
}
|
public void setCrawlIsStop(Integer crawlIsStop) {
|
||||||
/**
|
this.crawlIsStop = crawlIsStop;
|
||||||
* 获取:抓取的源站小说ID
|
}
|
||||||
*/
|
|
||||||
public String getCrawlBookId() {
|
/**
|
||||||
return crawlBookId;
|
* 获取:是否已停止更新,0:未停止,1:已停止
|
||||||
}
|
*/
|
||||||
/**
|
public Integer getCrawlIsStop() {
|
||||||
* 设置:最后一次的抓取时间
|
return crawlIsStop;
|
||||||
*/
|
}
|
||||||
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,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;
|
||||||
|
}
|
||||||
|
}
|
@ -1,17 +1,11 @@
|
|||||||
package com.java2nb.novel.domain;
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,145 +16,173 @@ import java.util.Date;
|
|||||||
* @date 2020-12-01 03:49:57
|
* @date 2020-12-01 03:49:57
|
||||||
*/
|
*/
|
||||||
public class PayDO implements Serializable {
|
public class PayDO implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
//主键
|
//主键
|
||||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
//所以通过序列化成字符串来解决
|
//所以通过序列化成字符串来解决
|
||||||
@JsonSerialize(using = LongToStringSerializer.class)
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
private Long id;
|
private Long id;
|
||||||
//保留
|
//保留
|
||||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
//所以通过序列化成字符串来解决
|
//所以通过序列化成字符串来解决
|
||||||
@JsonSerialize(using = LongToStringSerializer.class)
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
private Long outTradeNo;
|
private Long outTradeNo;
|
||||||
//订单号
|
//订单号
|
||||||
private String tradeNo;
|
private String tradeNo;
|
||||||
//保留
|
//保留
|
||||||
private Integer payChannel;
|
private Integer payChannel;
|
||||||
//交易香蕉币
|
//交易香蕉币
|
||||||
private Integer totalAmount;
|
private Integer totalAmount;
|
||||||
//支付用户ID
|
//支付用户ID
|
||||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
//所以通过序列化成字符串来解决
|
//所以通过序列化成字符串来解决
|
||||||
@JsonSerialize(using = LongToStringSerializer.class)
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
private Long userId;
|
private Long userId;
|
||||||
//支付状态:0:支付失败,1:支付成功,2:待支付
|
//支付状态:0:支付失败,1:支付成功,2:待支付
|
||||||
private Integer payStatus;
|
private Integer payStatus;
|
||||||
//创建时间
|
//创建时间
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
//更新时间
|
//更新时间
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
/**
|
private String userName;
|
||||||
* 设置:主键
|
|
||||||
*/
|
public String getUserName() {
|
||||||
public void setId(Long id) {
|
return userName;
|
||||||
this.id = id;
|
}
|
||||||
}
|
|
||||||
/**
|
public void setUserName(String userName) {
|
||||||
* 获取:主键
|
this.userName = userName;
|
||||||
*/
|
}
|
||||||
public Long getId() {
|
|
||||||
return id;
|
/**
|
||||||
}
|
* 设置:主键
|
||||||
/**
|
*/
|
||||||
* 设置:保留
|
public void setId(Long id) {
|
||||||
*/
|
this.id = id;
|
||||||
public void setOutTradeNo(Long outTradeNo) {
|
}
|
||||||
this.outTradeNo = outTradeNo;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:主键
|
||||||
* 获取:保留
|
*/
|
||||||
*/
|
public Long getId() {
|
||||||
public Long getOutTradeNo() {
|
return id;
|
||||||
return outTradeNo;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 设置:订单号
|
* 设置:保留
|
||||||
*/
|
*/
|
||||||
public void setTradeNo(String tradeNo) {
|
public void setOutTradeNo(Long outTradeNo) {
|
||||||
this.tradeNo = tradeNo;
|
this.outTradeNo = outTradeNo;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取:订单号
|
/**
|
||||||
*/
|
* 获取:保留
|
||||||
public String getTradeNo() {
|
*/
|
||||||
return tradeNo;
|
public Long getOutTradeNo() {
|
||||||
}
|
return outTradeNo;
|
||||||
/**
|
}
|
||||||
* 设置:保留
|
|
||||||
*/
|
/**
|
||||||
public void setPayChannel(Integer payChannel) {
|
* 设置:订单号
|
||||||
this.payChannel = payChannel;
|
*/
|
||||||
}
|
public void setTradeNo(String tradeNo) {
|
||||||
/**
|
this.tradeNo = tradeNo;
|
||||||
* 获取:保留
|
}
|
||||||
*/
|
|
||||||
public Integer getPayChannel() {
|
/**
|
||||||
return payChannel;
|
* 获取:订单号
|
||||||
}
|
*/
|
||||||
/**
|
public String getTradeNo() {
|
||||||
* 设置:交易香蕉币
|
return tradeNo;
|
||||||
*/
|
}
|
||||||
public void setTotalAmount(Integer totalAmount) {
|
|
||||||
this.totalAmount = totalAmount;
|
/**
|
||||||
}
|
* 设置:保留
|
||||||
/**
|
*/
|
||||||
* 获取:交易香蕉币
|
public void setPayChannel(Integer payChannel) {
|
||||||
*/
|
this.payChannel = payChannel;
|
||||||
public Integer getTotalAmount() {
|
}
|
||||||
return totalAmount;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:保留
|
||||||
* 设置:支付用户ID
|
*/
|
||||||
*/
|
public Integer getPayChannel() {
|
||||||
public void setUserId(Long userId) {
|
return payChannel;
|
||||||
this.userId = userId;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 获取:支付用户ID
|
* 设置:交易香蕉币
|
||||||
*/
|
*/
|
||||||
public Long getUserId() {
|
public void setTotalAmount(Integer totalAmount) {
|
||||||
return userId;
|
this.totalAmount = totalAmount;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 设置:支付状态:0:支付失败,1:支付成功,2:待支付
|
/**
|
||||||
*/
|
* 获取:交易香蕉币
|
||||||
public void setPayStatus(Integer payStatus) {
|
*/
|
||||||
this.payStatus = payStatus;
|
public Integer getTotalAmount() {
|
||||||
}
|
return totalAmount;
|
||||||
/**
|
}
|
||||||
* 获取:支付状态:0:支付失败,1:支付成功,2:待支付
|
|
||||||
*/
|
/**
|
||||||
public Integer getPayStatus() {
|
* 设置:支付用户ID
|
||||||
return payStatus;
|
*/
|
||||||
}
|
public void setUserId(Long userId) {
|
||||||
/**
|
this.userId = userId;
|
||||||
* 设置:创建时间
|
}
|
||||||
*/
|
|
||||||
public void setCreateTime(Date createTime) {
|
/**
|
||||||
this.createTime = createTime;
|
* 获取:支付用户ID
|
||||||
}
|
*/
|
||||||
/**
|
public Long getUserId() {
|
||||||
* 获取:创建时间
|
return userId;
|
||||||
*/
|
}
|
||||||
public Date getCreateTime() {
|
|
||||||
return createTime;
|
/**
|
||||||
}
|
* 设置:支付状态:0:支付失败,1:支付成功,2:待支付
|
||||||
/**
|
*/
|
||||||
* 设置:更新时间
|
public void setPayStatus(Integer payStatus) {
|
||||||
*/
|
this.payStatus = payStatus;
|
||||||
public void setUpdateTime(Date updateTime) {
|
}
|
||||||
this.updateTime = updateTime;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:支付状态:0:支付失败,1:支付成功,2:待支付
|
||||||
* 获取:更新时间
|
*/
|
||||||
*/
|
public Integer getPayStatus() {
|
||||||
public Date getUpdateTime() {
|
return payStatus;
|
||||||
return updateTime;
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
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,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;
|
||||||
|
}
|
||||||
|
}
|
@ -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,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.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);
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,65 +1,79 @@
|
|||||||
package com.java2nb.novel.service.impl;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.Date;
|
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 java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.java2nb.novel.dao.BookDao;
|
|
||||||
import com.java2nb.novel.domain.BookDO;
|
|
||||||
import com.java2nb.novel.service.BookService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class BookServiceImpl implements BookService {
|
public class BookServiceImpl implements BookService {
|
||||||
@Autowired
|
|
||||||
private BookDao bookDao;
|
|
||||||
|
|
||||||
@Override
|
@Autowired
|
||||||
public BookDO get(Long id){
|
private BookDao bookDao;
|
||||||
return bookDao.get(id);
|
@Autowired
|
||||||
}
|
private BookIndexDao bookIndexDao;
|
||||||
|
@Autowired
|
||||||
|
private BookContentDao bookContentDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BookDO> list(Map<String, Object> map){
|
public BookDO get(Long id) {
|
||||||
return bookDao.list(map);
|
return bookDao.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(Map<String, Object> map){
|
public List<BookDO> list(Map<String, Object> map) {
|
||||||
return bookDao.count(map);
|
return bookDao.list(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int save(BookDO book){
|
public int count(Map<String, Object> map) {
|
||||||
return bookDao.save(book);
|
return bookDao.count(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(BookDO book){
|
public int save(BookDO book) {
|
||||||
return bookDao.update(book);
|
return bookDao.save(book);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int remove(Long id){
|
public int update(BookDO book) {
|
||||||
return bookDao.remove(id);
|
return bookDao.update(book);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int batchRemove(Long[] ids){
|
@Override
|
||||||
return bookDao.batchRemove(ids);
|
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
|
@Override
|
||||||
public Map<Object, Object> tableSta(Date minDate) {
|
public int batchRemove(Long[] ids) {
|
||||||
List<Map<Object, Object>> maps = bookDao.tableSta(minDate);
|
return bookDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("bookCount")));
|
@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,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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,66 +1,77 @@
|
|||||||
package com.java2nb.novel.service.impl;
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.PayDao;
|
||||||
|
import com.java2nb.novel.dao.UserDao;
|
||||||
|
import com.java2nb.novel.domain.PayDO;
|
||||||
|
import com.java2nb.novel.domain.UserDO;
|
||||||
|
import com.java2nb.novel.service.PayService;
|
||||||
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.CollectionUtils;
|
||||||
|
|
||||||
import java.util.Date;
|
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 java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.java2nb.novel.dao.PayDao;
|
|
||||||
import com.java2nb.novel.domain.PayDO;
|
|
||||||
import com.java2nb.novel.service.PayService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class PayServiceImpl implements PayService {
|
public class PayServiceImpl implements PayService {
|
||||||
@Autowired
|
|
||||||
private PayDao payDao;
|
|
||||||
|
|
||||||
@Override
|
@Autowired
|
||||||
public PayDO get(Long id){
|
private PayDao payDao;
|
||||||
return payDao.get(id);
|
@Autowired
|
||||||
}
|
private UserDao userDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PayDO> list(Map<String, Object> map){
|
public PayDO get(Long id) {
|
||||||
return payDao.list(map);
|
return payDao.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(Map<String, Object> map){
|
public List<PayDO> list(Map<String, Object> map) {
|
||||||
return payDao.count(map);
|
List<PayDO> list = payDao.list(map);
|
||||||
}
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
List<Long> userIds = list.stream().map(PayDO::getUserId).collect(Collectors.toList());
|
||||||
|
Map<Long, String> userNameMap = userDao.batchGet(userIds).stream()
|
||||||
|
.collect(Collectors.toMap(UserDO::getId, UserDO::getUsername));
|
||||||
|
list.forEach(v -> v.setUserName(userNameMap.get(v.getUserId())));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int save(PayDO pay){
|
public int count(Map<String, Object> map) {
|
||||||
return payDao.save(pay);
|
return payDao.count(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(PayDO pay){
|
public int save(PayDO pay) {
|
||||||
return payDao.update(pay);
|
return payDao.save(pay);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int remove(Long id){
|
public int update(PayDO pay) {
|
||||||
return payDao.remove(id);
|
return payDao.update(pay);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchRemove(Long[] ids){
|
public int remove(Long id) {
|
||||||
return payDao.batchRemove(ids);
|
return payDao.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<Object, Object> tableSta(Date minDate) {
|
public int batchRemove(Long[] ids) {
|
||||||
List<Map<Object, Object>> maps = payDao.tableSta(minDate);
|
return payDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("orderCount")));
|
@Override
|
||||||
|
public Map<Object, Object> tableSta(Date minDate) {
|
||||||
|
List<Map<Object, Object>> maps = payDao.tableSta(minDate);
|
||||||
|
|
||||||
|
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("orderCount")));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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.WebsiteInfoDao;
|
||||||
|
import com.java2nb.novel.domain.WebsiteInfoDO;
|
||||||
|
import com.java2nb.novel.service.WebsiteInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class WebsiteInfoServiceImpl implements WebsiteInfoService {
|
||||||
|
@Autowired
|
||||||
|
private WebsiteInfoDao websiteInfoDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WebsiteInfoDO get(Long id){
|
||||||
|
return websiteInfoDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WebsiteInfoDO> list(Map<String, Object> map){
|
||||||
|
return websiteInfoDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return websiteInfoDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(WebsiteInfoDO websiteInfo){
|
||||||
|
return websiteInfoDao.save(websiteInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(WebsiteInfoDO websiteInfo){
|
||||||
|
return websiteInfoDao.update(websiteInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return websiteInfoDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return websiteInfoDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -5,15 +5,16 @@ import com.java2nb.common.config.Constant;
|
|||||||
import com.java2nb.common.controller.BaseController;
|
import com.java2nb.common.controller.BaseController;
|
||||||
import com.java2nb.common.domain.Tree;
|
import com.java2nb.common.domain.Tree;
|
||||||
import com.java2nb.common.service.DictService;
|
import com.java2nb.common.service.DictService;
|
||||||
import com.java2nb.common.utils.*;
|
import com.java2nb.common.utils.MD5Utils;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
import com.java2nb.system.domain.DeptDO;
|
import com.java2nb.system.domain.DeptDO;
|
||||||
import com.java2nb.system.domain.RoleDO;
|
import com.java2nb.system.domain.RoleDO;
|
||||||
import com.java2nb.system.domain.UserDO;
|
import com.java2nb.system.domain.UserDO;
|
||||||
import com.java2nb.system.service.RoleService;
|
import com.java2nb.system.service.RoleService;
|
||||||
import com.java2nb.system.service.SysUserService;
|
import com.java2nb.system.service.SysUserService;
|
||||||
import com.java2nb.system.vo.UserVO;
|
import com.java2nb.system.vo.UserVO;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
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;
|
||||||
@ -21,6 +22,7 @@ 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 javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -28,217 +30,219 @@ import java.util.Map;
|
|||||||
@RequestMapping("/sys/user")
|
@RequestMapping("/sys/user")
|
||||||
@Controller
|
@Controller
|
||||||
public class SysUserController extends BaseController {
|
public class SysUserController extends BaseController {
|
||||||
private String prefix="system/user" ;
|
|
||||||
@Autowired
|
|
||||||
SysUserService userService;
|
|
||||||
@Autowired
|
|
||||||
RoleService roleService;
|
|
||||||
@Autowired
|
|
||||||
DictService dictService;
|
|
||||||
@Autowired
|
|
||||||
RedisUtil redisUtil;
|
|
||||||
|
|
||||||
@RequiresPermissions("sys:user:user")
|
private String prefix = "system/user";
|
||||||
@GetMapping("")
|
@Autowired
|
||||||
String user(Model model) {
|
SysUserService userService;
|
||||||
return prefix + "/user";
|
@Autowired
|
||||||
}
|
RoleService roleService;
|
||||||
|
@Autowired
|
||||||
|
DictService dictService;
|
||||||
|
|
||||||
@GetMapping("/list")
|
@RequiresPermissions("sys:user:user")
|
||||||
@ResponseBody
|
@GetMapping("")
|
||||||
PageBean list(@RequestParam Map<String, Object> params) {
|
String user(Model model) {
|
||||||
// 查询列表数据
|
return prefix + "/user";
|
||||||
Query query = new Query(params);
|
}
|
||||||
List<UserDO> sysUserList = userService.list(query);
|
|
||||||
int total = userService.count(query);
|
|
||||||
PageBean pageUtil = new PageBean(sysUserList, total);
|
|
||||||
return pageUtil;
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequiresPermissions("sys:user:add")
|
@GetMapping("/list")
|
||||||
@Log("添加用户")
|
@ResponseBody
|
||||||
@GetMapping("/add")
|
PageBean list(@RequestParam Map<String, Object> params) {
|
||||||
String add(Model model) {
|
// 查询列表数据
|
||||||
List<RoleDO> roles = roleService.list();
|
Query query = new Query(params);
|
||||||
model.addAttribute("roles", roles);
|
List<UserDO> sysUserList = userService.list(query);
|
||||||
return prefix + "/add";
|
int total = userService.count(query);
|
||||||
}
|
PageBean pageUtil = new PageBean(sysUserList, total);
|
||||||
|
return pageUtil;
|
||||||
|
}
|
||||||
|
|
||||||
@RequiresPermissions("sys:user:edit")
|
@RequiresPermissions("sys:user:add")
|
||||||
@Log("编辑用户")
|
@Log("添加用户")
|
||||||
@GetMapping("/edit/{id}")
|
@GetMapping("/add")
|
||||||
String edit(Model model, @PathVariable("id") Long id) {
|
String add(Model model) {
|
||||||
UserDO userDO = userService.get(id);
|
List<RoleDO> roles = roleService.list();
|
||||||
model.addAttribute("user", userDO);
|
model.addAttribute("roles", roles);
|
||||||
List<RoleDO> roles = roleService.list(id);
|
return prefix + "/add";
|
||||||
model.addAttribute("roles", roles);
|
}
|
||||||
return prefix+"/edit";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
@RequiresPermissions("sys:user:edit")
|
||||||
System.out.println(MD5Utils.encrypt("admin", "admin"));
|
@Log("编辑用户")
|
||||||
}
|
@GetMapping("/edit/{id}")
|
||||||
|
String edit(Model model, @PathVariable("id") Long id) {
|
||||||
|
UserDO userDO = userService.get(id);
|
||||||
|
model.addAttribute("user", userDO);
|
||||||
|
List<RoleDO> roles = roleService.list(id);
|
||||||
|
model.addAttribute("roles", roles);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
@RequiresPermissions("sys:user:add")
|
public static void main(String[] args) {
|
||||||
@Log("保存用户")
|
System.out.println(MD5Utils.encrypt("admin", "admin"));
|
||||||
@PostMapping("/save")
|
}
|
||||||
@ResponseBody
|
|
||||||
R save(UserDO user) {
|
|
||||||
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
|
||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
|
||||||
}
|
|
||||||
user.setPassword(MD5Utils.encrypt(user.getUsername(), user.getPassword()));
|
|
||||||
if (userService.save(user) > 0) {
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
return R.error();
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequiresPermissions("sys:user:edit")
|
@RequiresPermissions("sys:user:add")
|
||||||
@Log("更新用户")
|
@Log("保存用户")
|
||||||
@PostMapping("/update")
|
@PostMapping("/save")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
R update(UserDO user) {
|
R save(UserDO user) {
|
||||||
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
}
|
}
|
||||||
if (userService.update(user) > 0) {
|
user.setPassword(MD5Utils.encrypt(user.getUsername(), user.getPassword()));
|
||||||
return R.ok();
|
if (userService.save(user) > 0) {
|
||||||
}
|
return R.ok();
|
||||||
return R.error();
|
}
|
||||||
}
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("sys:user:edit")
|
||||||
|
@Log("更新用户")
|
||||||
|
@PostMapping("/update")
|
||||||
|
@ResponseBody
|
||||||
|
R update(UserDO user) {
|
||||||
|
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
||||||
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
|
}
|
||||||
|
if (userService.update(user) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequiresPermissions("sys:user:edit")
|
@RequiresPermissions("sys:user:edit")
|
||||||
@Log("更新用户")
|
@Log("更新用户")
|
||||||
@PostMapping("/updatePeronal")
|
@PostMapping("/updatePeronal")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
R updatePeronal(UserDO user) {
|
R updatePeronal(UserDO user) {
|
||||||
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
}
|
}
|
||||||
if (userService.updatePersonal(user) > 0) {
|
if (userService.updatePersonal(user) > 0) {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
return R.error();
|
return R.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequiresPermissions("sys:user:remove")
|
@RequiresPermissions("sys:user:remove")
|
||||||
@Log("删除用户")
|
@Log("删除用户")
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
R remove(Long id) {
|
R remove(Long id) {
|
||||||
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
}
|
}
|
||||||
if (userService.remove(id) > 0) {
|
if (userService.remove(id) > 0) {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
return R.error();
|
return R.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("sys:user:batchRemove")
|
@RequiresPermissions("sys:user:batchRemove")
|
||||||
@Log("批量删除用户")
|
@Log("批量删除用户")
|
||||||
@PostMapping("/batchRemove")
|
@PostMapping("/batchRemove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
R batchRemove(@RequestParam("ids[]") Long[] userIds) {
|
R batchRemove(@RequestParam("ids[]") Long[] userIds) {
|
||||||
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
}
|
}
|
||||||
int r = userService.batchremove(userIds);
|
int r = userService.batchremove(userIds);
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
return R.error();
|
return R.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/exit")
|
@PostMapping("/exit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
boolean exit(@RequestParam Map<String, Object> params) {
|
boolean exit(@RequestParam Map<String, Object> params) {
|
||||||
// 存在,不通过,false
|
// 存在,不通过,false
|
||||||
return !userService.exit(params);
|
return !userService.exit(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("sys:user:resetPwd")
|
@RequiresPermissions("sys:user:resetPwd")
|
||||||
@Log("请求更改用户密码")
|
@Log("请求更改用户密码")
|
||||||
@GetMapping("/resetPwd/{id}")
|
@GetMapping("/resetPwd/{id}")
|
||||||
String resetPwd(@PathVariable("id") Long userId, Model model) {
|
String resetPwd(@PathVariable("id") Long userId, Model model) {
|
||||||
|
|
||||||
UserDO userDO = new UserDO();
|
UserDO userDO = new UserDO();
|
||||||
userDO.setUserId(userId);
|
userDO.setUserId(userId);
|
||||||
model.addAttribute("user", userDO);
|
model.addAttribute("user", userDO);
|
||||||
return prefix + "/reset_pwd";
|
return prefix + "/reset_pwd";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log("提交更改用户密码")
|
@Log("提交更改用户密码")
|
||||||
@PostMapping("/resetPwd")
|
@PostMapping("/resetPwd")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
R resetPwd(UserVO userVO) {
|
R resetPwd(UserVO userVO) {
|
||||||
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
}
|
}
|
||||||
try{
|
try {
|
||||||
userService.resetPwd(userVO,getUser());
|
userService.resetPwd(userVO, getUser());
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
return R.error(1,e.getMessage());
|
return R.error(1, e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@RequiresPermissions("sys:user:resetPwd")
|
|
||||||
@Log("admin提交更改用户密码")
|
|
||||||
@PostMapping("/adminResetPwd")
|
|
||||||
@ResponseBody
|
|
||||||
R adminResetPwd(UserVO userVO) {
|
|
||||||
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
|
||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
|
||||||
}
|
|
||||||
try{
|
|
||||||
userService.adminResetPwd(userVO);
|
|
||||||
return R.ok();
|
|
||||||
}catch (Exception e){
|
|
||||||
return R.error(1,e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
@RequiresPermissions("sys:user:resetPwd")
|
||||||
@GetMapping("/tree")
|
@Log("admin提交更改用户密码")
|
||||||
@ResponseBody
|
@PostMapping("/adminResetPwd")
|
||||||
public Tree<DeptDO> tree() {
|
@ResponseBody
|
||||||
Tree<DeptDO> tree = new Tree<DeptDO>();
|
R adminResetPwd(UserVO userVO) {
|
||||||
tree = userService.getTree();
|
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
|
||||||
return tree;
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
userService.adminResetPwd(userVO);
|
||||||
|
return R.ok();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.error(1, e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/treeView")
|
}
|
||||||
String treeView() {
|
|
||||||
return prefix + "/userTree";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/personal")
|
@GetMapping("/tree")
|
||||||
String personal(Model model) {
|
@ResponseBody
|
||||||
UserDO userDO = userService.get(getUserId());
|
public Tree<DeptDO> tree() {
|
||||||
model.addAttribute("user",userDO);
|
Tree<DeptDO> tree = new Tree<DeptDO>();
|
||||||
model.addAttribute("hobbyList",dictService.getHobbyList(userDO));
|
tree = userService.getTree();
|
||||||
model.addAttribute("sexList",dictService.getSexList());
|
return tree;
|
||||||
return prefix + "/personal";
|
}
|
||||||
}
|
|
||||||
@ResponseBody
|
@GetMapping("/treeView")
|
||||||
@PostMapping("/uploadImg")
|
String treeView() {
|
||||||
R uploadImg(@RequestParam("avatar_file") MultipartFile file, String avatar_data, HttpServletRequest request) {
|
return prefix + "/userTree";
|
||||||
if ("test".equals(getUsername())) {
|
}
|
||||||
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
|
||||||
}
|
@GetMapping("/personal")
|
||||||
Map<String, Object> result = new HashMap<>();
|
String personal(Model model) {
|
||||||
try {
|
UserDO userDO = userService.get(getUserId());
|
||||||
result = userService.updatePersonalImg(file, avatar_data, getUserId());
|
model.addAttribute("user", userDO);
|
||||||
} catch (Exception e) {
|
model.addAttribute("hobbyList", dictService.getHobbyList(userDO));
|
||||||
return R.error("更新图像失败!");
|
model.addAttribute("sexList", dictService.getSexList());
|
||||||
}
|
return prefix + "/personal";
|
||||||
if(result!=null && result.size()>0){
|
}
|
||||||
return R.ok(result);
|
|
||||||
}else {
|
@ResponseBody
|
||||||
return R.error("更新图像失败!");
|
@PostMapping("/uploadImg")
|
||||||
}
|
R uploadImg(@RequestParam("avatar_file") MultipartFile file, String avatar_data, HttpServletRequest request) {
|
||||||
}
|
if ("test".equals(getUsername())) {
|
||||||
|
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
|
||||||
|
}
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
try {
|
||||||
|
result = userService.updatePersonalImg(file, avatar_data, getUserId());
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.error("更新图像失败!");
|
||||||
|
}
|
||||||
|
if (result != null && result.size() > 0) {
|
||||||
|
return R.ok(result);
|
||||||
|
} else {
|
||||||
|
return R.error("更新图像失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,12 @@
|
|||||||
package com.java2nb.system.domain;
|
package com.java2nb.system.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,153 +17,196 @@ import java.util.Date;
|
|||||||
* @date 2019-11-25 11:40:03
|
* @date 2019-11-25 11:40:03
|
||||||
*/
|
*/
|
||||||
public class DataPermDO implements Serializable {
|
public class DataPermDO implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
//所以通过序列化成字符串来解决
|
//所以通过序列化成字符串来解决
|
||||||
@JsonSerialize(using = LongToStringSerializer.class)
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
private Long id;
|
private Long id;
|
||||||
//权限名称
|
//权限名称
|
||||||
private String name;
|
private String name;
|
||||||
//数据表名称
|
//数据表名称
|
||||||
private String tableName;
|
private String tableName;
|
||||||
//所属模块
|
//所属模块
|
||||||
private String moduleName;
|
private String moduleName;
|
||||||
//用户权限控制属性名
|
//用户权限控制属性名
|
||||||
private String crlAttrName;
|
private String crlAttrName;
|
||||||
//数据表权限控制列名
|
//数据表权限控制列名
|
||||||
private String crlColumnName;
|
private String crlColumnName;
|
||||||
//权限code,all_开头表示查看所有数据的权限,sup_开头表示查看下级数据的权限,own_开头表示查看本级数据的权限
|
//权限code,all_开头表示查看所有数据的权限,sup_开头表示查看下级数据的权限,own_开头表示查看本级数据的权限
|
||||||
private String permCode;
|
private String permCode;
|
||||||
//排序
|
//排序
|
||||||
private Integer orderNum;
|
private Integer orderNum;
|
||||||
//创建时间
|
//创建时间
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date gmtCreate;
|
private Date gmtCreate;
|
||||||
//修改时间
|
//修改时间
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date gmtModified;
|
private Date gmtModified;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置:
|
* 设置:
|
||||||
*/
|
*/
|
||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取:
|
/**
|
||||||
*/
|
* 获取:
|
||||||
public Long getId() {
|
*/
|
||||||
return id;
|
public Long getId() {
|
||||||
}
|
return id;
|
||||||
/**
|
}
|
||||||
* 设置:权限名称
|
|
||||||
*/
|
/**
|
||||||
public void setName(String name) {
|
* 设置:权限名称
|
||||||
this.name = name;
|
*/
|
||||||
}
|
public void setName(String name) {
|
||||||
/**
|
this.name = name;
|
||||||
* 获取:权限名称
|
}
|
||||||
*/
|
|
||||||
public String getName() {
|
/**
|
||||||
return name;
|
* 获取:权限名称
|
||||||
}
|
*/
|
||||||
/**
|
public String getName() {
|
||||||
* 设置:数据表名称
|
return name;
|
||||||
*/
|
}
|
||||||
public void setTableName(String tableName) {
|
|
||||||
this.tableName = tableName;
|
/**
|
||||||
}
|
* 设置:数据表名称
|
||||||
/**
|
*/
|
||||||
* 获取:数据表名称
|
public void setTableName(String tableName) {
|
||||||
*/
|
this.tableName = tableName;
|
||||||
public String getTableName() {
|
}
|
||||||
return tableName;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:数据表名称
|
||||||
* 设置:所属模块
|
*/
|
||||||
*/
|
public String getTableName() {
|
||||||
public void setModuleName(String moduleName) {
|
return tableName;
|
||||||
this.moduleName = moduleName;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 获取:所属模块
|
* 设置:所属模块
|
||||||
*/
|
*/
|
||||||
public String getModuleName() {
|
public void setModuleName(String moduleName) {
|
||||||
return moduleName;
|
this.moduleName = moduleName;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 设置:用户权限控制属性名
|
/**
|
||||||
*/
|
* 获取:所属模块
|
||||||
public void setCrlAttrName(String crlAttrName) {
|
*/
|
||||||
this.crlAttrName = crlAttrName;
|
public String getModuleName() {
|
||||||
}
|
return moduleName;
|
||||||
/**
|
}
|
||||||
* 获取:用户权限控制属性名
|
|
||||||
*/
|
/**
|
||||||
public String getCrlAttrName() {
|
* 设置:用户权限控制属性名
|
||||||
return crlAttrName;
|
*/
|
||||||
}
|
public void setCrlAttrName(String crlAttrName) {
|
||||||
/**
|
this.crlAttrName = crlAttrName;
|
||||||
* 设置:数据表权限控制列名
|
}
|
||||||
*/
|
|
||||||
public void setCrlColumnName(String crlColumnName) {
|
/**
|
||||||
this.crlColumnName = crlColumnName;
|
* 获取:用户权限控制属性名
|
||||||
}
|
*/
|
||||||
/**
|
public String getCrlAttrName() {
|
||||||
* 获取:数据表权限控制列名
|
return crlAttrName;
|
||||||
*/
|
}
|
||||||
public String getCrlColumnName() {
|
|
||||||
return crlColumnName;
|
/**
|
||||||
}
|
* 设置:数据表权限控制列名
|
||||||
/**
|
*/
|
||||||
* 设置:权限code,all_开头表示查看所有数据的权限,sup_开头表示查看下级数据的权限,own_开头表示查看本级数据的权限
|
public void setCrlColumnName(String crlColumnName) {
|
||||||
*/
|
this.crlColumnName = crlColumnName;
|
||||||
public void setPermCode(String permCode) {
|
}
|
||||||
this.permCode = permCode;
|
|
||||||
}
|
/**
|
||||||
/**
|
* 获取:数据表权限控制列名
|
||||||
* 获取:权限code,all_开头表示查看所有数据的权限,sup_开头表示查看下级数据的权限,own_开头表示查看本级数据的权限
|
*/
|
||||||
*/
|
public String getCrlColumnName() {
|
||||||
public String getPermCode() {
|
return crlColumnName;
|
||||||
return permCode;
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 设置:排序
|
* 设置:权限code,all_开头表示查看所有数据的权限,sup_开头表示查看下级数据的权限,own_开头表示查看本级数据的权限
|
||||||
*/
|
*/
|
||||||
public void setOrderNum(Integer orderNum) {
|
public void setPermCode(String permCode) {
|
||||||
this.orderNum = orderNum;
|
this.permCode = permCode;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 获取:排序
|
/**
|
||||||
*/
|
* 获取:权限code,all_开头表示查看所有数据的权限,sup_开头表示查看下级数据的权限,own_开头表示查看本级数据的权限
|
||||||
public Integer getOrderNum() {
|
*/
|
||||||
return orderNum;
|
public String getPermCode() {
|
||||||
}
|
return permCode;
|
||||||
/**
|
}
|
||||||
* 设置:创建时间
|
|
||||||
*/
|
/**
|
||||||
public void setGmtCreate(Date gmtCreate) {
|
* 设置:排序
|
||||||
this.gmtCreate = gmtCreate;
|
*/
|
||||||
}
|
public void setOrderNum(Integer orderNum) {
|
||||||
/**
|
this.orderNum = orderNum;
|
||||||
* 获取:创建时间
|
}
|
||||||
*/
|
|
||||||
public Date getGmtCreate() {
|
/**
|
||||||
return gmtCreate;
|
* 获取:排序
|
||||||
}
|
*/
|
||||||
/**
|
public Integer getOrderNum() {
|
||||||
* 设置:修改时间
|
return orderNum;
|
||||||
*/
|
}
|
||||||
public void setGmtModified(Date gmtModified) {
|
|
||||||
this.gmtModified = gmtModified;
|
/**
|
||||||
}
|
* 设置:创建时间
|
||||||
/**
|
*/
|
||||||
* 获取:修改时间
|
public void setGmtCreate(Date gmtCreate) {
|
||||||
*/
|
this.gmtCreate = gmtCreate;
|
||||||
public Date getGmtModified() {
|
}
|
||||||
return gmtModified;
|
|
||||||
}
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getGmtCreate() {
|
||||||
|
return gmtCreate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:修改时间
|
||||||
|
*/
|
||||||
|
public void setGmtModified(Date gmtModified) {
|
||||||
|
this.gmtModified = gmtModified;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:修改时间
|
||||||
|
*/
|
||||||
|
public Date getGmtModified() {
|
||||||
|
return gmtModified;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
DataPermDO that = (DataPermDO) o;
|
||||||
|
return Objects.equals(id, that.id) && Objects.equals(name, that.name)
|
||||||
|
&& Objects.equals(tableName, that.tableName) && Objects.equals(moduleName, that.moduleName)
|
||||||
|
&& Objects.equals(crlAttrName, that.crlAttrName) && Objects.equals(crlColumnName,
|
||||||
|
that.crlColumnName) && Objects.equals(permCode, that.permCode) && Objects.equals(orderNum,
|
||||||
|
that.orderNum) && Objects.equals(gmtCreate, that.gmtCreate) && Objects.equals(gmtModified,
|
||||||
|
that.gmtModified);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id, name, tableName, moduleName, crlAttrName, crlColumnName, permCode, orderNum, gmtCreate,
|
||||||
|
gmtModified);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package com.java2nb.system.service.impl;
|
package com.java2nb.system.service.impl;
|
||||||
|
|
||||||
import com.java2nb.common.domain.DictDO;
|
|
||||||
import com.java2nb.common.domain.Tree;
|
import com.java2nb.common.domain.Tree;
|
||||||
import com.java2nb.common.utils.BuildTree;
|
import com.java2nb.common.utils.BuildTree;
|
||||||
import com.java2nb.common.utils.IdWorker;
|
import com.java2nb.common.utils.IdWorker;
|
||||||
|
import com.java2nb.system.dao.DataPermDao;
|
||||||
import com.java2nb.system.dao.RoleDataPermDao;
|
import com.java2nb.system.dao.RoleDataPermDao;
|
||||||
|
import com.java2nb.system.domain.DataPermDO;
|
||||||
|
import com.java2nb.system.service.DataPermService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -12,119 +14,116 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import com.java2nb.system.dao.DataPermDao;
|
|
||||||
import com.java2nb.system.domain.DataPermDO;
|
|
||||||
import com.java2nb.system.service.DataPermService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class DataPermServiceImpl implements DataPermService {
|
public class DataPermServiceImpl implements DataPermService {
|
||||||
@Autowired
|
|
||||||
private DataPermDao dataPermDao;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RoleDataPermDao roleDataPermDao;
|
private DataPermDao dataPermDao;
|
||||||
|
|
||||||
@Override
|
@Autowired
|
||||||
public DataPermDO get(Long id){
|
private RoleDataPermDao roleDataPermDao;
|
||||||
return dataPermDao.get(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DataPermDO> list(Map<String, Object> map){
|
public DataPermDO get(Long id) {
|
||||||
return dataPermDao.list(map);
|
return dataPermDao.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(Map<String, Object> map){
|
public List<DataPermDO> list(Map<String, Object> map) {
|
||||||
return dataPermDao.count(map);
|
return dataPermDao.list(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int save(DataPermDO dataPerm){
|
public int count(Map<String, Object> map) {
|
||||||
return dataPermDao.save(dataPerm);
|
return dataPermDao.count(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int update(DataPermDO dataPerm){
|
public int save(DataPermDO dataPerm) {
|
||||||
return dataPermDao.update(dataPerm);
|
return dataPermDao.save(dataPerm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int remove(Long id){
|
public int update(DataPermDO dataPerm) {
|
||||||
return dataPermDao.remove(id);
|
return dataPermDao.update(dataPerm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int batchRemove(Long[] ids){
|
public int remove(Long id) {
|
||||||
return dataPermDao.batchRemove(ids);
|
return dataPermDao.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DataPermDO> listModuleName() {
|
public int batchRemove(Long[] ids) {
|
||||||
return dataPermDao.listModuleName();
|
return dataPermDao.batchRemove(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Tree<DataPermDO> getTree() {
|
public List<DataPermDO> listModuleName() {
|
||||||
List<Tree<DataPermDO>> trees = new ArrayList<Tree<DataPermDO>>();
|
return dataPermDao.listModuleName().stream().distinct().collect(Collectors.toList());
|
||||||
List<DataPermDO> permDOs = dataPermDao.list(new HashMap<>(16));
|
}
|
||||||
Map<String,String> topTree = new HashMap<>();
|
|
||||||
for (DataPermDO permDO : permDOs) {
|
|
||||||
Tree<DataPermDO> tree = new Tree<>();
|
|
||||||
tree.setId(permDO.getId().toString());
|
|
||||||
if(!topTree.containsKey(permDO.getModuleName())){
|
|
||||||
Tree<DataPermDO> parentTree = new Tree<>();
|
|
||||||
String id = new IdWorker().nextId()+"";
|
|
||||||
parentTree.setId(id);
|
|
||||||
parentTree.setParentId(0+"");
|
|
||||||
parentTree.setText(permDO.getModuleName());
|
|
||||||
topTree.put(permDO.getModuleName(),id);
|
|
||||||
trees.add(parentTree);
|
|
||||||
}
|
|
||||||
tree.setParentId(topTree.get(permDO.getModuleName()));
|
|
||||||
tree.setText(permDO.getName());
|
|
||||||
trees.add(tree);
|
|
||||||
}
|
|
||||||
// 默认顶级菜单为0,根据数据库实际情况调整
|
|
||||||
Tree<DataPermDO> t = BuildTree.build(trees);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Tree<DataPermDO> getTree(Long roleId) {
|
public Tree<DataPermDO> getTree() {
|
||||||
List<Tree<DataPermDO>> trees = new ArrayList<Tree<DataPermDO>>();
|
List<Tree<DataPermDO>> trees = new ArrayList<Tree<DataPermDO>>();
|
||||||
List<DataPermDO> permDOs = dataPermDao.list(new HashMap<>(16));
|
List<DataPermDO> permDOs = dataPermDao.list(new HashMap<>(16));
|
||||||
List<Long> permIds = roleDataPermDao.listPermIdByRoleId(roleId);
|
Map<String, String> topTree = new HashMap<>();
|
||||||
Map<String,String> topTree = new HashMap<>();
|
for (DataPermDO permDO : permDOs) {
|
||||||
for (DataPermDO permDO : permDOs) {
|
Tree<DataPermDO> tree = new Tree<>();
|
||||||
Tree<DataPermDO> tree = new Tree<>();
|
tree.setId(permDO.getId().toString());
|
||||||
tree.setId(permDO.getId().toString());
|
if (!topTree.containsKey(permDO.getModuleName())) {
|
||||||
if(!topTree.containsKey(permDO.getModuleName())){
|
Tree<DataPermDO> parentTree = new Tree<>();
|
||||||
Tree<DataPermDO> parentTree = new Tree<>();
|
String id = new IdWorker().nextId() + "";
|
||||||
String id = new IdWorker().nextId()+"";
|
parentTree.setId(id);
|
||||||
parentTree.setId(id);
|
parentTree.setParentId(0 + "");
|
||||||
parentTree.setParentId(0+"");
|
parentTree.setText(permDO.getModuleName());
|
||||||
parentTree.setText(permDO.getModuleName());
|
topTree.put(permDO.getModuleName(), id);
|
||||||
topTree.put(permDO.getModuleName(),id);
|
trees.add(parentTree);
|
||||||
trees.add(parentTree);
|
}
|
||||||
}
|
tree.setParentId(topTree.get(permDO.getModuleName()));
|
||||||
tree.setParentId(topTree.get(permDO.getModuleName()));
|
tree.setText(permDO.getName());
|
||||||
tree.setText(permDO.getName());
|
trees.add(tree);
|
||||||
Map<String, Object> state = new HashMap<>(16);
|
}
|
||||||
if (permIds.contains(permDO.getId())) {
|
// 默认顶级菜单为0,根据数据库实际情况调整
|
||||||
state.put("selected", true);
|
Tree<DataPermDO> t = BuildTree.build(trees);
|
||||||
} else {
|
return t;
|
||||||
state.put("selected", false);
|
}
|
||||||
}
|
|
||||||
tree.setState(state);
|
@Override
|
||||||
trees.add(tree);
|
public Tree<DataPermDO> getTree(Long roleId) {
|
||||||
}
|
List<Tree<DataPermDO>> trees = new ArrayList<Tree<DataPermDO>>();
|
||||||
// 默认顶级菜单为0,根据数据库实际情况调整
|
List<DataPermDO> permDOs = dataPermDao.list(new HashMap<>(16));
|
||||||
Tree<DataPermDO> t = BuildTree.build(trees);
|
List<Long> permIds = roleDataPermDao.listPermIdByRoleId(roleId);
|
||||||
return t;
|
Map<String, String> topTree = new HashMap<>();
|
||||||
}
|
for (DataPermDO permDO : permDOs) {
|
||||||
|
Tree<DataPermDO> tree = new Tree<>();
|
||||||
|
tree.setId(permDO.getId().toString());
|
||||||
|
if (!topTree.containsKey(permDO.getModuleName())) {
|
||||||
|
Tree<DataPermDO> parentTree = new Tree<>();
|
||||||
|
String id = new IdWorker().nextId() + "";
|
||||||
|
parentTree.setId(id);
|
||||||
|
parentTree.setParentId(0 + "");
|
||||||
|
parentTree.setText(permDO.getModuleName());
|
||||||
|
topTree.put(permDO.getModuleName(), id);
|
||||||
|
trees.add(parentTree);
|
||||||
|
}
|
||||||
|
tree.setParentId(topTree.get(permDO.getModuleName()));
|
||||||
|
tree.setText(permDO.getName());
|
||||||
|
Map<String, Object> state = new HashMap<>(16);
|
||||||
|
if (permIds.contains(permDO.getId())) {
|
||||||
|
state.put("selected", true);
|
||||||
|
} else {
|
||||||
|
state.put("selected", false);
|
||||||
|
}
|
||||||
|
tree.setState(state);
|
||||||
|
trees.add(tree);
|
||||||
|
}
|
||||||
|
// 默认顶级菜单为0,根据数据库实际情况调整
|
||||||
|
Tree<DataPermDO> t = BuildTree.build(trees);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
package com.java2nb.system.service.impl;
|
package com.java2nb.system.service.impl;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import com.java2nb.common.config.Constant;
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
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.domain.Tree;
|
||||||
import com.java2nb.common.service.FileService;
|
import com.java2nb.common.service.FileService;
|
||||||
import com.java2nb.common.utils.*;
|
import com.java2nb.common.utils.*;
|
||||||
|
import com.java2nb.system.dao.DeptDao;
|
||||||
|
import com.java2nb.system.dao.SysUserDao;
|
||||||
|
import com.java2nb.system.dao.UserRoleDao;
|
||||||
|
import com.java2nb.system.domain.DeptDO;
|
||||||
|
import com.java2nb.system.domain.UserDO;
|
||||||
|
import com.java2nb.system.domain.UserRoleDO;
|
||||||
import com.java2nb.system.service.DeptService;
|
import com.java2nb.system.service.DeptService;
|
||||||
|
import com.java2nb.system.service.SysUserService;
|
||||||
import com.java2nb.system.vo.UserVO;
|
import com.java2nb.system.vo.UserVO;
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -16,22 +21,17 @@ import org.slf4j.LoggerFactory;
|
|||||||
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.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.java2nb.common.domain.Tree;
|
|
||||||
import com.java2nb.system.dao.DeptDao;
|
|
||||||
import com.java2nb.system.dao.SysUserDao;
|
|
||||||
import com.java2nb.system.dao.UserRoleDao;
|
|
||||||
import com.java2nb.system.domain.DeptDO;
|
|
||||||
import com.java2nb.system.domain.UserDO;
|
|
||||||
import com.java2nb.system.domain.UserRoleDO;
|
|
||||||
import com.java2nb.system.service.SysUserService;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Service
|
@Service
|
||||||
public class SysUserServiceImpl implements SysUserService {
|
public class SysUserServiceImpl implements SysUserService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
SysUserDao userMapper;
|
SysUserDao userMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -64,7 +64,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
List<Long> childIds = deptService.listChildrenIds(deptIdl);
|
List<Long> childIds = deptService.listChildrenIds(deptIdl);
|
||||||
childIds.add(deptIdl);
|
childIds.add(deptIdl);
|
||||||
map.put("deptId", null);
|
map.put("deptId", null);
|
||||||
map.put("deptIds",childIds);
|
map.put("deptIds", childIds);
|
||||||
}
|
}
|
||||||
return userMapper.listByPerm(map);
|
return userMapper.listByPerm(map);
|
||||||
}
|
}
|
||||||
@ -213,7 +213,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
public Map<String, Object> updatePersonalImg(MultipartFile file, String avatar_data, Long userId) throws Exception {
|
public Map<String, Object> updatePersonalImg(MultipartFile file, String avatar_data, Long userId) throws Exception {
|
||||||
String fileName = file.getOriginalFilename();
|
String fileName = file.getOriginalFilename();
|
||||||
fileName = FileUtil.renameToUUID(fileName);
|
fileName = FileUtil.renameToUUID(fileName);
|
||||||
FileDO sysFile = new FileDO(FileType.fileType(fileName), "/files/" + fileName, new Date());
|
FileDO sysFile = new FileDO(FileType.fileType(fileName), Constant.UPLOAD_FILES_PREFIX + fileName, new Date());
|
||||||
//获取图片后缀
|
//获取图片后缀
|
||||||
String prefix = fileName.substring((fileName.lastIndexOf(".") + 1));
|
String prefix = fileName.substring((fileName.lastIndexOf(".") + 1));
|
||||||
String[] str = avatar_data.split(",");
|
String[] str = avatar_data.split(",");
|
||||||
|
@ -10,7 +10,7 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
url: jdbc:mysql://127.0.0.1:3306/novel_plus?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: test123456
|
password: test123456
|
||||||
#password:
|
#password:
|
||||||
@ -39,7 +39,7 @@ spring:
|
|||||||
redis:
|
redis:
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 6379
|
port: 6379
|
||||||
password: test
|
password: test123456
|
||||||
# 连接超时时间(毫秒)
|
# 连接超时时间(毫秒)
|
||||||
timeout: 10000
|
timeout: 10000
|
||||||
jedis:
|
jedis:
|
||||||
@ -52,3 +52,47 @@ spring:
|
|||||||
max-active: 100
|
max-active: 100
|
||||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
max-wait: -1
|
max-wait: -1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
####使用shardingJdbc时,
|
||||||
|
####所有的jdbcType都不能是LONGVARCHAR,否则会导致java.io.NotSerializableException: java.io.StringReader错误
|
||||||
|
##### 应该替换所有的 LONGVARCHAR 类型为VARCHAR
|
||||||
|
|
||||||
|
sharding:
|
||||||
|
jdbc:
|
||||||
|
datasource:
|
||||||
|
names: ds0,ds1
|
||||||
|
ds0:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: test123456
|
||||||
|
ds1:
|
||||||
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driver-class-name: com.mysql.jdbc.Driver
|
||||||
|
url: jdbc:mysql://localhost:3306/information_schema?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: test123456
|
||||||
|
config:
|
||||||
|
sharding:
|
||||||
|
props:
|
||||||
|
sql.show: true
|
||||||
|
tables:
|
||||||
|
book_content: #book_content表
|
||||||
|
key-generator-column-name: id #主键
|
||||||
|
actual-data-nodes: ds${0}.book_content${0..9} #数据节点
|
||||||
|
# database-strategy: #分库策略
|
||||||
|
# inline:
|
||||||
|
# sharding-column: book_id
|
||||||
|
# algorithm-expression: ds${book_id % 10}
|
||||||
|
table-strategy: #分表策略
|
||||||
|
inline:
|
||||||
|
shardingColumn: index_id
|
||||||
|
algorithm-expression: book_content${index_id % 10}
|
||||||
|
tables:
|
||||||
|
actual-data-nodes: ds${1}.tables
|
||||||
|
columns:
|
||||||
|
actual-data-nodes: ds${1}.columns
|
||||||
|
default-data-source-name: ds0
|
@ -52,3 +52,41 @@ spring:
|
|||||||
max-active: 100
|
max-active: 100
|
||||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
max-wait: -1
|
max-wait: -1
|
||||||
|
|
||||||
|
|
||||||
|
####使用shardingJdbc时,
|
||||||
|
####所有的jdbcType都不能是LONGVARCHAR,否则会导致java.io.NotSerializableException: java.io.StringReader错误
|
||||||
|
##### 应该替换所有的 LONGVARCHAR 类型为VARCHAR
|
||||||
|
|
||||||
|
sharding:
|
||||||
|
jdbc:
|
||||||
|
datasource:
|
||||||
|
names: ds0 #,ds1
|
||||||
|
ds0:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: test123456
|
||||||
|
# ds1:
|
||||||
|
# type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
# driver-class-name: com.mysql.jdbc.Driver
|
||||||
|
# url: jdbc:mysql://localhost:3306/novel_plus2
|
||||||
|
# username: root
|
||||||
|
# password: test123456
|
||||||
|
config:
|
||||||
|
sharding:
|
||||||
|
props:
|
||||||
|
sql.show: true
|
||||||
|
tables:
|
||||||
|
book_content: #book_content表
|
||||||
|
key-generator-column-name: id #主键
|
||||||
|
actual-data-nodes: ds${0}.book_content${0..9} #数据节点
|
||||||
|
# database-strategy: #分库策略
|
||||||
|
# inline:
|
||||||
|
# sharding-column: book_id
|
||||||
|
# algorithm-expression: ds${book_id % 10}
|
||||||
|
table-strategy: #分表策略
|
||||||
|
inline:
|
||||||
|
shardingColumn: index_id
|
||||||
|
algorithm-expression: book_content${index_id % 10}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
server:
|
server:
|
||||||
session-timeout: 18000
|
session-timeout: 18000
|
||||||
# tomcat:
|
# tomcat:
|
||||||
# max-threads: 1000
|
# max-threads: 1000
|
||||||
# min-spare-threads: 30
|
# min-spare-threads: 30
|
||||||
port: 80
|
port: 80
|
||||||
# uri-encoding: utf-8
|
# uri-encoding: utf-8
|
||||||
#security:
|
#security:
|
||||||
@ -17,17 +17,18 @@ spring:
|
|||||||
date-format: yyyy-MM-dd HH:mm:ss
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: dev
|
||||||
|
|
||||||
|
#上传文件的最大值(10M)
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
max-file-size: 30Mb
|
max-file-size: 10485760
|
||||||
max-request-size: 30Mb
|
|
||||||
devtools:
|
devtools:
|
||||||
restart:
|
restart:
|
||||||
enabled: true
|
enabled: true
|
||||||
cache:
|
main:
|
||||||
type: ehcache
|
allow-bean-definition-overriding: true
|
||||||
ehcache:
|
|
||||||
config: classpath:ehcache.xml
|
|
||||||
mybatis:
|
mybatis:
|
||||||
configuration:
|
configuration:
|
||||||
#自动将数据库带下划线的表字段值映射到Java类的驼峰字段上
|
#自动将数据库带下划线的表字段值映射到Java类的驼峰字段上
|
||||||
|
@ -3,130 +3,140 @@
|
|||||||
|
|
||||||
<mapper namespace="com.java2nb.common.dao.DictDao">
|
<mapper namespace="com.java2nb.common.dao.DictDao">
|
||||||
|
|
||||||
<select id="get" resultType="com.java2nb.common.domain.DictDO">
|
<select id="get" resultType="com.java2nb.common.domain.DictDO">
|
||||||
select
|
select `id`,
|
||||||
`id`,`name`,`value`,`type`,`description`,`sort`,`parent_id`,`create_by`,`create_date`,`update_by`,`update_date`,`remarks`,`del_flag`
|
`name`,
|
||||||
from sys_dict where id = #{value}
|
`value`,
|
||||||
</select>
|
`type`,
|
||||||
|
`description`,
|
||||||
|
`sort`,
|
||||||
|
`parent_id`,
|
||||||
|
`create_by`,
|
||||||
|
`create_date`,
|
||||||
|
`update_by`,
|
||||||
|
`update_date`,
|
||||||
|
`remarks`,
|
||||||
|
`del_flag`
|
||||||
|
from sys_dict
|
||||||
|
where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="list" resultType="com.java2nb.common.domain.DictDO">
|
<select id="list" resultType="com.java2nb.common.domain.DictDO">
|
||||||
select
|
select
|
||||||
`id`,`name`,`value`,`type`,`description`,`sort`,`parent_id`,`create_by`,`create_date`,`update_by`,`update_date`,`remarks`,`del_flag`
|
`id`,`name`,`value`,`type`,`description`,`sort`,`parent_id`,`create_by`,`create_date`,`update_by`,`update_date`,`remarks`,`del_flag`
|
||||||
from sys_dict
|
from sys_dict
|
||||||
<where>
|
<where>
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
<if test="name != null and name != ''">and name = #{name}</if>
|
||||||
<if test="value != null and value != ''"> and value = #{value} </if>
|
<if test="value != null and value != ''">and value = #{value}</if>
|
||||||
<if test="type != null and type != ''"> and type = #{type} </if>
|
<if test="type != null and type != ''">and type = #{type}</if>
|
||||||
<if test="description != null and description != ''"> and description = #{description} </if>
|
<if test="description != null and description != ''">and description = #{description}</if>
|
||||||
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
|
<if test="sort != null and sort != ''">and sort = #{sort}</if>
|
||||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||||
<if test="createBy != null and createBy != ''"> and create_by = #{createBy} </if>
|
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
|
||||||
<if test="createDate != null and createDate != ''"> and create_date = #{createDate} </if>
|
<if test="createDate != null and createDate != ''">and create_date = #{createDate}</if>
|
||||||
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy} </if>
|
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
|
||||||
<if test="updateDate != null and updateDate != ''"> and update_date = #{updateDate} </if>
|
<if test="updateDate != null and updateDate != ''">and update_date = #{updateDate}</if>
|
||||||
<if test="remarks != null and remarks != ''"> and remarks = #{remarks} </if>
|
<if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
|
||||||
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
|
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
|
||||||
</where>
|
</where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="sort != null and sort.trim() != ''">
|
<when test="sort != null and sort.trim() != ''">
|
||||||
order by ${sort} ${order}
|
order by ${sort} ${order}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
order by id desc
|
order by id desc
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="offset != null and limit != null">
|
<if test="offset != null and limit != null">
|
||||||
limit #{offset}, #{limit}
|
limit #{offset}, #{limit}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="count" resultType="int">
|
<select id="count" resultType="int">
|
||||||
select count(*) from sys_dict
|
select count(*) from sys_dict
|
||||||
<where>
|
<where>
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
<if test="name != null and name != ''">and name = #{name}</if>
|
||||||
<if test="value != null and value != ''"> and value = #{value} </if>
|
<if test="value != null and value != ''">and value = #{value}</if>
|
||||||
<if test="type != null and type != ''"> and type = #{type} </if>
|
<if test="type != null and type != ''">and type = #{type}</if>
|
||||||
<if test="description != null and description != ''"> and description = #{description} </if>
|
<if test="description != null and description != ''">and description = #{description}</if>
|
||||||
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
|
<if test="sort != null and sort != ''">and sort = #{sort}</if>
|
||||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||||
<if test="createBy != null and createBy != ''"> and create_by = #{createBy} </if>
|
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
|
||||||
<if test="createDate != null and createDate != ''"> and create_date = #{createDate} </if>
|
<if test="createDate != null and createDate != ''">and create_date = #{createDate}</if>
|
||||||
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy} </if>
|
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
|
||||||
<if test="updateDate != null and updateDate != ''"> and update_date = #{updateDate} </if>
|
<if test="updateDate != null and updateDate != ''">and update_date = #{updateDate}</if>
|
||||||
<if test="remarks != null and remarks != ''"> and remarks = #{remarks} </if>
|
<if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
|
||||||
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
|
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="save" parameterType="com.java2nb.common.domain.DictDO"
|
<insert id="save" parameterType="com.java2nb.common.domain.DictDO"
|
||||||
useGeneratedKeys="true" keyProperty="id">
|
useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into sys_dict
|
insert into sys_dict
|
||||||
(
|
(`name`,
|
||||||
`name`,
|
`value`,
|
||||||
`value`,
|
`type`,
|
||||||
`type`,
|
`description`,
|
||||||
`description`,
|
`sort`,
|
||||||
`sort`,
|
`parent_id`,
|
||||||
`parent_id`,
|
`create_by`,
|
||||||
`create_by`,
|
`create_date`,
|
||||||
`create_date`,
|
`update_by`,
|
||||||
`update_by`,
|
`update_date`,
|
||||||
`update_date`,
|
`remarks`,
|
||||||
`remarks`,
|
`del_flag`)
|
||||||
`del_flag`
|
values (#{name},
|
||||||
)
|
#{value},
|
||||||
values
|
#{type},
|
||||||
(
|
#{description},
|
||||||
#{name},
|
#{sort},
|
||||||
#{value},
|
#{parentId},
|
||||||
#{type},
|
#{createBy},
|
||||||
#{description},
|
#{createDate},
|
||||||
#{sort},
|
#{updateBy},
|
||||||
#{parentId},
|
#{updateDate},
|
||||||
#{createBy},
|
#{remarks},
|
||||||
#{createDate},
|
#{delFlag})
|
||||||
#{updateBy},
|
</insert>
|
||||||
#{updateDate},
|
|
||||||
#{remarks},
|
|
||||||
#{delFlag}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.java2nb.common.domain.DictDO">
|
<update id="update" parameterType="com.java2nb.common.domain.DictDO">
|
||||||
update sys_dict
|
update sys_dict
|
||||||
<set>
|
<set>
|
||||||
<if test="name != null">`name` = #{name}, </if>
|
<if test="name != null">`name` = #{name},</if>
|
||||||
<if test="value != null">`value` = #{value}, </if>
|
<if test="value != null">`value` = #{value},</if>
|
||||||
<if test="type != null">`type` = #{type}, </if>
|
<if test="type != null">`type` = #{type},</if>
|
||||||
<if test="description != null">`description` = #{description}, </if>
|
<if test="description != null">`description` = #{description},</if>
|
||||||
<if test="sort != null">`sort` = #{sort}, </if>
|
<if test="sort != null">`sort` = #{sort},</if>
|
||||||
<if test="parentId != null">`parent_id` = #{parentId}, </if>
|
<if test="parentId != null">`parent_id` = #{parentId},</if>
|
||||||
<if test="createBy != null">`create_by` = #{createBy}, </if>
|
<if test="createBy != null">`create_by` = #{createBy},</if>
|
||||||
<if test="createDate != null">`create_date` = #{createDate}, </if>
|
<if test="createDate != null">`create_date` = #{createDate},</if>
|
||||||
<if test="updateBy != null">`update_by` = #{updateBy}, </if>
|
<if test="updateBy != null">`update_by` = #{updateBy},</if>
|
||||||
<if test="updateDate != null">`update_date` = #{updateDate}, </if>
|
<if test="updateDate != null">`update_date` = #{updateDate},</if>
|
||||||
<if test="remarks != null">`remarks` = #{remarks}, </if>
|
<if test="remarks != null">`remarks` = #{remarks},</if>
|
||||||
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
|
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="remove">
|
<delete id="remove">
|
||||||
delete from sys_dict where id = #{value}
|
delete
|
||||||
</delete>
|
from sys_dict
|
||||||
|
where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<delete id="batchRemove">
|
<delete id="batchRemove">
|
||||||
delete from sys_dict where id in
|
delete from sys_dict where id in
|
||||||
<foreach item="id" collection="array" open="(" separator=","
|
<foreach item="id" collection="array" open="(" separator=","
|
||||||
close=")">
|
close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="listType" resultType="com.java2nb.common.domain.DictDO">
|
<select id="listType" resultType="com.java2nb.common.domain.DictDO">
|
||||||
select distinct `type` , description from sys_dict
|
select `type`, description
|
||||||
</select>
|
from sys_dict
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.BookCommentDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.BookCommentDO">
|
||||||
|
select `id`,`book_id`,`comment_content`,`reply_count`,`audit_status`,`create_time`,`create_user_id` from book_comment where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.BookCommentDO">
|
||||||
|
select `id`,`book_id`,`comment_content`,`reply_count`,`audit_status`,`create_time`,`create_user_id` from book_comment
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="bookId != null and bookId != ''"> and book_id = #{bookId} </if>
|
||||||
|
<if test="commentContent != null and commentContent != ''"> and comment_content = #{commentContent} </if>
|
||||||
|
<if test="replyCount != null and replyCount != ''"> and reply_count = #{replyCount} </if>
|
||||||
|
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from book_comment
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="bookId != null and bookId != ''"> and book_id = #{bookId} </if>
|
||||||
|
<if test="commentContent != null and commentContent != ''"> and comment_content = #{commentContent} </if>
|
||||||
|
<if test="replyCount != null and replyCount != ''"> and reply_count = #{replyCount} </if>
|
||||||
|
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.BookCommentDO">
|
||||||
|
insert into book_comment
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`book_id`,
|
||||||
|
`comment_content`,
|
||||||
|
`reply_count`,
|
||||||
|
`audit_status`,
|
||||||
|
`create_time`,
|
||||||
|
`create_user_id`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{bookId},
|
||||||
|
#{commentContent},
|
||||||
|
#{replyCount},
|
||||||
|
#{auditStatus},
|
||||||
|
#{createTime},
|
||||||
|
#{createUserId}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookCommentDO">
|
||||||
|
insert into book_comment
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="bookId != null"> `book_id`, </if>
|
||||||
|
<if test="commentContent != null"> `comment_content`, </if>
|
||||||
|
<if test="replyCount != null"> `reply_count`, </if>
|
||||||
|
<if test="auditStatus != null"> `audit_status`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="createUserId != null"> `create_user_id` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="bookId != null"> #{bookId}, </if>
|
||||||
|
<if test="commentContent != null"> #{commentContent}, </if>
|
||||||
|
<if test="replyCount != null"> #{replyCount}, </if>
|
||||||
|
<if test="auditStatus != null"> #{auditStatus}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="createUserId != null"> #{createUserId} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.BookCommentDO">
|
||||||
|
update book_comment
|
||||||
|
<set>
|
||||||
|
<if test="bookId != null">`book_id` = #{bookId}, </if>
|
||||||
|
<if test="commentContent != null">`comment_content` = #{commentContent}, </if>
|
||||||
|
<if test="replyCount != null">`reply_count` = #{replyCount}, </if>
|
||||||
|
<if test="auditStatus != null">`audit_status` = #{auditStatus}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="createUserId != null">`create_user_id` = #{createUserId}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from book_comment where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from book_comment where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.BookContentDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.BookContentDO">
|
||||||
|
select `id`, `index_id`, `content`
|
||||||
|
from book_content
|
||||||
|
where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.BookContentDO">
|
||||||
|
select `id`,`index_id`,`content` from book_content
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
|
<if test="indexId != null and indexId != ''">and index_id = #{indexId}</if>
|
||||||
|
<if test="content != null and content != ''">and content = #{content}</if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from book_content
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
|
<if test="indexId != null and indexId != ''">and index_id = #{indexId}</if>
|
||||||
|
<if test="content != null and content != ''">and content = #{content}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.BookContentDO">
|
||||||
|
insert into book_content
|
||||||
|
(`id`,
|
||||||
|
`index_id`,
|
||||||
|
`content`)
|
||||||
|
values (#{id},
|
||||||
|
#{indexId},
|
||||||
|
#{content})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookContentDO">
|
||||||
|
insert into book_content
|
||||||
|
(
|
||||||
|
<if test="id != null">`id`,</if>
|
||||||
|
<if test="indexId != null">`index_id`,</if>
|
||||||
|
<if test="content != null">`content`</if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="indexId != null">#{indexId},</if>
|
||||||
|
<if test="content != null">#{content}</if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.BookContentDO">
|
||||||
|
update book_content
|
||||||
|
<set>
|
||||||
|
<if test="indexId != null">`index_id` = #{indexId},</if>
|
||||||
|
<if test="content != null">`content` = #{content}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete
|
||||||
|
from book_content
|
||||||
|
where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from book_content where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
<delete id="removeByIndexIds">
|
||||||
|
delete from book_content where index_id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
153
novel-admin/src/main/resources/mybatis/novel/BookIndexMapper.xml
Normal file
153
novel-admin/src/main/resources/mybatis/novel/BookIndexMapper.xml
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.BookIndexDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.BookIndexDO">
|
||||||
|
select `id`,
|
||||||
|
`book_id`,
|
||||||
|
`index_num`,
|
||||||
|
`index_name`,
|
||||||
|
`word_count`,
|
||||||
|
`is_vip`,
|
||||||
|
`book_price`,
|
||||||
|
`storage_type`,
|
||||||
|
`create_time`,
|
||||||
|
`update_time`
|
||||||
|
from book_index
|
||||||
|
where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.BookIndexDO">
|
||||||
|
select
|
||||||
|
`id`,`book_id`,`index_num`,`index_name`,`word_count`,`is_vip`,`book_price`,`storage_type`,`create_time`,`update_time`
|
||||||
|
from book_index
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
|
<if test="bookId != null and bookId != ''">and book_id = #{bookId}</if>
|
||||||
|
<if test="indexNum != null and indexNum != ''">and index_num = #{indexNum}</if>
|
||||||
|
<if test="indexName != null and indexName != ''">and index_name = #{indexName}</if>
|
||||||
|
<if test="wordCount != null and wordCount != ''">and word_count = #{wordCount}</if>
|
||||||
|
<if test="isVip != null and isVip != ''">and is_vip = #{isVip}</if>
|
||||||
|
<if test="bookPrice != null and bookPrice != ''">and book_price = #{bookPrice}</if>
|
||||||
|
<if test="storageType != null and storageType != ''">and storage_type = #{storageType}</if>
|
||||||
|
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from book_index
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
|
<if test="bookId != null and bookId != ''">and book_id = #{bookId}</if>
|
||||||
|
<if test="indexNum != null and indexNum != ''">and index_num = #{indexNum}</if>
|
||||||
|
<if test="indexName != null and indexName != ''">and index_name = #{indexName}</if>
|
||||||
|
<if test="wordCount != null and wordCount != ''">and word_count = #{wordCount}</if>
|
||||||
|
<if test="isVip != null and isVip != ''">and is_vip = #{isVip}</if>
|
||||||
|
<if test="bookPrice != null and bookPrice != ''">and book_price = #{bookPrice}</if>
|
||||||
|
<if test="storageType != null and storageType != ''">and storage_type = #{storageType}</if>
|
||||||
|
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="getIdsByBookId" resultType="java.lang.Long">
|
||||||
|
select id
|
||||||
|
from book_index
|
||||||
|
where book_id = #{bookId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.BookIndexDO">
|
||||||
|
insert into book_index
|
||||||
|
(`id`,
|
||||||
|
`book_id`,
|
||||||
|
`index_num`,
|
||||||
|
`index_name`,
|
||||||
|
`word_count`,
|
||||||
|
`is_vip`,
|
||||||
|
`book_price`,
|
||||||
|
`storage_type`,
|
||||||
|
`create_time`,
|
||||||
|
`update_time`)
|
||||||
|
values (#{id},
|
||||||
|
#{bookId},
|
||||||
|
#{indexNum},
|
||||||
|
#{indexName},
|
||||||
|
#{wordCount},
|
||||||
|
#{isVip},
|
||||||
|
#{bookPrice},
|
||||||
|
#{storageType},
|
||||||
|
#{createTime},
|
||||||
|
#{updateTime})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookIndexDO">
|
||||||
|
insert into book_index
|
||||||
|
(
|
||||||
|
<if test="id != null">`id`,</if>
|
||||||
|
<if test="bookId != null">`book_id`,</if>
|
||||||
|
<if test="indexNum != null">`index_num`,</if>
|
||||||
|
<if test="indexName != null">`index_name`,</if>
|
||||||
|
<if test="wordCount != null">`word_count`,</if>
|
||||||
|
<if test="isVip != null">`is_vip`,</if>
|
||||||
|
<if test="bookPrice != null">`book_price`,</if>
|
||||||
|
<if test="storageType != null">`storage_type`,</if>
|
||||||
|
<if test="createTime != null">`create_time`,</if>
|
||||||
|
<if test="updateTime != null">`update_time`</if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="bookId != null">#{bookId},</if>
|
||||||
|
<if test="indexNum != null">#{indexNum},</if>
|
||||||
|
<if test="indexName != null">#{indexName},</if>
|
||||||
|
<if test="wordCount != null">#{wordCount},</if>
|
||||||
|
<if test="isVip != null">#{isVip},</if>
|
||||||
|
<if test="bookPrice != null">#{bookPrice},</if>
|
||||||
|
<if test="storageType != null">#{storageType},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime}</if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.BookIndexDO">
|
||||||
|
update book_index
|
||||||
|
<set>
|
||||||
|
<if test="bookId != null">`book_id` = #{bookId},</if>
|
||||||
|
<if test="indexNum != null">`index_num` = #{indexNum},</if>
|
||||||
|
<if test="indexName != null">`index_name` = #{indexName},</if>
|
||||||
|
<if test="wordCount != null">`word_count` = #{wordCount},</if>
|
||||||
|
<if test="isVip != null">`is_vip` = #{isVip},</if>
|
||||||
|
<if test="bookPrice != null">`book_price` = #{bookPrice},</if>
|
||||||
|
<if test="storageType != null">`storage_type` = #{storageType},</if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime},</if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete
|
||||||
|
from book_index
|
||||||
|
where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from book_index where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -3,304 +3,295 @@
|
|||||||
|
|
||||||
<mapper namespace="com.java2nb.novel.dao.BookDao">
|
<mapper namespace="com.java2nb.novel.dao.BookDao">
|
||||||
|
|
||||||
<select id="get" resultType="com.java2nb.novel.domain.BookDO">
|
<select id="get" resultType="com.java2nb.novel.domain.BookDO">
|
||||||
select `id`,`work_direction`,`cat_id`,`cat_name`,`cat_child_id`,`cat_child_name`,`pic_url`,`book_name`,`hero_name`,`lady_name`,`book_style`,`book_label`,`author_id`,`author_name`,`book_desc`,`score`,`book_status`,`visit_count`,`word_count`,`comment_count`,`yesterday_buy`,`last_index_id`,`last_index_name`,`last_index_update_time`,`is_vip`,`status`,`update_time`,`create_time`,`crawl_source_id`,`crawl_book_id`,`crawl_last_time`,`crawl_is_stop` from book where id = #{value}
|
select `id`,
|
||||||
</select>
|
`work_direction`,
|
||||||
|
`cat_id`,
|
||||||
|
`cat_name`,
|
||||||
|
`pic_url`,
|
||||||
|
`book_name`,
|
||||||
|
`author_id`,
|
||||||
|
`author_name`,
|
||||||
|
`book_desc`,
|
||||||
|
`score`,
|
||||||
|
`book_status`,
|
||||||
|
`visit_count`,
|
||||||
|
`word_count`,
|
||||||
|
`comment_count`,
|
||||||
|
`yesterday_buy`,
|
||||||
|
`last_index_id`,
|
||||||
|
`last_index_name`,
|
||||||
|
`last_index_update_time`,
|
||||||
|
`is_vip`,
|
||||||
|
`status`,
|
||||||
|
`update_time`,
|
||||||
|
`create_time`,
|
||||||
|
`crawl_source_id`,
|
||||||
|
`crawl_book_id`,
|
||||||
|
`crawl_last_time`,
|
||||||
|
`crawl_is_stop`
|
||||||
|
from book
|
||||||
|
where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="list" resultType="com.java2nb.novel.domain.BookDO">
|
<select id="list" resultType="com.java2nb.novel.domain.BookDO">
|
||||||
select `id`,`work_direction`,`cat_id`,`cat_name`,`cat_child_id`,`cat_child_name`,`pic_url`,`book_name`,`hero_name`,`lady_name`,`book_style`,`book_label`,`author_id`,`author_name`,`book_desc`,`score`,`book_status`,`visit_count`,`word_count`,`comment_count`,`yesterday_buy`,`last_index_id`,`last_index_name`,`last_index_update_time`,`is_vip`,`status`,`update_time`,`create_time`,`crawl_source_id`,`crawl_book_id`,`crawl_last_time`,`crawl_is_stop` from book
|
select
|
||||||
|
`id`,`work_direction`,`cat_id`,`cat_name`,`pic_url`,`book_name`,`author_id`,`author_name`,`book_desc`,`score`,`book_status`,`visit_count`,`word_count`,`comment_count`,`yesterday_buy`,`last_index_id`,`last_index_name`,`last_index_update_time`,`is_vip`,`status`,`update_time`,`create_time`,`crawl_source_id`,`crawl_book_id`,`crawl_last_time`,`crawl_is_stop`
|
||||||
|
from book
|
||||||
<where>
|
<where>
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="workDirection != null and workDirection != ''"> and work_direction = #{workDirection} </if>
|
<if test="workDirection != null and workDirection != ''">and work_direction = #{workDirection}</if>
|
||||||
<if test="catId != null and catId != ''"> and cat_id = #{catId} </if>
|
<if test="catId != null and catId != ''">and cat_id = #{catId}</if>
|
||||||
<if test="catName != null and catName != ''"> and cat_name = #{catName} </if>
|
<if test="catName != null and catName != ''">and cat_name = #{catName}</if>
|
||||||
<if test="catChildId != null and catChildId != ''"> and cat_child_id = #{catChildId} </if>
|
<if test="picUrl != null and picUrl != ''">and pic_url = #{picUrl}</if>
|
||||||
<if test="catChildName != null and catChildName != ''"> and cat_child_name = #{catChildName} </if>
|
<if test="bookName != null and bookName != ''">and book_name = #{bookName}</if>
|
||||||
<if test="picUrl != null and picUrl != ''"> and pic_url = #{picUrl} </if>
|
<if test="authorId != null and authorId != ''">and author_id = #{authorId}</if>
|
||||||
<if test="bookName != null and bookName != ''"> and book_name = #{bookName} </if>
|
<if test="authorName != null and authorName != ''">and author_name = #{authorName}</if>
|
||||||
<if test="heroName != null and heroName != ''"> and hero_name = #{heroName} </if>
|
<if test="bookDesc != null and bookDesc != ''">and book_desc = #{bookDesc}</if>
|
||||||
<if test="ladyName != null and ladyName != ''"> and lady_name = #{ladyName} </if>
|
<if test="score != null and score != ''">and score = #{score}</if>
|
||||||
<if test="bookStyle != null and bookStyle != ''"> and book_style = #{bookStyle} </if>
|
<if test="bookStatus != null and bookStatus != ''">and book_status = #{bookStatus}</if>
|
||||||
<if test="bookLabel != null and bookLabel != ''"> and book_label = #{bookLabel} </if>
|
<if test="visitCount != null and visitCount != ''">and visit_count = #{visitCount}</if>
|
||||||
<if test="authorId != null and authorId != ''"> and author_id = #{authorId} </if>
|
<if test="wordCount != null and wordCount != ''">and word_count = #{wordCount}</if>
|
||||||
<if test="authorName != null and authorName != ''"> and author_name = #{authorName} </if>
|
<if test="commentCount != null and commentCount != ''">and comment_count = #{commentCount}</if>
|
||||||
<if test="bookDesc != null and bookDesc != ''"> and book_desc = #{bookDesc} </if>
|
<if test="yesterdayBuy != null and yesterdayBuy != ''">and yesterday_buy = #{yesterdayBuy}</if>
|
||||||
<if test="score != null and score != ''"> and score = #{score} </if>
|
<if test="lastIndexId != null and lastIndexId != ''">and last_index_id = #{lastIndexId}</if>
|
||||||
<if test="bookStatus != null and bookStatus != ''"> and book_status = #{bookStatus} </if>
|
<if test="lastIndexName != null and lastIndexName != ''">and last_index_name = #{lastIndexName}</if>
|
||||||
<if test="visitCount != null and visitCount != ''"> and visit_count = #{visitCount} </if>
|
<if test="lastIndexUpdateTime != null and lastIndexUpdateTime != ''">and last_index_update_time =
|
||||||
<if test="wordCount != null and wordCount != ''"> and word_count = #{wordCount} </if>
|
#{lastIndexUpdateTime}
|
||||||
<if test="commentCount != null and commentCount != ''"> and comment_count = #{commentCount} </if>
|
</if>
|
||||||
<if test="yesterdayBuy != null and yesterdayBuy != ''"> and yesterday_buy = #{yesterdayBuy} </if>
|
<if test="isVip != null and isVip != ''">and is_vip = #{isVip}</if>
|
||||||
<if test="lastIndexId != null and lastIndexId != ''"> and last_index_id = #{lastIndexId} </if>
|
<if test="status != null and status != ''">and status = #{status}</if>
|
||||||
<if test="lastIndexName != null and lastIndexName != ''"> and last_index_name = #{lastIndexName} </if>
|
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if>
|
||||||
<if test="lastIndexUpdateTime != null and lastIndexUpdateTime != ''"> and last_index_update_time = #{lastIndexUpdateTime} </if>
|
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</if>
|
||||||
<if test="isVip != null and isVip != ''"> and is_vip = #{isVip} </if>
|
<if test="crawlSourceId != null and crawlSourceId != ''">and crawl_source_id = #{crawlSourceId}</if>
|
||||||
<if test="status != null and status != ''"> and status = #{status} </if>
|
<if test="crawlBookId != null and crawlBookId != ''">and crawl_book_id = #{crawlBookId}</if>
|
||||||
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
<if test="crawlLastTime != null and crawlLastTime != ''">and crawl_last_time = #{crawlLastTime}</if>
|
||||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
<if test="crawlIsStop != null and crawlIsStop != ''">and crawl_is_stop = #{crawlIsStop}</if>
|
||||||
<if test="crawlSourceId != null and crawlSourceId != ''"> and crawl_source_id = #{crawlSourceId} </if>
|
</where>
|
||||||
<if test="crawlBookId != null and crawlBookId != ''"> and crawl_book_id = #{crawlBookId} </if>
|
|
||||||
<if test="crawlLastTime != null and crawlLastTime != ''"> and crawl_last_time = #{crawlLastTime} </if>
|
|
||||||
<if test="crawlIsStop != null and crawlIsStop != ''"> and crawl_is_stop = #{crawlIsStop} </if>
|
|
||||||
</where>
|
|
||||||
<choose>
|
<choose>
|
||||||
<when test="sort != null and sort.trim() != ''">
|
<when test="sort != null and sort.trim() != ''">
|
||||||
order by ${sort} ${order}
|
order by ${sort} ${order}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
order by id desc
|
order by id desc
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="offset != null and limit != null">
|
<if test="offset != null and limit != null">
|
||||||
limit #{offset}, #{limit}
|
limit #{offset}, #{limit}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="count" resultType="int">
|
<select id="count" resultType="int">
|
||||||
select count(*) from book
|
select count(*) from book
|
||||||
<where>
|
<where>
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="workDirection != null and workDirection != ''"> and work_direction = #{workDirection} </if>
|
<if test="workDirection != null and workDirection != ''">and work_direction = #{workDirection}</if>
|
||||||
<if test="catId != null and catId != ''"> and cat_id = #{catId} </if>
|
<if test="catId != null and catId != ''">and cat_id = #{catId}</if>
|
||||||
<if test="catName != null and catName != ''"> and cat_name = #{catName} </if>
|
<if test="catName != null and catName != ''">and cat_name = #{catName}</if>
|
||||||
<if test="catChildId != null and catChildId != ''"> and cat_child_id = #{catChildId} </if>
|
<if test="picUrl != null and picUrl != ''">and pic_url = #{picUrl}</if>
|
||||||
<if test="catChildName != null and catChildName != ''"> and cat_child_name = #{catChildName} </if>
|
<if test="bookName != null and bookName != ''">and book_name = #{bookName}</if>
|
||||||
<if test="picUrl != null and picUrl != ''"> and pic_url = #{picUrl} </if>
|
<if test="authorId != null and authorId != ''">and author_id = #{authorId}</if>
|
||||||
<if test="bookName != null and bookName != ''"> and book_name = #{bookName} </if>
|
<if test="authorName != null and authorName != ''">and author_name = #{authorName}</if>
|
||||||
<if test="heroName != null and heroName != ''"> and hero_name = #{heroName} </if>
|
<if test="bookDesc != null and bookDesc != ''">and book_desc = #{bookDesc}</if>
|
||||||
<if test="ladyName != null and ladyName != ''"> and lady_name = #{ladyName} </if>
|
<if test="score != null and score != ''">and score = #{score}</if>
|
||||||
<if test="bookStyle != null and bookStyle != ''"> and book_style = #{bookStyle} </if>
|
<if test="bookStatus != null and bookStatus != ''">and book_status = #{bookStatus}</if>
|
||||||
<if test="bookLabel != null and bookLabel != ''"> and book_label = #{bookLabel} </if>
|
<if test="visitCount != null and visitCount != ''">and visit_count = #{visitCount}</if>
|
||||||
<if test="authorId != null and authorId != ''"> and author_id = #{authorId} </if>
|
<if test="wordCount != null and wordCount != ''">and word_count = #{wordCount}</if>
|
||||||
<if test="authorName != null and authorName != ''"> and author_name = #{authorName} </if>
|
<if test="commentCount != null and commentCount != ''">and comment_count = #{commentCount}</if>
|
||||||
<if test="bookDesc != null and bookDesc != ''"> and book_desc = #{bookDesc} </if>
|
<if test="yesterdayBuy != null and yesterdayBuy != ''">and yesterday_buy = #{yesterdayBuy}</if>
|
||||||
<if test="score != null and score != ''"> and score = #{score} </if>
|
<if test="lastIndexId != null and lastIndexId != ''">and last_index_id = #{lastIndexId}</if>
|
||||||
<if test="bookStatus != null and bookStatus != ''"> and book_status = #{bookStatus} </if>
|
<if test="lastIndexName != null and lastIndexName != ''">and last_index_name = #{lastIndexName}</if>
|
||||||
<if test="visitCount != null and visitCount != ''"> and visit_count = #{visitCount} </if>
|
<if test="lastIndexUpdateTime != null and lastIndexUpdateTime != ''">and last_index_update_time =
|
||||||
<if test="wordCount != null and wordCount != ''"> and word_count = #{wordCount} </if>
|
#{lastIndexUpdateTime}
|
||||||
<if test="commentCount != null and commentCount != ''"> and comment_count = #{commentCount} </if>
|
</if>
|
||||||
<if test="yesterdayBuy != null and yesterdayBuy != ''"> and yesterday_buy = #{yesterdayBuy} </if>
|
<if test="isVip != null and isVip != ''">and is_vip = #{isVip}</if>
|
||||||
<if test="lastIndexId != null and lastIndexId != ''"> and last_index_id = #{lastIndexId} </if>
|
<if test="status != null and status != ''">and status = #{status}</if>
|
||||||
<if test="lastIndexName != null and lastIndexName != ''"> and last_index_name = #{lastIndexName} </if>
|
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if>
|
||||||
<if test="lastIndexUpdateTime != null and lastIndexUpdateTime != ''"> and last_index_update_time = #{lastIndexUpdateTime} </if>
|
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</if>
|
||||||
<if test="isVip != null and isVip != ''"> and is_vip = #{isVip} </if>
|
<if test="crawlSourceId != null and crawlSourceId != ''">and crawl_source_id = #{crawlSourceId}</if>
|
||||||
<if test="status != null and status != ''"> and status = #{status} </if>
|
<if test="crawlBookId != null and crawlBookId != ''">and crawl_book_id = #{crawlBookId}</if>
|
||||||
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
<if test="crawlLastTime != null and crawlLastTime != ''">and crawl_last_time = #{crawlLastTime}</if>
|
||||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
<if test="crawlIsStop != null and crawlIsStop != ''">and crawl_is_stop = #{crawlIsStop}</if>
|
||||||
<if test="crawlSourceId != null and crawlSourceId != ''"> and crawl_source_id = #{crawlSourceId} </if>
|
</where>
|
||||||
<if test="crawlBookId != null and crawlBookId != ''"> and crawl_book_id = #{crawlBookId} </if>
|
</select>
|
||||||
<if test="crawlLastTime != null and crawlLastTime != ''"> and crawl_last_time = #{crawlLastTime} </if>
|
|
||||||
<if test="crawlIsStop != null and crawlIsStop != ''"> and crawl_is_stop = #{crawlIsStop} </if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="save" parameterType="com.java2nb.novel.domain.BookDO">
|
<insert id="save" parameterType="com.java2nb.novel.domain.BookDO">
|
||||||
insert into book
|
insert into book
|
||||||
(
|
(`id`,
|
||||||
`id`,
|
`work_direction`,
|
||||||
`work_direction`,
|
`cat_id`,
|
||||||
`cat_id`,
|
`cat_name`,
|
||||||
`cat_name`,
|
`pic_url`,
|
||||||
`cat_child_id`,
|
`book_name`,
|
||||||
`cat_child_name`,
|
`author_id`,
|
||||||
`pic_url`,
|
`author_name`,
|
||||||
`book_name`,
|
`book_desc`,
|
||||||
`hero_name`,
|
`score`,
|
||||||
`lady_name`,
|
`book_status`,
|
||||||
`book_style`,
|
`visit_count`,
|
||||||
`book_label`,
|
`word_count`,
|
||||||
`author_id`,
|
`comment_count`,
|
||||||
`author_name`,
|
`yesterday_buy`,
|
||||||
`book_desc`,
|
`last_index_id`,
|
||||||
`score`,
|
`last_index_name`,
|
||||||
`book_status`,
|
`last_index_update_time`,
|
||||||
`visit_count`,
|
`is_vip`,
|
||||||
`word_count`,
|
`status`,
|
||||||
`comment_count`,
|
`update_time`,
|
||||||
`yesterday_buy`,
|
`create_time`,
|
||||||
`last_index_id`,
|
`crawl_source_id`,
|
||||||
`last_index_name`,
|
`crawl_book_id`,
|
||||||
`last_index_update_time`,
|
`crawl_last_time`,
|
||||||
`is_vip`,
|
`crawl_is_stop`)
|
||||||
`status`,
|
values (#{id},
|
||||||
`update_time`,
|
#{workDirection},
|
||||||
`create_time`,
|
#{catId},
|
||||||
`crawl_source_id`,
|
#{catName},
|
||||||
`crawl_book_id`,
|
#{picUrl},
|
||||||
`crawl_last_time`,
|
#{bookName},
|
||||||
`crawl_is_stop`
|
#{authorId},
|
||||||
)
|
#{authorName},
|
||||||
values
|
#{bookDesc},
|
||||||
(
|
#{score},
|
||||||
#{id},
|
#{bookStatus},
|
||||||
#{workDirection},
|
#{visitCount},
|
||||||
#{catId},
|
#{wordCount},
|
||||||
#{catName},
|
#{commentCount},
|
||||||
#{catChildId},
|
#{yesterdayBuy},
|
||||||
#{catChildName},
|
#{lastIndexId},
|
||||||
#{picUrl},
|
#{lastIndexName},
|
||||||
#{bookName},
|
#{lastIndexUpdateTime},
|
||||||
#{heroName},
|
#{isVip},
|
||||||
#{ladyName},
|
#{status},
|
||||||
#{bookStyle},
|
#{updateTime},
|
||||||
#{bookLabel},
|
#{createTime},
|
||||||
#{authorId},
|
#{crawlSourceId},
|
||||||
#{authorName},
|
#{crawlBookId},
|
||||||
#{bookDesc},
|
#{crawlLastTime},
|
||||||
#{score},
|
#{crawlIsStop})
|
||||||
#{bookStatus},
|
</insert>
|
||||||
#{visitCount},
|
|
||||||
#{wordCount},
|
|
||||||
#{commentCount},
|
|
||||||
#{yesterdayBuy},
|
|
||||||
#{lastIndexId},
|
|
||||||
#{lastIndexName},
|
|
||||||
#{lastIndexUpdateTime},
|
|
||||||
#{isVip},
|
|
||||||
#{status},
|
|
||||||
#{updateTime},
|
|
||||||
#{createTime},
|
|
||||||
#{crawlSourceId},
|
|
||||||
#{crawlBookId},
|
|
||||||
#{crawlLastTime},
|
|
||||||
#{crawlIsStop}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookDO">
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookDO">
|
||||||
insert into book
|
insert into book
|
||||||
(
|
(
|
||||||
<if test="id != null"> `id`, </if>
|
<if test="id != null">`id`,</if>
|
||||||
<if test="workDirection != null"> `work_direction`, </if>
|
<if test="workDirection != null">`work_direction`,</if>
|
||||||
<if test="catId != null"> `cat_id`, </if>
|
<if test="catId != null">`cat_id`,</if>
|
||||||
<if test="catName != null"> `cat_name`, </if>
|
<if test="catName != null">`cat_name`,</if>
|
||||||
<if test="catChildId != null"> `cat_child_id`, </if>
|
<if test="picUrl != null">`pic_url`,</if>
|
||||||
<if test="catChildName != null"> `cat_child_name`, </if>
|
<if test="bookName != null">`book_name`,</if>
|
||||||
<if test="picUrl != null"> `pic_url`, </if>
|
<if test="authorId != null">`author_id`,</if>
|
||||||
<if test="bookName != null"> `book_name`, </if>
|
<if test="authorName != null">`author_name`,</if>
|
||||||
<if test="heroName != null"> `hero_name`, </if>
|
<if test="bookDesc != null">`book_desc`,</if>
|
||||||
<if test="ladyName != null"> `lady_name`, </if>
|
<if test="score != null">`score`,</if>
|
||||||
<if test="bookStyle != null"> `book_style`, </if>
|
<if test="bookStatus != null">`book_status`,</if>
|
||||||
<if test="bookLabel != null"> `book_label`, </if>
|
<if test="visitCount != null">`visit_count`,</if>
|
||||||
<if test="authorId != null"> `author_id`, </if>
|
<if test="wordCount != null">`word_count`,</if>
|
||||||
<if test="authorName != null"> `author_name`, </if>
|
<if test="commentCount != null">`comment_count`,</if>
|
||||||
<if test="bookDesc != null"> `book_desc`, </if>
|
<if test="yesterdayBuy != null">`yesterday_buy`,</if>
|
||||||
<if test="score != null"> `score`, </if>
|
<if test="lastIndexId != null">`last_index_id`,</if>
|
||||||
<if test="bookStatus != null"> `book_status`, </if>
|
<if test="lastIndexName != null">`last_index_name`,</if>
|
||||||
<if test="visitCount != null"> `visit_count`, </if>
|
<if test="lastIndexUpdateTime != null">`last_index_update_time`,</if>
|
||||||
<if test="wordCount != null"> `word_count`, </if>
|
<if test="isVip != null">`is_vip`,</if>
|
||||||
<if test="commentCount != null"> `comment_count`, </if>
|
<if test="status != null">`status`,</if>
|
||||||
<if test="yesterdayBuy != null"> `yesterday_buy`, </if>
|
<if test="updateTime != null">`update_time`,</if>
|
||||||
<if test="lastIndexId != null"> `last_index_id`, </if>
|
<if test="createTime != null">`create_time`,</if>
|
||||||
<if test="lastIndexName != null"> `last_index_name`, </if>
|
<if test="crawlSourceId != null">`crawl_source_id`,</if>
|
||||||
<if test="lastIndexUpdateTime != null"> `last_index_update_time`, </if>
|
<if test="crawlBookId != null">`crawl_book_id`,</if>
|
||||||
<if test="isVip != null"> `is_vip`, </if>
|
<if test="crawlLastTime != null">`crawl_last_time`,</if>
|
||||||
<if test="status != null"> `status`, </if>
|
<if test="crawlIsStop != null">`crawl_is_stop`</if>
|
||||||
<if test="updateTime != null"> `update_time`, </if>
|
)
|
||||||
<if test="createTime != null"> `create_time`, </if>
|
values
|
||||||
<if test="crawlSourceId != null"> `crawl_source_id`, </if>
|
(
|
||||||
<if test="crawlBookId != null"> `crawl_book_id`, </if>
|
<if test="id != null">#{id},</if>
|
||||||
<if test="crawlLastTime != null"> `crawl_last_time`, </if>
|
<if test="workDirection != null">#{workDirection},</if>
|
||||||
<if test="crawlIsStop != null"> `crawl_is_stop` </if>
|
<if test="catId != null">#{catId},</if>
|
||||||
)
|
<if test="catName != null">#{catName},</if>
|
||||||
values
|
<if test="picUrl != null">#{picUrl},</if>
|
||||||
(
|
<if test="bookName != null">#{bookName},</if>
|
||||||
<if test="id != null"> #{id}, </if>
|
<if test="authorId != null">#{authorId},</if>
|
||||||
<if test="workDirection != null"> #{workDirection}, </if>
|
<if test="authorName != null">#{authorName},</if>
|
||||||
<if test="catId != null"> #{catId}, </if>
|
<if test="bookDesc != null">#{bookDesc},</if>
|
||||||
<if test="catName != null"> #{catName}, </if>
|
<if test="score != null">#{score},</if>
|
||||||
<if test="catChildId != null"> #{catChildId}, </if>
|
<if test="bookStatus != null">#{bookStatus},</if>
|
||||||
<if test="catChildName != null"> #{catChildName}, </if>
|
<if test="visitCount != null">#{visitCount},</if>
|
||||||
<if test="picUrl != null"> #{picUrl}, </if>
|
<if test="wordCount != null">#{wordCount},</if>
|
||||||
<if test="bookName != null"> #{bookName}, </if>
|
<if test="commentCount != null">#{commentCount},</if>
|
||||||
<if test="heroName != null"> #{heroName}, </if>
|
<if test="yesterdayBuy != null">#{yesterdayBuy},</if>
|
||||||
<if test="ladyName != null"> #{ladyName}, </if>
|
<if test="lastIndexId != null">#{lastIndexId},</if>
|
||||||
<if test="bookStyle != null"> #{bookStyle}, </if>
|
<if test="lastIndexName != null">#{lastIndexName},</if>
|
||||||
<if test="bookLabel != null"> #{bookLabel}, </if>
|
<if test="lastIndexUpdateTime != null">#{lastIndexUpdateTime},</if>
|
||||||
<if test="authorId != null"> #{authorId}, </if>
|
<if test="isVip != null">#{isVip},</if>
|
||||||
<if test="authorName != null"> #{authorName}, </if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="bookDesc != null"> #{bookDesc}, </if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
<if test="score != null"> #{score}, </if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="bookStatus != null"> #{bookStatus}, </if>
|
<if test="crawlSourceId != null">#{crawlSourceId},</if>
|
||||||
<if test="visitCount != null"> #{visitCount}, </if>
|
<if test="crawlBookId != null">#{crawlBookId},</if>
|
||||||
<if test="wordCount != null"> #{wordCount}, </if>
|
<if test="crawlLastTime != null">#{crawlLastTime},</if>
|
||||||
<if test="commentCount != null"> #{commentCount}, </if>
|
<if test="crawlIsStop != null">#{crawlIsStop}</if>
|
||||||
<if test="yesterdayBuy != null"> #{yesterdayBuy}, </if>
|
)
|
||||||
<if test="lastIndexId != null"> #{lastIndexId}, </if>
|
</insert>
|
||||||
<if test="lastIndexName != null"> #{lastIndexName}, </if>
|
|
||||||
<if test="lastIndexUpdateTime != null"> #{lastIndexUpdateTime}, </if>
|
|
||||||
<if test="isVip != null"> #{isVip}, </if>
|
|
||||||
<if test="status != null"> #{status}, </if>
|
|
||||||
<if test="updateTime != null"> #{updateTime}, </if>
|
|
||||||
<if test="createTime != null"> #{createTime}, </if>
|
|
||||||
<if test="crawlSourceId != null"> #{crawlSourceId}, </if>
|
|
||||||
<if test="crawlBookId != null"> #{crawlBookId}, </if>
|
|
||||||
<if test="crawlLastTime != null"> #{crawlLastTime}, </if>
|
|
||||||
<if test="crawlIsStop != null"> #{crawlIsStop} </if>
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.java2nb.novel.domain.BookDO">
|
<update id="update" parameterType="com.java2nb.novel.domain.BookDO">
|
||||||
update book
|
update book
|
||||||
<set>
|
<set>
|
||||||
<if test="workDirection != null">`work_direction` = #{workDirection}, </if>
|
<if test="workDirection != null">`work_direction` = #{workDirection},</if>
|
||||||
<if test="catId != null">`cat_id` = #{catId}, </if>
|
<if test="catId != null">`cat_id` = #{catId},</if>
|
||||||
<if test="catName != null">`cat_name` = #{catName}, </if>
|
<if test="catName != null">`cat_name` = #{catName},</if>
|
||||||
<if test="catChildId != null">`cat_child_id` = #{catChildId}, </if>
|
<if test="picUrl != null">`pic_url` = #{picUrl},</if>
|
||||||
<if test="catChildName != null">`cat_child_name` = #{catChildName}, </if>
|
<if test="bookName != null">`book_name` = #{bookName},</if>
|
||||||
<if test="picUrl != null">`pic_url` = #{picUrl}, </if>
|
<if test="authorId != null">`author_id` = #{authorId},</if>
|
||||||
<if test="bookName != null">`book_name` = #{bookName}, </if>
|
<if test="authorName != null">`author_name` = #{authorName},</if>
|
||||||
<if test="heroName != null">`hero_name` = #{heroName}, </if>
|
<if test="bookDesc != null">`book_desc` = #{bookDesc},</if>
|
||||||
<if test="ladyName != null">`lady_name` = #{ladyName}, </if>
|
<if test="score != null">`score` = #{score},</if>
|
||||||
<if test="bookStyle != null">`book_style` = #{bookStyle}, </if>
|
<if test="bookStatus != null">`book_status` = #{bookStatus},</if>
|
||||||
<if test="bookLabel != null">`book_label` = #{bookLabel}, </if>
|
<if test="visitCount != null">`visit_count` = #{visitCount},</if>
|
||||||
<if test="authorId != null">`author_id` = #{authorId}, </if>
|
<if test="wordCount != null">`word_count` = #{wordCount},</if>
|
||||||
<if test="authorName != null">`author_name` = #{authorName}, </if>
|
<if test="commentCount != null">`comment_count` = #{commentCount},</if>
|
||||||
<if test="bookDesc != null">`book_desc` = #{bookDesc}, </if>
|
<if test="yesterdayBuy != null">`yesterday_buy` = #{yesterdayBuy},</if>
|
||||||
<if test="score != null">`score` = #{score}, </if>
|
<if test="lastIndexId != null">`last_index_id` = #{lastIndexId},</if>
|
||||||
<if test="bookStatus != null">`book_status` = #{bookStatus}, </if>
|
<if test="lastIndexName != null">`last_index_name` = #{lastIndexName},</if>
|
||||||
<if test="visitCount != null">`visit_count` = #{visitCount}, </if>
|
<if test="lastIndexUpdateTime != null">`last_index_update_time` = #{lastIndexUpdateTime},</if>
|
||||||
<if test="wordCount != null">`word_count` = #{wordCount}, </if>
|
<if test="isVip != null">`is_vip` = #{isVip},</if>
|
||||||
<if test="commentCount != null">`comment_count` = #{commentCount}, </if>
|
<if test="status != null">`status` = #{status},</if>
|
||||||
<if test="yesterdayBuy != null">`yesterday_buy` = #{yesterdayBuy}, </if>
|
<if test="updateTime != null">`update_time` = #{updateTime},</if>
|
||||||
<if test="lastIndexId != null">`last_index_id` = #{lastIndexId}, </if>
|
<if test="createTime != null">`create_time` = #{createTime},</if>
|
||||||
<if test="lastIndexName != null">`last_index_name` = #{lastIndexName}, </if>
|
<if test="crawlSourceId != null">`crawl_source_id` = #{crawlSourceId},</if>
|
||||||
<if test="lastIndexUpdateTime != null">`last_index_update_time` = #{lastIndexUpdateTime}, </if>
|
<if test="crawlBookId != null">`crawl_book_id` = #{crawlBookId},</if>
|
||||||
<if test="isVip != null">`is_vip` = #{isVip}, </if>
|
<if test="crawlLastTime != null">`crawl_last_time` = #{crawlLastTime},</if>
|
||||||
<if test="status != null">`status` = #{status}, </if>
|
<if test="crawlIsStop != null">`crawl_is_stop` = #{crawlIsStop}</if>
|
||||||
<if test="updateTime != null">`update_time` = #{updateTime}, </if>
|
</set>
|
||||||
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
where id = #{id}
|
||||||
<if test="crawlSourceId != null">`crawl_source_id` = #{crawlSourceId}, </if>
|
</update>
|
||||||
<if test="crawlBookId != null">`crawl_book_id` = #{crawlBookId}, </if>
|
|
||||||
<if test="crawlLastTime != null">`crawl_last_time` = #{crawlLastTime}, </if>
|
|
||||||
<if test="crawlIsStop != null">`crawl_is_stop` = #{crawlIsStop}</if>
|
|
||||||
</set>
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="remove">
|
<delete id="remove">
|
||||||
delete from book where id = #{value}
|
delete
|
||||||
</delete>
|
from book
|
||||||
|
where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<delete id="batchRemove">
|
<delete id="batchRemove">
|
||||||
delete from book where id in
|
delete from book where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="tableSta" resultType="map">
|
<select id="tableSta" resultType="map">
|
||||||
SELECT
|
SELECT DATE_FORMAT(create_time, "%Y-%m-%d") AS staDate,
|
||||||
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
COUNT(1) bookCount
|
||||||
COUNT( 1 ) bookCount
|
FROM book
|
||||||
FROM
|
WHERE create_time >= #{minDate}
|
||||||
book
|
GROUP BY DATE_FORMAT(create_time, "%Y-%m-%d")
|
||||||
WHERE
|
ORDER BY staDate
|
||||||
create_time >= #{minDate}
|
</select>
|
||||||
GROUP BY
|
<select id="batchGet" resultType="com.java2nb.novel.domain.BookDO">
|
||||||
DATE_FORMAT( create_time, "%Y-%m-%d" )
|
select
|
||||||
ORDER BY
|
`id`,`work_direction`,`cat_id`,`cat_name`,`pic_url`,`book_name`,`author_id`,`author_name`,`book_desc`,`score`,`book_status`,`visit_count`,`word_count`,`comment_count`,`yesterday_buy`,`last_index_id`,`last_index_name`,`last_index_update_time`,`is_vip`,`status`,`update_time`,`create_time`,`crawl_source_id`,`crawl_book_id`,`crawl_last_time`,`crawl_is_stop`
|
||||||
staDate
|
from book where id in
|
||||||
</select>
|
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -0,0 +1,131 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.FriendLinkDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.FriendLinkDO">
|
||||||
|
select `id`,`link_name`,`link_url`,`sort`,`is_open`,`create_user_id`,`create_time`,`update_user_id`,`update_time` from friend_link where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.FriendLinkDO">
|
||||||
|
select `id`,`link_name`,`link_url`,`sort`,`is_open`,`create_user_id`,`create_time`,`update_user_id`,`update_time` from friend_link
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="linkName != null and linkName != ''"> and link_name = #{linkName} </if>
|
||||||
|
<if test="linkUrl != null and linkUrl != ''"> and link_url = #{linkUrl} </if>
|
||||||
|
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
|
||||||
|
<if test="isOpen != null and isOpen != ''"> and is_open = #{isOpen} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from friend_link
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="linkName != null and linkName != ''"> and link_name = #{linkName} </if>
|
||||||
|
<if test="linkUrl != null and linkUrl != ''"> and link_url = #{linkUrl} </if>
|
||||||
|
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
|
||||||
|
<if test="isOpen != null and isOpen != ''"> and is_open = #{isOpen} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.FriendLinkDO">
|
||||||
|
insert into friend_link
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`link_name`,
|
||||||
|
`link_url`,
|
||||||
|
`sort`,
|
||||||
|
`is_open`,
|
||||||
|
`create_user_id`,
|
||||||
|
`create_time`,
|
||||||
|
`update_user_id`,
|
||||||
|
`update_time`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{linkName},
|
||||||
|
#{linkUrl},
|
||||||
|
#{sort},
|
||||||
|
#{isOpen},
|
||||||
|
#{createUserId},
|
||||||
|
#{createTime},
|
||||||
|
#{updateUserId},
|
||||||
|
#{updateTime}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.FriendLinkDO">
|
||||||
|
insert into friend_link
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="linkName != null"> `link_name`, </if>
|
||||||
|
<if test="linkUrl != null"> `link_url`, </if>
|
||||||
|
<if test="sort != null"> `sort`, </if>
|
||||||
|
<if test="isOpen != null"> `is_open`, </if>
|
||||||
|
<if test="createUserId != null"> `create_user_id`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="updateUserId != null"> `update_user_id`, </if>
|
||||||
|
<if test="updateTime != null"> `update_time` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="linkName != null"> #{linkName}, </if>
|
||||||
|
<if test="linkUrl != null"> #{linkUrl}, </if>
|
||||||
|
<if test="sort != null"> #{sort}, </if>
|
||||||
|
<if test="isOpen != null"> #{isOpen}, </if>
|
||||||
|
<if test="createUserId != null"> #{createUserId}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="updateUserId != null"> #{updateUserId}, </if>
|
||||||
|
<if test="updateTime != null"> #{updateTime} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.FriendLinkDO">
|
||||||
|
update friend_link
|
||||||
|
<set>
|
||||||
|
<if test="linkName != null">`link_name` = #{linkName}, </if>
|
||||||
|
<if test="linkUrl != null">`link_url` = #{linkUrl}, </if>
|
||||||
|
<if test="sort != null">`sort` = #{sort}, </if>
|
||||||
|
<if test="isOpen != null">`is_open` = #{isOpen}, </if>
|
||||||
|
<if test="createUserId != null">`create_user_id` = #{createUserId}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="updateUserId != null">`update_user_id` = #{updateUserId}, </if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from friend_link where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from friend_link where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -4,8 +4,19 @@
|
|||||||
<mapper namespace="com.java2nb.novel.dao.UserDao">
|
<mapper namespace="com.java2nb.novel.dao.UserDao">
|
||||||
|
|
||||||
<select id="get" resultType="com.java2nb.novel.domain.UserDO">
|
<select id="get" resultType="com.java2nb.novel.domain.UserDO">
|
||||||
select `id`,`username`,`password`,`nick_name`,`user_photo`,`user_sex`,`account_balance`,`status`,`create_time`,`update_time` from user where id = #{value}
|
select `id`,
|
||||||
</select>
|
`username`,
|
||||||
|
`password`,
|
||||||
|
`nick_name`,
|
||||||
|
`user_photo`,
|
||||||
|
`user_sex`,
|
||||||
|
`account_balance`,
|
||||||
|
`status`,
|
||||||
|
`create_time`,
|
||||||
|
`update_time`
|
||||||
|
from user
|
||||||
|
where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="list" resultType="com.java2nb.novel.domain.UserDO">
|
<select id="list" resultType="com.java2nb.novel.domain.UserDO">
|
||||||
select
|
select
|
||||||
@ -53,33 +64,28 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="save" parameterType="com.java2nb.novel.domain.UserDO">
|
<insert id="save" parameterType="com.java2nb.novel.domain.UserDO">
|
||||||
insert into user
|
insert into user
|
||||||
(
|
(`id`,
|
||||||
`id`,
|
`username`,
|
||||||
`username`,
|
`password`,
|
||||||
`password`,
|
`nick_name`,
|
||||||
`nick_name`,
|
`user_photo`,
|
||||||
`user_photo`,
|
`user_sex`,
|
||||||
`user_sex`,
|
`account_balance`,
|
||||||
`account_balance`,
|
`status`,
|
||||||
`status`,
|
`create_time`,
|
||||||
`create_time`,
|
`update_time`)
|
||||||
`update_time`
|
values (#{id},
|
||||||
)
|
#{username},
|
||||||
values
|
#{password},
|
||||||
(
|
#{nickName},
|
||||||
#{id},
|
#{userPhoto},
|
||||||
#{username},
|
#{userSex},
|
||||||
#{password},
|
#{accountBalance},
|
||||||
#{nickName},
|
#{status},
|
||||||
#{userPhoto},
|
#{createTime},
|
||||||
#{userSex},
|
#{updateTime})
|
||||||
#{accountBalance},
|
</insert>
|
||||||
#{status},
|
|
||||||
#{createTime},
|
|
||||||
#{updateTime}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.UserDO">
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.UserDO">
|
||||||
insert into user
|
insert into user
|
||||||
@ -127,8 +133,10 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="remove">
|
<delete id="remove">
|
||||||
delete from user where id = #{value}
|
delete
|
||||||
</delete>
|
from user
|
||||||
|
where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<delete id="batchRemove">
|
<delete id="batchRemove">
|
||||||
delete from user where id in
|
delete from user where id in
|
||||||
@ -138,17 +146,20 @@
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="tableSta" resultType="map">
|
<select id="tableSta" resultType="map">
|
||||||
SELECT
|
SELECT DATE_FORMAT(create_time, "%Y-%m-%d") AS staDate,
|
||||||
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
COUNT(1) userCount
|
||||||
COUNT( 1 ) userCount
|
FROM user
|
||||||
FROM
|
WHERE create_time >= #{minDate}
|
||||||
user
|
GROUP BY DATE_FORMAT(create_time, "%Y-%m-%d")
|
||||||
WHERE
|
ORDER BY staDate
|
||||||
create_time >= #{minDate}
|
</select>
|
||||||
GROUP BY
|
<select id="batchGet" resultType="com.java2nb.novel.domain.UserDO">
|
||||||
DATE_FORMAT( create_time, "%Y-%m-%d" )
|
select
|
||||||
ORDER BY
|
`id`,`username`,`password`,`nick_name`,`user_photo`,`user_sex`,`account_balance`,`status`,`create_time`,`update_time`
|
||||||
staDate
|
from user where id in
|
||||||
</select>
|
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -0,0 +1,152 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.WebsiteInfoDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.WebsiteInfoDO">
|
||||||
|
select `id`,`name`,`domain`,`keyword`,`description`,`qq`,`logo`,`logo_dark`,`create_time`,`create_user_id`,`update_time`,`update_user_id` from website_info where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.WebsiteInfoDO">
|
||||||
|
select `id`,`name`,`domain`,`keyword`,`description`,`qq`,`logo`,`logo_dark`,`create_time`,`create_user_id`,`update_time`,`update_user_id` from website_info
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||||
|
<if test="domain != null and domain != ''"> and domain = #{domain} </if>
|
||||||
|
<if test="keyword != null and keyword != ''"> and keyword = #{keyword} </if>
|
||||||
|
<if test="description != null and description != ''"> and description = #{description} </if>
|
||||||
|
<if test="qq != null and qq != ''"> and qq = #{qq} </if>
|
||||||
|
<if test="logo != null and logo != ''"> and logo = #{logo} </if>
|
||||||
|
<if test="logoDark != null and logoDark != ''"> and logo_dark = #{logoDark} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from website_info
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||||
|
<if test="domain != null and domain != ''"> and domain = #{domain} </if>
|
||||||
|
<if test="keyword != null and keyword != ''"> and keyword = #{keyword} </if>
|
||||||
|
<if test="description != null and description != ''"> and description = #{description} </if>
|
||||||
|
<if test="qq != null and qq != ''"> and qq = #{qq} </if>
|
||||||
|
<if test="logo != null and logo != ''"> and logo = #{logo} </if>
|
||||||
|
<if test="logoDark != null and logoDark != ''"> and logo_dark = #{logoDark} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.WebsiteInfoDO">
|
||||||
|
insert into website_info
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`name`,
|
||||||
|
`domain`,
|
||||||
|
`keyword`,
|
||||||
|
`description`,
|
||||||
|
`qq`,
|
||||||
|
`logo`,
|
||||||
|
`logo_dark`,
|
||||||
|
`create_time`,
|
||||||
|
`create_user_id`,
|
||||||
|
`update_time`,
|
||||||
|
`update_user_id`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{name},
|
||||||
|
#{domain},
|
||||||
|
#{keyword},
|
||||||
|
#{description},
|
||||||
|
#{qq},
|
||||||
|
#{logo},
|
||||||
|
#{logoDark},
|
||||||
|
#{createTime},
|
||||||
|
#{createUserId},
|
||||||
|
#{updateTime},
|
||||||
|
#{updateUserId}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.WebsiteInfoDO">
|
||||||
|
insert into website_info
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="name != null"> `name`, </if>
|
||||||
|
<if test="domain != null"> `domain`, </if>
|
||||||
|
<if test="keyword != null"> `keyword`, </if>
|
||||||
|
<if test="description != null"> `description`, </if>
|
||||||
|
<if test="qq != null"> `qq`, </if>
|
||||||
|
<if test="logo != null"> `logo`, </if>
|
||||||
|
<if test="logoDark != null"> `logo_dark`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="createUserId != null"> `create_user_id`, </if>
|
||||||
|
<if test="updateTime != null"> `update_time`, </if>
|
||||||
|
<if test="updateUserId != null"> `update_user_id` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="name != null"> #{name}, </if>
|
||||||
|
<if test="domain != null"> #{domain}, </if>
|
||||||
|
<if test="keyword != null"> #{keyword}, </if>
|
||||||
|
<if test="description != null"> #{description}, </if>
|
||||||
|
<if test="qq != null"> #{qq}, </if>
|
||||||
|
<if test="logo != null"> #{logo}, </if>
|
||||||
|
<if test="logoDark != null"> #{logoDark}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="createUserId != null"> #{createUserId}, </if>
|
||||||
|
<if test="updateTime != null"> #{updateTime}, </if>
|
||||||
|
<if test="updateUserId != null"> #{updateUserId} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.WebsiteInfoDO">
|
||||||
|
update website_info
|
||||||
|
<set>
|
||||||
|
<if test="name != null">`name` = #{name}, </if>
|
||||||
|
<if test="domain != null">`domain` = #{domain}, </if>
|
||||||
|
<if test="keyword != null">`keyword` = #{keyword}, </if>
|
||||||
|
<if test="description != null">`description` = #{description}, </if>
|
||||||
|
<if test="qq != null">`qq` = #{qq}, </if>
|
||||||
|
<if test="logo != null">`logo` = #{logo}, </if>
|
||||||
|
<if test="logoDark != null">`logo_dark` = #{logoDark}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="createUserId != null">`create_user_id` = #{createUserId}, </if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}, </if>
|
||||||
|
<if test="updateUserId != null">`update_user_id` = #{updateUserId}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from website_info where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from website_info where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -3,149 +3,161 @@
|
|||||||
|
|
||||||
<mapper namespace="com.java2nb.system.dao.DataPermDao">
|
<mapper namespace="com.java2nb.system.dao.DataPermDao">
|
||||||
|
|
||||||
<select id="get" resultType="com.java2nb.system.domain.DataPermDO">
|
<select id="get" resultType="com.java2nb.system.domain.DataPermDO">
|
||||||
select `id`,`name`,`table_name`,`module_name`,`crl_attr_name`,`crl_column_name`,`perm_code`,`order_num`,`gmt_create`,`gmt_modified` from sys_data_perm where id = #{value}
|
select `id`,
|
||||||
</select>
|
`name`,
|
||||||
|
`table_name`,
|
||||||
|
`module_name`,
|
||||||
|
`crl_attr_name`,
|
||||||
|
`crl_column_name`,
|
||||||
|
`perm_code`,
|
||||||
|
`order_num`,
|
||||||
|
`gmt_create`,
|
||||||
|
`gmt_modified`
|
||||||
|
from sys_data_perm
|
||||||
|
where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="list" resultType="com.java2nb.system.domain.DataPermDO">
|
<select id="list" resultType="com.java2nb.system.domain.DataPermDO">
|
||||||
select `id`,`name`,`table_name`,`module_name`,`crl_attr_name`,`crl_column_name`,`perm_code`,`order_num`,`gmt_create`,`gmt_modified` from sys_data_perm
|
select
|
||||||
|
`id`,`name`,`table_name`,`module_name`,`crl_attr_name`,`crl_column_name`,`perm_code`,`order_num`,`gmt_create`,`gmt_modified`
|
||||||
|
from sys_data_perm
|
||||||
<where>
|
<where>
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
<if test="name != null and name != ''">and name = #{name}</if>
|
||||||
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
|
<if test="tableName != null and tableName != ''">and table_name = #{tableName}</if>
|
||||||
<if test="moduleName != null and moduleName != ''"> and module_name = #{moduleName} </if>
|
<if test="moduleName != null and moduleName != ''">and module_name = #{moduleName}</if>
|
||||||
<if test="crlAttrName != null and crlAttrName != ''"> and crl_attr_name = #{crlAttrName} </if>
|
<if test="crlAttrName != null and crlAttrName != ''">and crl_attr_name = #{crlAttrName}</if>
|
||||||
<if test="crlColumnName != null and crlColumnName != ''"> and crl_column_name = #{crlColumnName} </if>
|
<if test="crlColumnName != null and crlColumnName != ''">and crl_column_name = #{crlColumnName}</if>
|
||||||
<if test="permCode != null and permCode != ''"> and perm_code = #{permCode} </if>
|
<if test="permCode != null and permCode != ''">and perm_code = #{permCode}</if>
|
||||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||||
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
|
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
|
||||||
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
|
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
|
||||||
</where>
|
</where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="sort != null and sort.trim() != ''">
|
<when test="sort != null and sort.trim() != ''">
|
||||||
order by ${sort} ${order}
|
order by ${sort} ${order}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
order by id desc
|
order by id desc
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="offset != null and limit != null">
|
<if test="offset != null and limit != null">
|
||||||
limit #{offset}, #{limit}
|
limit #{offset}, #{limit}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="count" resultType="int">
|
<select id="count" resultType="int">
|
||||||
select count(*) from sys_data_perm
|
select count(*) from sys_data_perm
|
||||||
<where>
|
<where>
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
<if test="name != null and name != ''">and name = #{name}</if>
|
||||||
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
|
<if test="tableName != null and tableName != ''">and table_name = #{tableName}</if>
|
||||||
<if test="moduleName != null and moduleName != ''"> and module_name = #{moduleName} </if>
|
<if test="moduleName != null and moduleName != ''">and module_name = #{moduleName}</if>
|
||||||
<if test="crlAttrName != null and crlAttrName != ''"> and crl_attr_name = #{crlAttrName} </if>
|
<if test="crlAttrName != null and crlAttrName != ''">and crl_attr_name = #{crlAttrName}</if>
|
||||||
<if test="crlColumnName != null and crlColumnName != ''"> and crl_column_name = #{crlColumnName} </if>
|
<if test="crlColumnName != null and crlColumnName != ''">and crl_column_name = #{crlColumnName}</if>
|
||||||
<if test="permCode != null and permCode != ''"> and perm_code = #{permCode} </if>
|
<if test="permCode != null and permCode != ''">and perm_code = #{permCode}</if>
|
||||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||||
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
|
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
|
||||||
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
|
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="save" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true" keyProperty="id">
|
<insert id="save" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into sys_data_perm
|
insert into sys_data_perm
|
||||||
(
|
(`name`,
|
||||||
`name`,
|
`table_name`,
|
||||||
`table_name`,
|
`module_name`,
|
||||||
`module_name`,
|
`crl_attr_name`,
|
||||||
`crl_attr_name`,
|
`crl_column_name`,
|
||||||
`crl_column_name`,
|
`perm_code`,
|
||||||
`perm_code`,
|
`order_num`,
|
||||||
`order_num`,
|
`gmt_create`,
|
||||||
`gmt_create`,
|
`gmt_modified`)
|
||||||
`gmt_modified`
|
values (#{name},
|
||||||
)
|
#{tableName},
|
||||||
values
|
#{moduleName},
|
||||||
(
|
#{crlAttrName},
|
||||||
#{name},
|
#{crlColumnName},
|
||||||
#{tableName},
|
#{permCode},
|
||||||
#{moduleName},
|
#{orderNum},
|
||||||
#{crlAttrName},
|
#{gmtCreate},
|
||||||
#{crlColumnName},
|
#{gmtModified})
|
||||||
#{permCode},
|
</insert>
|
||||||
#{orderNum},
|
|
||||||
#{gmtCreate},
|
|
||||||
#{gmtModified}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="saveSelective" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true" keyProperty="id">
|
<insert id="saveSelective" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true"
|
||||||
insert into sys_data_perm
|
keyProperty="id">
|
||||||
(
|
insert into sys_data_perm
|
||||||
<if test="id != null"> `id`, </if>
|
(
|
||||||
<if test="name != null"> `name`, </if>
|
<if test="id != null">`id`,</if>
|
||||||
<if test="tableName != null"> `table_name`, </if>
|
<if test="name != null">`name`,</if>
|
||||||
<if test="moduleName != null"> `module_name`, </if>
|
<if test="tableName != null">`table_name`,</if>
|
||||||
<if test="crlAttrName != null"> `crl_attr_name`, </if>
|
<if test="moduleName != null">`module_name`,</if>
|
||||||
<if test="crlColumnName != null"> `crl_column_name`, </if>
|
<if test="crlAttrName != null">`crl_attr_name`,</if>
|
||||||
<if test="permCode != null"> `perm_code`, </if>
|
<if test="crlColumnName != null">`crl_column_name`,</if>
|
||||||
<if test="orderNum != null"> `order_num`, </if>
|
<if test="permCode != null">`perm_code`,</if>
|
||||||
<if test="gmtCreate != null"> `gmt_create`, </if>
|
<if test="orderNum != null">`order_num`,</if>
|
||||||
<if test="gmtModified != null"> `gmt_modified` </if>
|
<if test="gmtCreate != null">`gmt_create`,</if>
|
||||||
)
|
<if test="gmtModified != null">`gmt_modified`</if>
|
||||||
values
|
)
|
||||||
(
|
values
|
||||||
<if test="id != null"> #{id}, </if>
|
(
|
||||||
<if test="name != null"> #{name}, </if>
|
<if test="id != null">#{id},</if>
|
||||||
<if test="tableName != null"> #{tableName}, </if>
|
<if test="name != null">#{name},</if>
|
||||||
<if test="moduleName != null"> #{moduleName}, </if>
|
<if test="tableName != null">#{tableName},</if>
|
||||||
<if test="crlAttrName != null"> #{crlAttrName}, </if>
|
<if test="moduleName != null">#{moduleName},</if>
|
||||||
<if test="crlColumnName != null"> #{crlColumnName}, </if>
|
<if test="crlAttrName != null">#{crlAttrName},</if>
|
||||||
<if test="permCode != null"> #{permCode}, </if>
|
<if test="crlColumnName != null">#{crlColumnName},</if>
|
||||||
<if test="orderNum != null"> #{orderNum}, </if>
|
<if test="permCode != null">#{permCode},</if>
|
||||||
<if test="gmtCreate != null"> #{gmtCreate}, </if>
|
<if test="orderNum != null">#{orderNum},</if>
|
||||||
<if test="gmtModified != null"> #{gmtModified} </if>
|
<if test="gmtCreate != null">#{gmtCreate},</if>
|
||||||
)
|
<if test="gmtModified != null">#{gmtModified}</if>
|
||||||
</insert>
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="update" parameterType="com.java2nb.system.domain.DataPermDO">
|
<update id="update" parameterType="com.java2nb.system.domain.DataPermDO">
|
||||||
update sys_data_perm
|
update sys_data_perm
|
||||||
<set>
|
<set>
|
||||||
<if test="name != null">`name` = #{name}, </if>
|
<if test="name != null">`name` = #{name},</if>
|
||||||
<if test="tableName != null">`table_name` = #{tableName}, </if>
|
<if test="tableName != null">`table_name` = #{tableName},</if>
|
||||||
<if test="moduleName != null">`module_name` = #{moduleName}, </if>
|
<if test="moduleName != null">`module_name` = #{moduleName},</if>
|
||||||
<if test="crlAttrName != null">`crl_attr_name` = #{crlAttrName}, </if>
|
<if test="crlAttrName != null">`crl_attr_name` = #{crlAttrName},</if>
|
||||||
<if test="crlColumnName != null">`crl_column_name` = #{crlColumnName}, </if>
|
<if test="crlColumnName != null">`crl_column_name` = #{crlColumnName},</if>
|
||||||
<if test="permCode != null">`perm_code` = #{permCode}, </if>
|
<if test="permCode != null">`perm_code` = #{permCode},</if>
|
||||||
<if test="orderNum != null">`order_num` = #{orderNum}, </if>
|
<if test="orderNum != null">`order_num` = #{orderNum},</if>
|
||||||
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate}, </if>
|
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate},</if>
|
||||||
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
|
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="remove">
|
<delete id="remove">
|
||||||
delete from sys_data_perm where id = #{value}
|
delete
|
||||||
</delete>
|
from sys_data_perm
|
||||||
|
where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<delete id="batchRemove">
|
<delete id="batchRemove">
|
||||||
delete from sys_data_perm where id in
|
delete from sys_data_perm where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
<select id="listModuleName" resultType="com.java2nb.system.domain.DataPermDO">
|
<select id="listModuleName" resultType="com.java2nb.system.domain.DataPermDO">
|
||||||
select distinct `module_name` from sys_data_perm ;
|
select `module_name`
|
||||||
|
from sys_data_perm;
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDataPermsByUserId" parameterType="long" resultType="com.java2nb.system.domain.DataPermDO">
|
<select id="selectDataPermsByUserId" parameterType="long" resultType="com.java2nb.system.domain.DataPermDO">
|
||||||
|
|
||||||
select distinct t1.`table_name`,t1.`module_name`,t1.`crl_attr_name`,t1.`crl_column_name`,t1.`perm_code`
|
select t1.`table_name`, t1.`module_name`, t1.`crl_attr_name`, t1.`crl_column_name`, t1.`perm_code`
|
||||||
from sys_data_perm t1
|
from sys_data_perm t1
|
||||||
inner join sys_role_data_perm t2 on t1.id = t2.perm_id
|
inner join sys_role_data_perm t2 on t1.id = t2.perm_id
|
||||||
inner join sys_user_role t3 on t2.role_id = t3.role_id
|
inner join sys_user_role t3 on t2.role_id = t3.role_id
|
||||||
and t3.user_id = #{userId}
|
and t3.user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -3,96 +3,102 @@
|
|||||||
|
|
||||||
<mapper namespace="com.java2nb.system.dao.DeptDao">
|
<mapper namespace="com.java2nb.system.dao.DeptDao">
|
||||||
|
|
||||||
<select id="get" resultType="com.java2nb.system.domain.DeptDO">
|
<select id="get" resultType="com.java2nb.system.domain.DeptDO">
|
||||||
select
|
select `dept_id`,
|
||||||
`dept_id`,`parent_id`,`name`,`order_num`,`del_flag` from sys_dept
|
`parent_id`,
|
||||||
where dept_id = #{value}
|
`name`,
|
||||||
</select>
|
`order_num`,
|
||||||
|
`del_flag`
|
||||||
|
from sys_dept
|
||||||
|
where dept_id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="list" resultType="com.java2nb.system.domain.DeptDO">
|
<select id="list" resultType="com.java2nb.system.domain.DeptDO">
|
||||||
select `dept_id`,`parent_id`,`name`,`order_num`,`del_flag` from
|
select `dept_id`,`parent_id`,`name`,`order_num`,`del_flag` from
|
||||||
sys_dept
|
sys_dept
|
||||||
<where>
|
<where>
|
||||||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId} </if>
|
<if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
|
||||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
<if test="name != null and name != ''">and name = #{name}</if>
|
||||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||||
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
|
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
|
||||||
</where>
|
</where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="sort != null and sort.trim() != ''">
|
<when test="sort != null and sort.trim() != ''">
|
||||||
order by ${sort} ${order}
|
order by ${sort} ${order}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
order by dept_id desc
|
order by dept_id desc
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="offset != null and limit != null">
|
<if test="offset != null and limit != null">
|
||||||
limit #{offset}, #{limit}
|
limit #{offset}, #{limit}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="count" resultType="int">
|
<select id="count" resultType="int">
|
||||||
select count(*) from sys_dept
|
select count(*) from sys_dept
|
||||||
<where>
|
<where>
|
||||||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId} </if>
|
<if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
|
||||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
<if test="name != null and name != ''">and name = #{name}</if>
|
||||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||||
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
|
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="save" parameterType="com.java2nb.system.domain.DeptDO"
|
<insert id="save" parameterType="com.java2nb.system.domain.DeptDO"
|
||||||
useGeneratedKeys="true" keyProperty="deptId">
|
useGeneratedKeys="true" keyProperty="deptId">
|
||||||
insert into sys_dept
|
insert into sys_dept
|
||||||
(
|
(`parent_id`,
|
||||||
`parent_id`,
|
`name`,
|
||||||
`name`,
|
`order_num`,
|
||||||
`order_num`,
|
`del_flag`)
|
||||||
`del_flag`
|
values (#{parentId},
|
||||||
)
|
#{name},
|
||||||
values
|
#{orderNum},
|
||||||
(
|
#{delFlag})
|
||||||
#{parentId},
|
</insert>
|
||||||
#{name},
|
|
||||||
#{orderNum},
|
|
||||||
#{delFlag}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.java2nb.system.domain.DeptDO">
|
<update id="update" parameterType="com.java2nb.system.domain.DeptDO">
|
||||||
update sys_dept
|
update sys_dept
|
||||||
<set>
|
<set>
|
||||||
<if test="parentId != null">`parent_id` = #{parentId}, </if>
|
<if test="parentId != null">`parent_id` = #{parentId},</if>
|
||||||
<if test="name != null">`name` = #{name}, </if>
|
<if test="name != null">`name` = #{name},</if>
|
||||||
<if test="orderNum != null">`order_num` = #{orderNum}, </if>
|
<if test="orderNum != null">`order_num` = #{orderNum},</if>
|
||||||
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
|
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
|
||||||
</set>
|
</set>
|
||||||
where dept_id = #{deptId}
|
where dept_id = #{deptId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="remove">
|
<delete id="remove">
|
||||||
delete from sys_dept where dept_id = #{value}
|
delete
|
||||||
</delete>
|
from sys_dept
|
||||||
|
where dept_id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<delete id="batchRemove">
|
<delete id="batchRemove">
|
||||||
delete from sys_dept where dept_id in
|
delete from sys_dept where dept_id in
|
||||||
<foreach item="deptId" collection="array" open="(" separator=","
|
<foreach item="deptId" collection="array" open="(" separator=","
|
||||||
close=")">
|
close=")">
|
||||||
#{deptId}
|
#{deptId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="listParentDept" resultType="long">
|
<select id="listParentDept" resultType="long">
|
||||||
select DISTINCT parent_id from sys_dept
|
select parent_id
|
||||||
</select>
|
from sys_dept
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getDeptUserNumber" resultType="int">
|
<select id="getDeptUserNumber" resultType="int">
|
||||||
select count(*) from sys_user where dept_id = #{value}
|
select count(*)
|
||||||
</select>
|
from sys_user
|
||||||
|
where dept_id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getDeptIdsByParentId" parameterType="long" resultType="String">
|
<select id="getDeptIdsByParentId" parameterType="long" resultType="String">
|
||||||
select group_concat(dept_id) from sys_dept where parent_id = #{deptId}
|
select group_concat(dept_id)
|
||||||
</select>
|
from sys_dept
|
||||||
|
where parent_id = #{deptId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -3,134 +3,148 @@
|
|||||||
|
|
||||||
<mapper namespace="com.java2nb.system.dao.MenuDao">
|
<mapper namespace="com.java2nb.system.dao.MenuDao">
|
||||||
|
|
||||||
<select id="get" resultType="com.java2nb.system.domain.MenuDO">
|
<select id="get" resultType="com.java2nb.system.domain.MenuDO">
|
||||||
select
|
select `menu_id`,
|
||||||
`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`,`gmt_create`,`gmt_modified`
|
`parent_id`,
|
||||||
from sys_menu where menu_id = #{value}
|
`name`,
|
||||||
</select>
|
`url`,
|
||||||
|
`perms`,
|
||||||
|
`type`,
|
||||||
|
`icon`,
|
||||||
|
`order_num`,
|
||||||
|
`gmt_create`,
|
||||||
|
`gmt_modified`
|
||||||
|
from sys_menu
|
||||||
|
where menu_id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="list" resultType="com.java2nb.system.domain.MenuDO">
|
<select id="list" resultType="com.java2nb.system.domain.MenuDO">
|
||||||
select
|
select
|
||||||
`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`,`gmt_create`,`gmt_modified`
|
`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`,`gmt_create`,`gmt_modified`
|
||||||
from sys_menu
|
from sys_menu
|
||||||
<where>
|
<where>
|
||||||
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
|
<if test="menuId != null and menuId != ''">and menu_id = #{menuId}</if>
|
||||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
<if test="name != null and name != ''">and name = #{name}</if>
|
||||||
<if test="url != null and url != ''"> and url = #{url} </if>
|
<if test="url != null and url != ''">and url = #{url}</if>
|
||||||
<if test="perms != null and perms != ''"> and perms = #{perms} </if>
|
<if test="perms != null and perms != ''">and perms = #{perms}</if>
|
||||||
<if test="type != null and type != ''"> and type = #{type} </if>
|
<if test="type != null and type != ''">and type = #{type}</if>
|
||||||
<if test="icon != null and icon != ''"> and icon = #{icon} </if>
|
<if test="icon != null and icon != ''">and icon = #{icon}</if>
|
||||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||||
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
|
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
|
||||||
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
|
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
|
||||||
</where>
|
</where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="sort != null and sort.trim() != ''">
|
<when test="sort != null and sort.trim() != ''">
|
||||||
order by ${sort} ${order}
|
order by ${sort} ${order}
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
order by menu_id desc
|
order by menu_id desc
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="offset != null and limit != null">
|
<if test="offset != null and limit != null">
|
||||||
limit #{offset}, #{limit}
|
limit #{offset}, #{limit}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="count" resultType="int">
|
<select id="count" resultType="int">
|
||||||
select count(*) from sys_menu
|
select count(*) from sys_menu
|
||||||
<where>
|
<where>
|
||||||
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
|
<if test="menuId != null and menuId != ''">and menu_id = #{menuId}</if>
|
||||||
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
|
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
||||||
<if test="name != null and name != ''"> and name = #{name} </if>
|
<if test="name != null and name != ''">and name = #{name}</if>
|
||||||
<if test="url != null and url != ''"> and url = #{url} </if>
|
<if test="url != null and url != ''">and url = #{url}</if>
|
||||||
<if test="perms != null and perms != ''"> and perms = #{perms} </if>
|
<if test="perms != null and perms != ''">and perms = #{perms}</if>
|
||||||
<if test="type != null and type != ''"> and type = #{type} </if>
|
<if test="type != null and type != ''">and type = #{type}</if>
|
||||||
<if test="icon != null and icon != ''"> and icon = #{icon} </if>
|
<if test="icon != null and icon != ''">and icon = #{icon}</if>
|
||||||
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
|
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
|
||||||
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
|
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
|
||||||
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
|
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="save" parameterType="com.java2nb.system.domain.MenuDO"
|
<insert id="save" parameterType="com.java2nb.system.domain.MenuDO"
|
||||||
useGeneratedKeys="true" keyProperty="menuId">
|
useGeneratedKeys="true" keyProperty="menuId">
|
||||||
insert into sys_menu
|
insert into sys_menu
|
||||||
(
|
(`parent_id`,
|
||||||
`parent_id`,
|
`name`,
|
||||||
`name`,
|
`url`,
|
||||||
`url`,
|
`perms`,
|
||||||
`perms`,
|
`type`,
|
||||||
`type`,
|
`icon`,
|
||||||
`icon`,
|
`order_num`,
|
||||||
`order_num`,
|
`gmt_create`,
|
||||||
`gmt_create`,
|
`gmt_modified`)
|
||||||
`gmt_modified`
|
values (#{parentId},
|
||||||
)
|
#{name},
|
||||||
values
|
#{url},
|
||||||
(
|
#{perms},
|
||||||
#{parentId},
|
#{type},
|
||||||
#{name},
|
#{icon},
|
||||||
#{url},
|
#{orderNum},
|
||||||
#{perms},
|
#{gmtCreate},
|
||||||
#{type},
|
#{gmtModified})
|
||||||
#{icon},
|
</insert>
|
||||||
#{orderNum},
|
|
||||||
#{gmtCreate},
|
|
||||||
#{gmtModified}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.java2nb.system.domain.MenuDO">
|
<update id="update" parameterType="com.java2nb.system.domain.MenuDO">
|
||||||
update sys_menu
|
update sys_menu
|
||||||
<set>
|
<set>
|
||||||
<if test="parentId != null">`parent_id` = #{parentId}, </if>
|
<if test="parentId != null">`parent_id` = #{parentId},</if>
|
||||||
<if test="name != null">`name` = #{name}, </if>
|
<if test="name != null">`name` = #{name},</if>
|
||||||
<if test="url != null">`url` = #{url}, </if>
|
<if test="url != null">`url` = #{url},</if>
|
||||||
<if test="perms != null">`perms` = #{perms}, </if>
|
<if test="perms != null">`perms` = #{perms},</if>
|
||||||
<if test="type != null">`type` = #{type}, </if>
|
<if test="type != null">`type` = #{type},</if>
|
||||||
<if test="icon != null">`icon` = #{icon}, </if>
|
<if test="icon != null">`icon` = #{icon},</if>
|
||||||
<if test="orderNum != null">`order_num` = #{orderNum}, </if>
|
<if test="orderNum != null">`order_num` = #{orderNum},</if>
|
||||||
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate}, </if>
|
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate},</if>
|
||||||
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
|
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
|
||||||
</set>
|
</set>
|
||||||
where menu_id = #{menuId}
|
where menu_id = #{menuId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="remove">
|
<delete id="remove">
|
||||||
delete from sys_menu where menu_id = #{value}
|
delete
|
||||||
</delete>
|
from sys_menu
|
||||||
|
where menu_id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<delete id="batchRemove">
|
<delete id="batchRemove">
|
||||||
delete from sys_menu where menu_id in
|
delete from sys_menu where menu_id in
|
||||||
<foreach item="menuId" collection="array" open="(" separator=","
|
<foreach item="menuId" collection="array" open="(" separator=","
|
||||||
close=")">
|
close=")">
|
||||||
#{menuId}
|
#{menuId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="listMenuByUserId" resultType="com.java2nb.system.domain.MenuDO">
|
<select id="listMenuByUserId" resultType="com.java2nb.system.domain.MenuDO">
|
||||||
select distinct
|
select m.menu_id,
|
||||||
m.menu_id , parent_id, name, url,
|
parent_id,
|
||||||
perms,`type`,icon,order_num,gmt_create, gmt_modified
|
name,
|
||||||
from sys_menu m
|
url,
|
||||||
left
|
perms,
|
||||||
join sys_role_menu rm on m.menu_id = rm.menu_id left join
|
`type`,
|
||||||
sys_user_role ur
|
icon,
|
||||||
on rm.role_id =ur.role_id where ur.user_id = #{id}
|
order_num,
|
||||||
and
|
gmt_create,
|
||||||
m.type in(0,1)
|
gmt_modified
|
||||||
order by
|
from sys_menu m
|
||||||
m.order_num
|
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||||
</select>
|
left join
|
||||||
|
sys_user_role ur
|
||||||
|
on rm.role_id = ur.role_id
|
||||||
|
where ur.user_id = #{id}
|
||||||
|
and m.type in (0, 1)
|
||||||
|
order by m.order_num
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="listUserPerms" resultType="string">
|
<select id="listUserPerms" resultType="string">
|
||||||
select distinct m.perms
|
select m.perms
|
||||||
from sys_menu m left join
|
from sys_menu m
|
||||||
sys_role_menu rm on m.menu_id = rm.menu_id
|
left join
|
||||||
left join sys_user_role ur
|
sys_role_menu rm on m.menu_id = rm.menu_id
|
||||||
on rm.role_id = ur.role_id where ur.user_id
|
left join sys_user_role ur
|
||||||
= #{id}
|
on rm.role_id = ur.role_id
|
||||||
</select>
|
where ur.user_id
|
||||||
|
= #{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -4,8 +4,28 @@
|
|||||||
<mapper namespace="com.java2nb.system.dao.SysUserDao">
|
<mapper namespace="com.java2nb.system.dao.SysUserDao">
|
||||||
|
|
||||||
<select id="get" resultType="com.java2nb.system.domain.UserDO">
|
<select id="get" resultType="com.java2nb.system.domain.UserDO">
|
||||||
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district` from sys_user where user_id = #{value}
|
select `user_id`,
|
||||||
</select>
|
`username`,
|
||||||
|
`name`,
|
||||||
|
`password`,
|
||||||
|
`dept_id`,
|
||||||
|
`email`,
|
||||||
|
`mobile`,
|
||||||
|
`status`,
|
||||||
|
`user_id_create`,
|
||||||
|
`gmt_create`,
|
||||||
|
`gmt_modified`,
|
||||||
|
`sex`,
|
||||||
|
`birth`,
|
||||||
|
`pic_id`,
|
||||||
|
`live_address`,
|
||||||
|
`hobby`,
|
||||||
|
`province`,
|
||||||
|
`city`,
|
||||||
|
`district`
|
||||||
|
from sys_user
|
||||||
|
where user_id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="list" resultType="com.java2nb.system.domain.UserDO">
|
<select id="list" resultType="com.java2nb.system.domain.UserDO">
|
||||||
select
|
select
|
||||||
@ -51,7 +71,8 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="listByPerm" resultType="com.java2nb.system.domain.UserDO">
|
<select id="listByPerm" resultType="com.java2nb.system.domain.UserDO">
|
||||||
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
select
|
||||||
|
`user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
||||||
from (
|
from (
|
||||||
select
|
select
|
||||||
`user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
`user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
||||||
@ -97,7 +118,8 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="countByPerm" resultType="int">
|
<select id="countByPerm" resultType="int">
|
||||||
select count(*) from (
|
select count(*) from (
|
||||||
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
select
|
||||||
|
`user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
|
||||||
from sys_user
|
from sys_user
|
||||||
<where>
|
<where>
|
||||||
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
|
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
|
||||||
@ -149,49 +171,44 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="save" parameterType="com.java2nb.system.domain.UserDO" useGeneratedKeys="true" keyProperty="userId">
|
<insert id="save" parameterType="com.java2nb.system.domain.UserDO" useGeneratedKeys="true" keyProperty="userId">
|
||||||
insert into sys_user
|
insert into sys_user
|
||||||
(
|
(`username`,
|
||||||
`username`,
|
`name`,
|
||||||
`name`,
|
`password`,
|
||||||
`password`,
|
`dept_id`,
|
||||||
`dept_id`,
|
`email`,
|
||||||
`email`,
|
`mobile`,
|
||||||
`mobile`,
|
`status`,
|
||||||
`status`,
|
`user_id_create`,
|
||||||
`user_id_create`,
|
`gmt_create`,
|
||||||
`gmt_create`,
|
`gmt_modified`,
|
||||||
`gmt_modified`,
|
`sex`,
|
||||||
`sex`,
|
`birth`,
|
||||||
`birth`,
|
`pic_id`,
|
||||||
`pic_id`,
|
`live_address`,
|
||||||
`live_address`,
|
`hobby`,
|
||||||
`hobby`,
|
`province`,
|
||||||
`province`,
|
`city`,
|
||||||
`city`,
|
`district`)
|
||||||
`district`
|
values (#{username},
|
||||||
)
|
#{name},
|
||||||
values
|
#{password},
|
||||||
(
|
#{deptId},
|
||||||
#{username},
|
#{email},
|
||||||
#{name},
|
#{mobile},
|
||||||
#{password},
|
#{status},
|
||||||
#{deptId},
|
#{userIdCreate},
|
||||||
#{email},
|
#{gmtCreate},
|
||||||
#{mobile},
|
#{gmtModified},
|
||||||
#{status},
|
#{sex},
|
||||||
#{userIdCreate},
|
#{birth},
|
||||||
#{gmtCreate},
|
#{picId},
|
||||||
#{gmtModified},
|
#{liveAddress},
|
||||||
#{sex},
|
#{hobby},
|
||||||
#{birth},
|
#{province},
|
||||||
#{picId},
|
#{city},
|
||||||
#{liveAddress},
|
#{district})
|
||||||
#{hobby},
|
</insert>
|
||||||
#{province},
|
|
||||||
#{city},
|
|
||||||
#{district}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="update" parameterType="com.java2nb.system.domain.UserDO">
|
<update id="update" parameterType="com.java2nb.system.domain.UserDO">
|
||||||
update sys_user
|
update sys_user
|
||||||
@ -219,8 +236,10 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="remove">
|
<delete id="remove">
|
||||||
delete from sys_user where user_id = #{value}
|
delete
|
||||||
</delete>
|
from sys_user
|
||||||
|
where user_id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<delete id="batchRemove">
|
<delete id="batchRemove">
|
||||||
delete from sys_user where user_id in
|
delete from sys_user where user_id in
|
||||||
@ -230,7 +249,8 @@
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="listAllDept" resultType="long">
|
<select id="listAllDept" resultType="long">
|
||||||
select DISTINCT dept_id from sys_user
|
select dept_id
|
||||||
</select>
|
from sys_user
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -59,220 +59,103 @@ function load() {
|
|||||||
return arguments[2] + 1;
|
return arguments[2] + 1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
field: 'id',
|
{
|
||||||
title: '主键'
|
field: 'workDirection',
|
||||||
},
|
title: '作品方向',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return value === 0 ? '男频' : '女频';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'catName',
|
||||||
|
title: '分类名'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'bookName',
|
||||||
|
title: '小说名'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'authorName',
|
||||||
|
title: '作者名'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'bookStatus',
|
||||||
|
title: '书籍状态',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return value === 0 ? '连载中' : '已完结';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'visitCount',
|
||||||
|
title: '点击量'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'wordCount',
|
||||||
|
title: '总字数'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'commentCount',
|
||||||
|
title: '评论数'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'yesterdayBuy',
|
||||||
|
title: '昨日订阅数'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'lastIndexName',
|
||||||
|
title: '最新章节'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'workDirection',
|
field: 'lastIndexUpdateTime',
|
||||||
title: '作品方向,0:男频,1:女频'
|
title: '最新章节更新时间'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'catId',
|
field: 'isVip',
|
||||||
title: '分类ID'
|
title: '是否收费',
|
||||||
},
|
formatter: function (value, row, index) {
|
||||||
|
return value === 1 ? '收费' : '免费';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '入库时间'
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'catName',
|
|
||||||
title: '分类名'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'catChildId',
|
|
||||||
title: '子分类ID'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'catChildName',
|
|
||||||
title: '子分类名'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'picUrl',
|
|
||||||
title: '小说封面'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'bookName',
|
|
||||||
title: '小说名'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'heroName',
|
|
||||||
title: '男主角姓名'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'ladyName',
|
|
||||||
title: '女主角姓名'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'bookStyle',
|
|
||||||
title: '作品风格,0:甜宠,1:虐恋,2:其他'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'bookLabel',
|
|
||||||
title: '作品标签'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'authorId',
|
|
||||||
title: '作者id'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'authorName',
|
|
||||||
title: '作者名'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'bookDesc',
|
|
||||||
title: '书籍描述'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'score',
|
|
||||||
title: '评分,预留字段'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'bookStatus',
|
|
||||||
title: '书籍状态,0:连载中,1:已完结'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'visitCount',
|
|
||||||
title: '点击量'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'wordCount',
|
|
||||||
title: '总字数'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'commentCount',
|
|
||||||
title: '评论数'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'yesterdayBuy',
|
|
||||||
title: '昨日订阅数'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'lastIndexId',
|
|
||||||
title: '最新目录ID'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'lastIndexName',
|
|
||||||
title: '最新目录名'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'lastIndexUpdateTime',
|
|
||||||
title: '最新目录更新时间'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'isVip',
|
|
||||||
title: '是否收费,1:收费,0:免费'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'status',
|
|
||||||
title: '状态,0:入库,1:上架'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'updateTime',
|
|
||||||
title: '更新时间'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'createTime',
|
|
||||||
title: '创建时间'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'crawlSourceId',
|
|
||||||
title: '爬虫源站ID'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'crawlBookId',
|
|
||||||
title: '抓取的源站小说ID'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'crawlLastTime',
|
|
||||||
title: '最后一次的抓取时间'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'crawlIsStop',
|
|
||||||
title: '是否已停止更新,0:未停止,1:已停止'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
title: '操作',
|
title: '操作',
|
||||||
field: 'id',
|
field: 'id',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
|
||||||
+ row.id
|
|
||||||
+ '\')"><i class="fa fa-file"></i></a> ';
|
|
||||||
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
|
||||||
+ row.id
|
|
||||||
+ '\')"><i class="fa fa-edit"></i></a> ';
|
|
||||||
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
+ row.id
|
+ row.id
|
||||||
+ '\')"><i class="fa fa-remove"></i></a> ';
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
return d + e + r;
|
return r;
|
||||||
}
|
}
|
||||||
}]
|
}
|
||||||
|
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function reLoad() {
|
function reLoad() {
|
||||||
$('#exampleTable').bootstrapTable('refresh');
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
}
|
}
|
||||||
|
|
||||||
function add() {
|
function add() {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -283,6 +166,7 @@ function add() {
|
|||||||
content: prefix + '/add' // iframe的url
|
content: prefix + '/add' // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function detail(id) {
|
function detail(id) {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -293,6 +177,7 @@ function detail(id) {
|
|||||||
content: prefix + '/detail/' + id // iframe的url
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit(id) {
|
function edit(id) {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -303,6 +188,7 @@ function edit(id) {
|
|||||||
content: prefix + '/edit/' + id // iframe的url
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(id) {
|
function remove(id) {
|
||||||
layer.confirm('确定要删除选中的记录?', {
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
btn: ['确定', '取消']
|
btn: ['确定', '取消']
|
||||||
@ -327,6 +213,7 @@ function remove(id) {
|
|||||||
|
|
||||||
function resetPwd(id) {
|
function resetPwd(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function batchRemove() {
|
function batchRemove() {
|
||||||
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
if (rows.length == 0) {
|
if (rows.length == 0) {
|
||||||
|
@ -0,0 +1,107 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function save() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/bookComment/save",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,201 @@
|
|||||||
|
var prefix = "/novel/bookComment"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'bookName',
|
||||||
|
title: '评论小说'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'commentContent',
|
||||||
|
title: '评论内容'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '评论时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'userName',
|
||||||
|
title: '评论人'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return d + e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/bookComment/update",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,107 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function save() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/bookContent/save",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,189 @@
|
|||||||
|
var prefix = "/novel/bookContent"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '主键'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'indexId',
|
||||||
|
title: '目录ID'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'content',
|
||||||
|
title: '小说章节内容'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return d + e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/bookContent/update",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,107 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function save() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/bookIndex/save",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,231 @@
|
|||||||
|
var prefix = "/novel/bookIndex"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '主键'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'bookId',
|
||||||
|
title: '小说ID'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'indexNum',
|
||||||
|
title: '目录号'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'indexName',
|
||||||
|
title: '目录名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'wordCount',
|
||||||
|
title: '字数'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'isVip',
|
||||||
|
title: '是否收费,1:收费,0:免费'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'bookPrice',
|
||||||
|
title: '章节费用(屋币)'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'storageType',
|
||||||
|
title: '存储方式'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: ''
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'updateTime',
|
||||||
|
title: ''
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return d + e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/bookIndex/update",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,107 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function save() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/friendLink/save",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/friendLink/update",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,205 @@
|
|||||||
|
var prefix = "/novel/friendLink"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'linkName',
|
||||||
|
title: '链接名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'linkUrl',
|
||||||
|
title: '链接url'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'sort',
|
||||||
|
title: '排序号'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'isOpen',
|
||||||
|
title: '是否开启',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return formatDict("yes_no", value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return d + e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
@ -59,82 +59,50 @@ function load() {
|
|||||||
return arguments[2] + 1;
|
return arguments[2] + 1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
field: 'id',
|
{
|
||||||
title: '主键'
|
field: 'outTradeNo',
|
||||||
},
|
title: '订单号'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'outTradeNo',
|
field: 'totalAmount',
|
||||||
title: '保留'
|
title: '充值金额',
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'tradeNo',
|
|
||||||
title: '订单号'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'payChannel',
|
|
||||||
title: '保留'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'totalAmount',
|
|
||||||
title: '交易香蕉币'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'userId',
|
|
||||||
title: '支付用户ID'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'payStatus',
|
|
||||||
title: '支付状态:0:支付失败,1:支付成功,2:待支付'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'createTime',
|
|
||||||
title: '创建时间'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'updateTime',
|
|
||||||
title: '更新时间'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
field: 'id',
|
|
||||||
align: 'center',
|
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
return '¥' + value;
|
||||||
+ row.id
|
|
||||||
+ '\')"><i class="fa fa-file"></i></a> ';
|
|
||||||
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
|
||||||
+ row.id
|
|
||||||
+ '\')"><i class="fa fa-edit"></i></a> ';
|
|
||||||
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
|
||||||
+ row.id
|
|
||||||
+ '\')"><i class="fa fa-remove"></i></a> ';
|
|
||||||
return d + e + r;
|
|
||||||
}
|
}
|
||||||
}]
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'userName',
|
||||||
|
title: '充值用户'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'payStatus',
|
||||||
|
title: '状态',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return value === 0 ? '充值失败' : value === 1 ? '充值成功' : value === 2 ? '待支付' : '其它';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function reLoad() {
|
function reLoad() {
|
||||||
$('#exampleTable').bootstrapTable('refresh');
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
}
|
}
|
||||||
|
|
||||||
function add() {
|
function add() {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -145,6 +113,7 @@ function add() {
|
|||||||
content: prefix + '/add' // iframe的url
|
content: prefix + '/add' // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function detail(id) {
|
function detail(id) {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -155,6 +124,7 @@ function detail(id) {
|
|||||||
content: prefix + '/detail/' + id // iframe的url
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit(id) {
|
function edit(id) {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -165,6 +135,7 @@ function edit(id) {
|
|||||||
content: prefix + '/edit/' + id // iframe的url
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(id) {
|
function remove(id) {
|
||||||
layer.confirm('确定要删除选中的记录?', {
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
btn: ['确定', '取消']
|
btn: ['确定', '取消']
|
||||||
@ -189,6 +160,7 @@ function remove(id) {
|
|||||||
|
|
||||||
function resetPwd(id) {
|
function resetPwd(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function batchRemove() {
|
function batchRemove() {
|
||||||
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
if (rows.length == 0) {
|
if (rows.length == 0) {
|
||||||
|
@ -59,88 +59,47 @@ function load() {
|
|||||||
return arguments[2] + 1;
|
return arguments[2] + 1;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
field: 'id',
|
|
||||||
title: '主键'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'username',
|
||||||
|
title: '手机号'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'nickName',
|
||||||
|
title: '昵称'
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'username',
|
field: 'userSex',
|
||||||
title: '登录名'
|
title: '用户性别',
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'password',
|
|
||||||
title: '登录密码'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'nickName',
|
|
||||||
title: '昵称'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'userPhoto',
|
|
||||||
title: '用户头像'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'userSex',
|
|
||||||
title: '用户性别,0:男,1:女'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'accountBalance',
|
|
||||||
title: '账户余额'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'status',
|
|
||||||
title: '用户状态,0:正常'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'createTime',
|
|
||||||
title: '创建时间'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
field: 'updateTime',
|
|
||||||
title: '更新时间'
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
field: 'id',
|
|
||||||
align: 'center',
|
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
return value === 0 ? '男' : value === 1 ? '女' : '未知';
|
||||||
+ row.id
|
|
||||||
+ '\')"><i class="fa fa-file"></i></a> ';
|
|
||||||
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
|
||||||
+ row.id
|
|
||||||
+ '\')"><i class="fa fa-edit"></i></a> ';
|
|
||||||
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
|
||||||
+ row.id
|
|
||||||
+ '\')"><i class="fa fa-remove"></i></a> ';
|
|
||||||
return d + e + r;
|
|
||||||
}
|
}
|
||||||
}]
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'accountBalance',
|
||||||
|
title: '账户余额',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return "¥" + value / 100;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '注册时间'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function reLoad() {
|
function reLoad() {
|
||||||
$('#exampleTable').bootstrapTable('refresh');
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
}
|
}
|
||||||
|
|
||||||
function add() {
|
function add() {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -151,6 +110,7 @@ function add() {
|
|||||||
content: prefix + '/add' // iframe的url
|
content: prefix + '/add' // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function detail(id) {
|
function detail(id) {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -161,6 +121,7 @@ function detail(id) {
|
|||||||
content: prefix + '/detail/' + id // iframe的url
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit(id) {
|
function edit(id) {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
@ -171,6 +132,7 @@ function edit(id) {
|
|||||||
content: prefix + '/edit/' + id // iframe的url
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(id) {
|
function remove(id) {
|
||||||
layer.confirm('确定要删除选中的记录?', {
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
btn: ['确定', '取消']
|
btn: ['确定', '取消']
|
||||||
@ -195,6 +157,7 @@ function remove(id) {
|
|||||||
|
|
||||||
function resetPwd(id) {
|
function resetPwd(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function batchRemove() {
|
function batchRemove() {
|
||||||
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
if (rows.length == 0) {
|
if (rows.length == 0) {
|
||||||
|
@ -0,0 +1,99 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/websiteInfo/update",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
layer.msg("操作成功");
|
||||||
|
} else {
|
||||||
|
layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {},
|
||||||
|
messages: {}
|
||||||
|
})
|
||||||
|
}
|
@ -1,18 +0,0 @@
|
|||||||
-- 菜单SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
VALUES ('1', '作者表', 'novel/author', 'novel:author:author', '1', 'fa', '6');
|
|
||||||
|
|
||||||
-- 按钮父菜单ID
|
|
||||||
set @parentId = @@identity;
|
|
||||||
|
|
||||||
-- 菜单对应按钮SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '查看', null, 'novel:author:detail', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '新增', null, 'novel:author:add', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '修改', null, 'novel:author:edit', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '删除', null, 'novel:author:remove', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '批量删除', null, 'novel:author:batchRemove', '2', null, '6';
|
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
-- 菜单SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
VALUES ('1', '作家邀请码表', 'novel/authorCode', 'novel:authorCode:authorCode', '1', 'fa', '6');
|
|
||||||
|
|
||||||
-- 按钮父菜单ID
|
|
||||||
set @parentId = @@identity;
|
|
||||||
|
|
||||||
-- 菜单对应按钮SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '查看', null, 'novel:authorCode:detail', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '新增', null, 'novel:authorCode:add', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '修改', null, 'novel:authorCode:edit', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '删除', null, 'novel:authorCode:remove', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '批量删除', null, 'novel:authorCode:batchRemove', '2', null, '6';
|
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
-- 菜单SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
VALUES ('1', '小说表', 'novel/book', 'novel:book:book', '1', 'fa', '6');
|
|
||||||
|
|
||||||
-- 按钮父菜单ID
|
|
||||||
set @parentId = @@identity;
|
|
||||||
|
|
||||||
-- 菜单对应按钮SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '查看', null, 'novel:book:detail', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '新增', null, 'novel:book:add', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '修改', null, 'novel:book:edit', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '删除', null, 'novel:book:remove', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '批量删除', null, 'novel:book:batchRemove', '2', null, '6';
|
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
-- 菜单SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES ('1', '小说评论表', 'novel/bookComment', 'novel:bookComment:bookComment', '1', 'fa', '6');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
set @parentId = @@identity;
|
||||||
|
|
||||||
|
-- 菜单对应按钮SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '查看', null, 'novel:bookComment:detail', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '新增', null, 'novel:bookComment:add', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '修改', null, 'novel:bookComment:edit', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '删除', null, 'novel:bookComment:remove', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '批量删除', null, 'novel:bookComment:batchRemove', '2', null, '6';
|
@ -0,0 +1,18 @@
|
|||||||
|
-- 菜单SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES ('1', '小说内容表', 'novel/bookContent', 'novel:bookContent:bookContent', '1', 'fa', '6');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
set @parentId = @@identity;
|
||||||
|
|
||||||
|
-- 菜单对应按钮SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '查看', null, 'novel:bookContent:detail', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '新增', null, 'novel:bookContent:add', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '修改', null, 'novel:bookContent:edit', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '删除', null, 'novel:bookContent:remove', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '批量删除', null, 'novel:bookContent:batchRemove', '2', null, '6';
|
@ -0,0 +1,18 @@
|
|||||||
|
-- 菜单SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES ('1', '小说目录表', 'novel/bookIndex', 'novel:bookIndex:bookIndex', '1', 'fa', '6');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
set @parentId = @@identity;
|
||||||
|
|
||||||
|
-- 菜单对应按钮SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '查看', null, 'novel:bookIndex:detail', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '新增', null, 'novel:bookIndex:add', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '修改', null, 'novel:bookIndex:edit', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '删除', null, 'novel:bookIndex:remove', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '批量删除', null, 'novel:bookIndex:batchRemove', '2', null, '6';
|
@ -1,18 +0,0 @@
|
|||||||
-- 菜单SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
VALUES ('1', '新闻类别表', 'novel/category', 'novel:category:category', '1', 'fa', '6');
|
|
||||||
|
|
||||||
-- 按钮父菜单ID
|
|
||||||
set @parentId = @@identity;
|
|
||||||
|
|
||||||
-- 菜单对应按钮SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '查看', null, 'novel:category:detail', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '新增', null, 'novel:category:add', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '修改', null, 'novel:category:edit', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '删除', null, 'novel:category:remove', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '批量删除', null, 'novel:category:batchRemove', '2', null, '6';
|
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
-- 菜单SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES ('1', '', 'novel/friendLink', 'novel:friendLink:friendLink', '1', 'fa', '6');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
set @parentId = @@identity;
|
||||||
|
|
||||||
|
-- 菜单对应按钮SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '查看', null, 'novel:friendLink:detail', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '新增', null, 'novel:friendLink:add', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '修改', null, 'novel:friendLink:edit', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '删除', null, 'novel:friendLink:remove', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '批量删除', null, 'novel:friendLink:batchRemove', '2', null, '6';
|
@ -1,18 +0,0 @@
|
|||||||
-- 菜单SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
VALUES ('1', '新闻表', 'novel/news', 'novel:news:news', '1', 'fa', '6');
|
|
||||||
|
|
||||||
-- 按钮父菜单ID
|
|
||||||
set @parentId = @@identity;
|
|
||||||
|
|
||||||
-- 菜单对应按钮SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '查看', null, 'novel:news:detail', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '新增', null, 'novel:news:add', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '修改', null, 'novel:news:edit', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '删除', null, 'novel:news:remove', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '批量删除', null, 'novel:news:batchRemove', '2', null, '6';
|
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
-- 菜单SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
VALUES ('1', '充值订单', 'novel/pay', 'novel:pay:pay', '1', 'fa', '6');
|
|
||||||
|
|
||||||
-- 按钮父菜单ID
|
|
||||||
set @parentId = @@identity;
|
|
||||||
|
|
||||||
-- 菜单对应按钮SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '查看', null, 'novel:pay:detail', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '新增', null, 'novel:pay:add', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '修改', null, 'novel:pay:edit', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '删除', null, 'novel:pay:remove', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '批量删除', null, 'novel:pay:batchRemove', '2', null, '6';
|
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
-- 菜单SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
VALUES ('1', '', 'novel/user', 'novel:user:user', '1', 'fa', '6');
|
|
||||||
|
|
||||||
-- 按钮父菜单ID
|
|
||||||
set @parentId = @@identity;
|
|
||||||
|
|
||||||
-- 菜单对应按钮SQL
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '查看', null, 'novel:user:detail', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '新增', null, 'novel:user:add', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '修改', null, 'novel:user:edit', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '删除', null, 'novel:user:remove', '2', null, '6';
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
|
||||||
SELECT @parentId, '批量删除', null, 'novel:user:batchRemove', '2', null, '6';
|
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
--菜单SQL
|
||||||
|
INSERT
|
||||||
|
INTO`sys_menu`(`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES('247', '网站信息表', 'novel/websiteInfo', 'novel:websiteInfo:websiteInfo', '1', 'fa', '6');
|
||||||
|
|
||||||
|
--按钮父菜单ID
|
||||||
|
set
|
||||||
|
@parentId
|
||||||
|
= @@identity;
|
||||||
|
|
||||||
|
--菜单对应按钮SQL
|
||||||
|
INSERT
|
||||||
|
INTO`sys_menu`(`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT
|
||||||
|
@parentId,
|
||||||
|
'查看', null, 'novel:websiteInfo:detail', '2', null, '6';
|
||||||
|
INSERT
|
||||||
|
INTO`sys_menu`(`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT
|
||||||
|
@parentId,
|
||||||
|
'新增', null, 'novel:websiteInfo:add', '2', null, '6';
|
||||||
|
INSERT
|
||||||
|
INTO`sys_menu`(`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT
|
||||||
|
@parentId,
|
||||||
|
'修改', null, 'novel:websiteInfo:edit', '2', null, '6';
|
||||||
|
INSERT
|
||||||
|
INTO`sys_menu`(`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT
|
||||||
|
@parentId,
|
||||||
|
'删除', null, 'novel:websiteInfo:remove', '2', null, '6';
|
||||||
|
INSERT
|
||||||
|
INTO`sys_menu`(`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT
|
||||||
|
@parentId,
|
||||||
|
'批量删除', null, 'novel:websiteInfo:batchRemove', '2', null, '6';
|
@ -10,28 +10,142 @@
|
|||||||
<link rel="stylesheet" href="/layuimini/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
|
<link rel="stylesheet" href="/layuimini/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
|
||||||
<link rel="stylesheet" href="/layuimini/css/public.css" media="all">
|
<link rel="stylesheet" href="/layuimini/css/public.css" media="all">
|
||||||
<style>
|
<style>
|
||||||
.layui-card {border:1px solid #f2f2f2;border-radius:5px;}
|
.layui-card {
|
||||||
.icon {margin-right:10px;color:#1aa094;}
|
border: 1px solid #f2f2f2;
|
||||||
.icon-cray {color:#ffb800!important;}
|
border-radius: 5px;
|
||||||
.icon-blue {color:#1e9fff!important;}
|
}
|
||||||
.icon-tip {color:#ff5722!important;}
|
|
||||||
.layuimini-qiuck-module {text-align:center;margin-top: 10px}
|
.icon {
|
||||||
.layuimini-qiuck-module a i {display:inline-block;width:100%;height:60px;line-height:60px;text-align:center;border-radius:2px;font-size:30px;background-color:#F8F8F8;color:#333;transition:all .3s;-webkit-transition:all .3s;}
|
margin-right: 10px;
|
||||||
.layuimini-qiuck-module a cite {position:relative;top:2px;display:block;color:#666;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px;}
|
color: #1aa094;
|
||||||
.welcome-module {width:100%;height:210px;}
|
}
|
||||||
.panel {background-color:#fff;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}
|
|
||||||
.panel-body {padding:10px}
|
.icon-cray {
|
||||||
.panel-title {margin-top:0;margin-bottom:0;font-size:12px;color:inherit}
|
color: #ffb800 !important;
|
||||||
.label {display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;margin-top: .3em;}
|
}
|
||||||
.layui-red {color:red}
|
|
||||||
.main_btn > p {height:40px;}
|
.icon-blue {
|
||||||
.layui-bg-number {background-color:#F8F8F8;}
|
color: #1e9fff !important;
|
||||||
.layuimini-notice:hover {background:#f6f6f6;}
|
}
|
||||||
.layuimini-notice {padding:7px 16px;clear:both;font-size:12px !important;cursor:pointer;position:relative;transition:background 0.2s ease-in-out;}
|
|
||||||
.layuimini-notice-title,.layuimini-notice-label {
|
.icon-tip {
|
||||||
padding-right: 70px !important;text-overflow:ellipsis!important;overflow:hidden!important;white-space:nowrap!important;}
|
color: #ff5722 !important;
|
||||||
.layuimini-notice-title {line-height:28px;font-size:14px;}
|
}
|
||||||
.layuimini-notice-extra {position:absolute;top:50%;margin-top:-8px;right:16px;display:inline-block;height:16px;color:#999;}
|
|
||||||
|
.layuimini-qiuck-module {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.layuimini-qiuck-module a i {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
height: 60px;
|
||||||
|
line-height: 60px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-size: 30px;
|
||||||
|
background-color: #F8F8F8;
|
||||||
|
color: #333;
|
||||||
|
transition: all .3s;
|
||||||
|
-webkit-transition: all .3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layuimini-qiuck-module a cite {
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
display: block;
|
||||||
|
color: #666;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-module {
|
||||||
|
width: 100%;
|
||||||
|
height: 210px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
background-color: #fff;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 3px;
|
||||||
|
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
|
||||||
|
box-shadow: 0 1px 1px rgba(0, 0, 0, .05)
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-body {
|
||||||
|
padding: 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-title {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
font-size: 12px;
|
||||||
|
color: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
display: inline;
|
||||||
|
padding: .2em .6em .3em;
|
||||||
|
font-size: 75%;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
vertical-align: baseline;
|
||||||
|
border-radius: .25em;
|
||||||
|
margin-top: .3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layui-red {
|
||||||
|
color: red
|
||||||
|
}
|
||||||
|
|
||||||
|
.main_btn > p {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layui-bg-number {
|
||||||
|
background-color: #F8F8F8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layuimini-notice:hover {
|
||||||
|
background: #f6f6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layuimini-notice {
|
||||||
|
padding: 7px 16px;
|
||||||
|
clear: both;
|
||||||
|
font-size: 12px !important;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
transition: background 0.2s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layuimini-notice-title, .layuimini-notice-label {
|
||||||
|
padding-right: 70px !important;
|
||||||
|
text-overflow: ellipsis !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layuimini-notice-title {
|
||||||
|
line-height: 28px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layuimini-notice-extra {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -8px;
|
||||||
|
right: 16px;
|
||||||
|
display: inline-block;
|
||||||
|
height: 16px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -133,7 +247,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>项目名称</td>
|
<td>项目名称</td>
|
||||||
<td>
|
<td>
|
||||||
小说精品屋
|
novel
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -142,21 +256,25 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>主要特色</td>
|
<td>主要特色</td>
|
||||||
<td>小说 / 漫画 / 自适应 / 弹幕 / 采集</td>
|
<td>Spring Boot 3 / Vue 3 / 项目实战 / 保姆级教程</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>下载地址</td>
|
<td>下载地址</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="https://gitee.com/novel_dev_team/fiction_house" target="_blank">Gitee</a> /
|
<a href="https://gitee.com/novel_dev_team/novel" target="_blank">Gitee</a> /
|
||||||
<a href="https://github.com/201206030/fiction_house" target="_blank">Github</a>
|
<a href="https://github.com/201206030/novel" target="_blank">Github</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Gitee</td>
|
<td>Gitee</td>
|
||||||
<td style="padding-bottom: 0;">
|
<td style="padding-bottom: 0;">
|
||||||
<div class="layui-btn-container">
|
<div class="layui-btn-container">
|
||||||
<a href='https://gitee.com/novel_dev_team/fiction_house/stargazers'><img src='https://gitee.com/novel_dev_team/fiction_house/badge/star.svg?theme=dark' alt='star'></img></a>
|
<a href='https://gitee.com/novel_dev_team/novel/stargazers'><img
|
||||||
<a href='https://gitee.com/novel_dev_team/fiction_house/members'><img src='https://gitee.com/novel_dev_team/fiction_house/badge/fork.svg?theme=dark' alt='fork'></img></a>
|
src='https://gitee.com/novel_dev_team/novel/badge/star.svg?theme=dark'
|
||||||
|
alt='star'></img></a>
|
||||||
|
<a href='https://gitee.com/novel_dev_team/novel/members'><img
|
||||||
|
src='https://gitee.com/novel_dev_team/novel/badge/fork.svg?theme=dark'
|
||||||
|
alt='fork'></img></a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -164,8 +282,10 @@
|
|||||||
<td>Github</td>
|
<td>Github</td>
|
||||||
<td style="padding-bottom: 0;">
|
<td style="padding-bottom: 0;">
|
||||||
<div class="layui-btn-container">
|
<div class="layui-btn-container">
|
||||||
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=fiction_house&type=star&count=true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
|
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=novel&type=star&count=true"
|
||||||
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=fiction_house&type=fork&count=true" frameborder="0" scrolling="0" width="101px" height="20px"></iframe>
|
frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
|
||||||
|
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=novel&type=fork&count=true"
|
||||||
|
frameborder="0" scrolling="0" width="101px" height="20px"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -186,7 +306,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>项目名称</td>
|
<td>项目名称</td>
|
||||||
<td>
|
<td>
|
||||||
小说精品屋-plus
|
novel-plus
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -208,8 +328,12 @@
|
|||||||
<td>Gitee</td>
|
<td>Gitee</td>
|
||||||
<td style="padding-bottom: 0;">
|
<td style="padding-bottom: 0;">
|
||||||
<div class="layui-btn-container">
|
<div class="layui-btn-container">
|
||||||
<a href='https://gitee.com/novel_dev_team/novel-plus/stargazers'><img src='https://gitee.com/novel_dev_team/novel-plus/badge/star.svg?theme=dark' alt='star'></img></a>
|
<a href='https://gitee.com/novel_dev_team/novel-plus/stargazers'><img
|
||||||
<a href='https://gitee.com/novel_dev_team/novel-plus/members'><img src='https://gitee.com/novel_dev_team/novel-plus/badge/fork.svg?theme=dark' alt='fork'></img></a>
|
src='https://gitee.com/novel_dev_team/novel-plus/badge/star.svg?theme=dark'
|
||||||
|
alt='star'></img></a>
|
||||||
|
<a href='https://gitee.com/novel_dev_team/novel-plus/members'><img
|
||||||
|
src='https://gitee.com/novel_dev_team/novel-plus/badge/fork.svg?theme=dark'
|
||||||
|
alt='fork'></img></a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -217,8 +341,10 @@
|
|||||||
<td>Github</td>
|
<td>Github</td>
|
||||||
<td style="padding-bottom: 0;">
|
<td style="padding-bottom: 0;">
|
||||||
<div class="layui-btn-container">
|
<div class="layui-btn-container">
|
||||||
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=novel-plus&type=star&count=true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
|
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=novel-plus&type=star&count=true"
|
||||||
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=novel-plus&type=fork&count=true" frameborder="0" scrolling="0" width="101px" height="20px"></iframe>
|
frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
|
||||||
|
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=novel-plus&type=fork&count=true"
|
||||||
|
frameborder="0" scrolling="0" width="101px" height="20px"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -239,7 +365,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>项目名称</td>
|
<td>项目名称</td>
|
||||||
<td>
|
<td>
|
||||||
小说精品屋-微服务版
|
novel-cloud
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -248,7 +374,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>主要特色</td>
|
<td>主要特色</td>
|
||||||
<td>SpringCloudAlibaba / Redis / RabbitMq / ElasticSearch / Sharding-Jdbc / Docker</td>
|
<td>微服务 / Spring Cloud 2022 / Spring Cloud Alibaba 2022</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>下载地址</td>
|
<td>下载地址</td>
|
||||||
@ -261,8 +387,12 @@
|
|||||||
<td>Gitee</td>
|
<td>Gitee</td>
|
||||||
<td style="padding-bottom: 0;">
|
<td style="padding-bottom: 0;">
|
||||||
<div class="layui-btn-container">
|
<div class="layui-btn-container">
|
||||||
<a href='https://gitee.com/novel_dev_team/novel-cloud/stargazers'><img src='https://gitee.com/novel_dev_team/novel-cloud/badge/star.svg?theme=dark' alt='star'></img></a>
|
<a href='https://gitee.com/novel_dev_team/novel-cloud/stargazers'><img
|
||||||
<a href='https://gitee.com/novel_dev_team/novel-cloud/members'><img src='https://gitee.com/novel_dev_team/novel-cloud/badge/fork.svg?theme=dark' alt='fork'></img></a>
|
src='https://gitee.com/novel_dev_team/novel-cloud/badge/star.svg?theme=dark'
|
||||||
|
alt='star'></img></a>
|
||||||
|
<a href='https://gitee.com/novel_dev_team/novel-cloud/members'><img
|
||||||
|
src='https://gitee.com/novel_dev_team/novel-cloud/badge/fork.svg?theme=dark'
|
||||||
|
alt='fork'></img></a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -270,8 +400,10 @@
|
|||||||
<td>Github</td>
|
<td>Github</td>
|
||||||
<td style="padding-bottom: 0;">
|
<td style="padding-bottom: 0;">
|
||||||
<div class="layui-btn-container">
|
<div class="layui-btn-container">
|
||||||
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=novel-cloud&type=star&count=true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
|
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=novel-cloud&type=star&count=true"
|
||||||
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=novel-cloud&type=fork&count=true" frameborder="0" scrolling="0" width="101px" height="20px"></iframe>
|
frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
|
||||||
|
<iframe src="https://ghbtns.com/github-btn.html?user=201206030&repo=novel-cloud&type=fork&count=true"
|
||||||
|
frameborder="0" scrolling="0" width="101px" height="20px"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -303,7 +435,7 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
layui.use(['layer', 'layuimini','echarts'], function () {
|
layui.use(['layer', 'layuimini', 'echarts'], function () {
|
||||||
var $ = layui.jquery,
|
var $ = layui.jquery,
|
||||||
layer = layui.layer,
|
layer = layui.layer,
|
||||||
layuimini = layui.layuimini,
|
layuimini = layui.layuimini,
|
||||||
@ -322,14 +454,14 @@
|
|||||||
'</div>\n';
|
'</div>\n';
|
||||||
parent.layer.open({
|
parent.layer.open({
|
||||||
type: 1,
|
type: 1,
|
||||||
title: '系统公告'+'<span style="float: right;right: 1px;font-size: 12px;color: #b1b3b9;margin-top: 1px">'+noticeTime+'</span>',
|
title: '系统公告' + '<span style="float: right;right: 1px;font-size: 12px;color: #b1b3b9;margin-top: 1px">' + noticeTime + '</span>',
|
||||||
area: '300px;',
|
area: '300px;',
|
||||||
shade: 0.8,
|
shade: 0.8,
|
||||||
id: 'layuimini-notice',
|
id: 'layuimini-notice',
|
||||||
btn: ['查看', '取消'],
|
btn: ['查看', '取消'],
|
||||||
btnAlign: 'c',
|
btnAlign: 'c',
|
||||||
moveType: 1,
|
moveType: 1,
|
||||||
content:html,
|
content: html,
|
||||||
success: function (layero) {
|
success: function (layero) {
|
||||||
var btn = layero.find('.layui-layer-btn');
|
var btn = layero.find('.layui-layer-btn');
|
||||||
btn.find('.layui-layer-btn0').attr({
|
btn.find('.layui-layer-btn0').attr({
|
||||||
@ -349,52 +481,51 @@
|
|||||||
data: {},
|
data: {},
|
||||||
success: function (r) {
|
success: function (r) {
|
||||||
if (r.code == 0) {
|
if (r.code == 0) {
|
||||||
var legendData = ['会员新增','作家新增','作品新增','交易新增'];
|
var legendData = ['会员新增', '作家新增', '作品新增', '交易新增'];
|
||||||
var userSeries = [
|
var userSeries = [
|
||||||
{
|
{
|
||||||
name:'会员新增',
|
name: '会员新增',
|
||||||
type:'line',
|
type: 'line',
|
||||||
data:[]
|
data: []
|
||||||
},{
|
}, {
|
||||||
name:'作家新增',
|
name: '作家新增',
|
||||||
type:'line',
|
type: 'line',
|
||||||
data:[]
|
data: []
|
||||||
},{
|
}, {
|
||||||
name:'作品新增',
|
name: '作品新增',
|
||||||
type:'line',
|
type: 'line',
|
||||||
data:[]
|
data: []
|
||||||
},{
|
}, {
|
||||||
name:'交易新增',
|
name: '交易新增',
|
||||||
type:'line',
|
type: 'line',
|
||||||
data:[]
|
data: []
|
||||||
}];
|
}];
|
||||||
var xAxisData = r.dateList;
|
var xAxisData = r.dateList;
|
||||||
var userTableSta = r.userTableSta;
|
var userTableSta = r.userTableSta;
|
||||||
for(var i = 0 ; i < xAxisData.length ; i++){
|
for (var i = 0; i < xAxisData.length; i++) {
|
||||||
userSeries[0].data[i] = userTableSta[xAxisData[i]] ? userTableSta[xAxisData[i]] : 0;
|
userSeries[0].data[i] = userTableSta[xAxisData[i]] ? userTableSta[xAxisData[i]] : 0;
|
||||||
}
|
}
|
||||||
var authorTableSta = r.authorTableSta;
|
var authorTableSta = r.authorTableSta;
|
||||||
for(var i = 0 ; i < xAxisData.length ; i++){
|
for (var i = 0; i < xAxisData.length; i++) {
|
||||||
userSeries[1].data[i] = authorTableSta[xAxisData[i]] ? authorTableSta[xAxisData[i]] : 0;
|
userSeries[1].data[i] = authorTableSta[xAxisData[i]] ? authorTableSta[xAxisData[i]] : 0;
|
||||||
}
|
}
|
||||||
var bookTableSta = r.bookTableSta;
|
var bookTableSta = r.bookTableSta;
|
||||||
for(var i = 0 ; i < xAxisData.length ; i++){
|
for (var i = 0; i < xAxisData.length; i++) {
|
||||||
userSeries[2].data[i] = bookTableSta[xAxisData[i]] ? bookTableSta[xAxisData[i]] : 0;
|
userSeries[2].data[i] = bookTableSta[xAxisData[i]] ? bookTableSta[xAxisData[i]] : 0;
|
||||||
}
|
}
|
||||||
var orderTableSta = r.orderTableSta;
|
var orderTableSta = r.orderTableSta;
|
||||||
for(var i = 0 ; i < xAxisData.length ; i++){
|
for (var i = 0; i < xAxisData.length; i++) {
|
||||||
userSeries[3].data[i] = orderTableSta[xAxisData[i]] ? orderTableSta[xAxisData[i]] : 0;
|
userSeries[3].data[i] = orderTableSta[xAxisData[i]] ? orderTableSta[xAxisData[i]] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
|
var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
|
||||||
var optionRecords = {
|
var optionRecords = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data:legendData
|
data: legendData
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '3%',
|
left: '3%',
|
||||||
@ -420,7 +551,7 @@
|
|||||||
echartsRecords.setOption(optionRecords);
|
echartsRecords.setOption(optionRecords);
|
||||||
|
|
||||||
// echarts 窗口缩放自适应
|
// echarts 窗口缩放自适应
|
||||||
window.onresize = function(){
|
window.onresize = function () {
|
||||||
echartsRecords.resize();
|
echartsRecords.resize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,294 +9,294 @@
|
|||||||
<div class="ibox float-e-margins">
|
<div class="ibox float-e-margins">
|
||||||
<div class="ibox-content">
|
<div class="ibox-content">
|
||||||
<form class="form-horizontal m-t" id="signupForm">
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">作品方向,0:男频,1:女频:</label>
|
<label class="col-sm-3 control-label">作品方向,0:男频,1:女频:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="workDirection" name="workDirection"
|
<input id="workDirection" name="workDirection"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">分类ID:</label>
|
<label class="col-sm-3 control-label">分类ID:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="catId" name="catId"
|
<input id="catId" name="catId"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">分类名:</label>
|
<label class="col-sm-3 control-label">分类名:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="catName" name="catName"
|
<input id="catName" name="catName"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">子分类ID:</label>
|
<label class="col-sm-3 control-label">子分类ID:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="catChildId" name="catChildId"
|
<input id="catChildId" name="catChildId"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">子分类名:</label>
|
<label class="col-sm-3 control-label">子分类名:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="catChildName" name="catChildName"
|
<input id="catChildName" name="catChildName"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">小说封面:</label>
|
<label class="col-sm-3 control-label">小说封面:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="picUrl" name="picUrl"
|
<input id="picUrl" name="picUrl"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">小说名:</label>
|
<label class="col-sm-3 control-label">小说名:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="bookName" name="bookName"
|
<input id="bookName" name="bookName"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">男主角姓名:</label>
|
<label class="col-sm-3 control-label">男主角姓名:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="heroName" name="heroName"
|
<input id="heroName" name="heroName"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">女主角姓名:</label>
|
<label class="col-sm-3 control-label">女主角姓名:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="ladyName" name="ladyName"
|
<input id="ladyName" name="ladyName"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">作品风格,0:甜宠,1:虐恋,2:其他:</label>
|
<label class="col-sm-3 control-label">作品风格,0:甜宠,1:虐恋,2:其他:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="bookStyle" name="bookStyle"
|
<input id="bookStyle" name="bookStyle"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">作品标签:</label>
|
<label class="col-sm-3 control-label">作品标签:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="bookLabel" name="bookLabel"
|
<input id="bookLabel" name="bookLabel"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">作者id:</label>
|
<label class="col-sm-3 control-label">作者id:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="authorId" name="authorId"
|
<input id="authorId" name="authorId"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">作者名:</label>
|
<label class="col-sm-3 control-label">作者名:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="authorName" name="authorName"
|
<input id="authorName" name="authorName"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">书籍描述:</label>
|
<label class="col-sm-3 control-label">书籍描述:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="bookDesc" name="bookDesc"
|
<input id="bookDesc" name="bookDesc"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">评分,预留字段:</label>
|
<label class="col-sm-3 control-label">评分,预留字段:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="score" name="score"
|
<input id="score" name="score"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">书籍状态,0:连载中,1:已完结:</label>
|
<label class="col-sm-3 control-label">书籍状态,0:连载中,1:已完结:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="bookStatus" name="bookStatus"
|
<input id="bookStatus" name="bookStatus"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">点击量:</label>
|
<label class="col-sm-3 control-label">点击量:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="visitCount" name="visitCount"
|
<input id="visitCount" name="visitCount"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">总字数:</label>
|
<label class="col-sm-3 control-label">总字数:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="wordCount" name="wordCount"
|
<input id="wordCount" name="wordCount"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">评论数:</label>
|
<label class="col-sm-3 control-label">评论数:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="commentCount" name="commentCount"
|
<input id="commentCount" name="commentCount"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">昨日订阅数:</label>
|
<label class="col-sm-3 control-label">昨日订阅数:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="yesterdayBuy" name="yesterdayBuy"
|
<input id="yesterdayBuy" name="yesterdayBuy"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">最新目录ID:</label>
|
<label class="col-sm-3 control-label">最新目录ID:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="lastIndexId" name="lastIndexId"
|
<input id="lastIndexId" name="lastIndexId"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">最新目录名:</label>
|
<label class="col-sm-3 control-label">最新目录名:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="lastIndexName" name="lastIndexName"
|
<input id="lastIndexName" name="lastIndexName"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">最新目录更新时间:</label>
|
<label class="col-sm-3 control-label">最新目录更新时间:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" class="laydate-icon layer-date form-control"
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
id="lastIndexUpdateTime"
|
id="lastIndexUpdateTime"
|
||||||
name="lastIndexUpdateTime"
|
name="lastIndexUpdateTime"
|
||||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||||
style="background-color: #fff;" readonly="readonly"/>
|
style="background-color: #fff;" readonly="readonly"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">是否收费,1:收费,0:免费:</label>
|
<label class="col-sm-3 control-label">是否收费,1:收费,0:免费:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="isVip" name="isVip"
|
<input id="isVip" name="isVip"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">状态,0:入库,1:上架:</label>
|
<label class="col-sm-3 control-label">状态,0:入库,1:上架:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="status" name="status"
|
<input id="status" name="status"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">更新时间:</label>
|
<label class="col-sm-3 control-label">更新时间:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" class="laydate-icon layer-date form-control"
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
id="updateTime"
|
id="updateTime"
|
||||||
name="updateTime"
|
name="updateTime"
|
||||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||||
style="background-color: #fff;" readonly="readonly"/>
|
style="background-color: #fff;" readonly="readonly"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">创建时间:</label>
|
<label class="col-sm-3 control-label">创建时间:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" class="laydate-icon layer-date form-control"
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
id="createTime"
|
id="createTime"
|
||||||
name="createTime"
|
name="createTime"
|
||||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||||
style="background-color: #fff;" readonly="readonly"/>
|
style="background-color: #fff;" readonly="readonly"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">爬虫源站ID:</label>
|
<label class="col-sm-3 control-label">爬虫源站ID:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="crawlSourceId" name="crawlSourceId"
|
<input id="crawlSourceId" name="crawlSourceId"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">抓取的源站小说ID:</label>
|
<label class="col-sm-3 control-label">抓取的源站小说ID:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="crawlBookId" name="crawlBookId"
|
<input id="crawlBookId" name="crawlBookId"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">最后一次的抓取时间:</label>
|
<label class="col-sm-3 control-label">最后一次的抓取时间:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" class="laydate-icon layer-date form-control"
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
id="crawlLastTime"
|
id="crawlLastTime"
|
||||||
name="crawlLastTime"
|
name="crawlLastTime"
|
||||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||||
style="background-color: #fff;" readonly="readonly"/>
|
style="background-color: #fff;" readonly="readonly"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">是否已停止更新,0:未停止,1:已停止:</label>
|
<label class="col-sm-3 control-label">是否已停止更新,0:未停止,1:已停止:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input id="crawlIsStop" name="crawlIsStop"
|
<input id="crawlIsStop" name="crawlIsStop"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text">
|
type="text">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-8 col-sm-offset-3">
|
<div class="col-sm-8 col-sm-offset-3">
|
||||||
<button type="submit" class="btn btn-primary">提交</button>
|
<button type="submit" class="btn btn-primary">提交</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<div class="ibox">
|
<div class="ibox">
|
||||||
<div class="ibox-body">
|
<div class="ibox-body">
|
||||||
<div class="fixed-table-toolbar">
|
<div class="fixed-table-toolbar">
|
||||||
<div class="columns pull-left">
|
<!--<div class="columns pull-left">
|
||||||
<button shiro:hasPermission="novel:book:add" type="button"
|
<button shiro:hasPermission="novel:book:add" type="button"
|
||||||
class="btn btn-primary" onclick="add()">
|
class="btn btn-primary" onclick="add()">
|
||||||
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||||
@ -18,15 +18,19 @@
|
|||||||
onclick="batchRemove()">
|
onclick="batchRemove()">
|
||||||
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>-->
|
||||||
<div class="columns pull-right">
|
<div class="columns pull-right">
|
||||||
<button class="btn btn-success" onclick="reLoad()">查询</button>
|
<button class="btn btn-success" onclick="reLoad()">查询</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="searchForm">
|
<form id="searchForm">
|
||||||
<div class="columns pull-right col-md-2">
|
<div class="columns pull-right col-md-2">
|
||||||
<input id="id" name="id" type="text" class="form-control"
|
<input id="bookName" name="bookName" type="text" class="form-control"
|
||||||
placeholder="主键">
|
placeholder="小说名">
|
||||||
|
</div>
|
||||||
|
<div class="columns pull-right col-md-2">
|
||||||
|
<input id="authorName" name="authorName" type="text" class="form-control"
|
||||||
|
placeholder="作者名">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@ -0,0 +1,84 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">小说ID:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="bookId" name="bookId"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">评价内容:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="commentContent" name="commentContent"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">回复数量:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="replyCount" name="replyCount"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">审核状态,0:待审核,1:审核通过,2:审核不通过:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="auditStatus" name="auditStatus"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">评价时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
|
id="createTime"
|
||||||
|
name="createTime"
|
||||||
|
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||||
|
style="background-color: #fff;" readonly="readonly"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">评价人:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="createUserId" name="createUserId"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-8 col-sm-offset-3">
|
||||||
|
<button type="submit" class="btn btn-primary">提交</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div th:include="include::footer"></div>
|
||||||
|
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/appjs/novel/bookComment/add.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,66 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox">
|
||||||
|
<div class="ibox-body">
|
||||||
|
<!-- <div class="fixed-table-toolbar">
|
||||||
|
<div class="columns pull-left">
|
||||||
|
<button shiro:hasPermission="novel:bookComment:add" type="button"
|
||||||
|
class="btn btn-primary" onclick="add()">
|
||||||
|
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||||
|
</button>
|
||||||
|
<button shiro:hasPermission="novel:bookComment:batchRemove" type="button"
|
||||||
|
class="btn btn-danger"
|
||||||
|
onclick="batchRemove()">
|
||||||
|
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="columns pull-right">
|
||||||
|
<button class="btn btn-success" onclick="reLoad()">查询</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form id="searchForm">
|
||||||
|
<div class="columns pull-right col-md-2">
|
||||||
|
<input id="id" name="id" type="text" class="form-control"
|
||||||
|
placeholder="主键">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>-->
|
||||||
|
<table id="exampleTable" data-mobile-responsive="true">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--shiro控制bootstraptable行内按钮看见性 -->
|
||||||
|
<div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var s_detail_h = 'hidden';
|
||||||
|
var s_edit_h = 'hidden';
|
||||||
|
var s_remove_h = 'hidden';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="test:order:detail">
|
||||||
|
<script type="text/javascript">
|
||||||
|
s_detail_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="novel:bookComment:edit">
|
||||||
|
<script type="text/javascript">
|
||||||
|
s_edit_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="novel:bookComment:remove">
|
||||||
|
<script type="text/javascript">
|
||||||
|
var s_remove_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div th:include="include :: footer"></div>
|
||||||
|
<script type="text/javascript" src="/js/appjs/novel/bookComment/bookComment.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,81 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
|
<input id="id" name="id" th:value="${bookComment.id}"
|
||||||
|
type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">小说ID:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${bookComment.bookId}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">评价内容:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${bookComment.commentContent}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">回复数量:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${bookComment.replyCount}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">审核状态,0:待审核,1:审核通过,2:审核不通过:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${bookComment.auditStatus}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">评价时间:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${bookComment.createTime}==null?null:${#dates.format(bookComment.createTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">评价人:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${bookComment.createUserId}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div th:include="include::footer"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user