From 9f23f817b19ac1a1a092cf3727c724993f806031 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <1179705413@qq.com> Date: Fri, 14 Apr 2023 18:07:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=8E=E5=8F=B0=E5=B0=8F=E8=AF=B4?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/sql/20230413.sql | 15 +- doc/sql/novel_plus.sql | 14 +- .../java/com/java2nb/novel/domain/BookDO.java | 914 +++++++++--------- .../resources/mybatis/novel/BookMapper.xml | 563 ++++++----- .../static/js/appjs/novel/book/book.js | 287 ++---- .../src/main/resources/templates/main.html | 265 +++-- .../resources/templates/novel/book/add.html | 576 +++++------ .../resources/templates/novel/book/book.html | 12 +- 8 files changed, 1313 insertions(+), 1333 deletions(-) diff --git a/doc/sql/20230413.sql b/doc/sql/20230413.sql index 3338d31..b192788 100644 --- a/doc/sql/20230413.sql +++ b/doc/sql/20230413.sql @@ -89,4 +89,17 @@ 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); \ No newline at end of file +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); \ No newline at end of file diff --git a/doc/sql/novel_plus.sql b/doc/sql/novel_plus.sql index d650bb0..24d0112 100644 --- a/doc/sql/novel_plus.sql +++ b/doc/sql/novel_plus.sql @@ -2919,4 +2919,16 @@ 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); \ No newline at end of file +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); \ No newline at end of file diff --git a/novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java b/novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java index 4df2055..a708fca 100644 --- a/novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java +++ b/novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java @@ -1,493 +1,455 @@ 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; +import java.io.Serializable; +import java.util.Date; /** * 小说表 - * + * * @author xiongxy * @email 1179705413@qq.com - * @date 2020-12-01 03:49:46 + * @date 2023-04-14 17:42:55 */ public class BookDO implements Serializable { - private static final long serialVersionUID = 1L; - - //主键 - //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) - //所以通过序列化成字符串来解决 - @JsonSerialize(using = LongToStringSerializer.class) - private Long id; - //作品方向,0:男频,1:女频' - private Integer workDirection; - //分类ID - private Integer catId; - //分类名 - private String catName; - //子分类ID - private Integer catChildId; - //子分类名 - private String catChildName; - //小说封面 - private String picUrl; - //小说名 - private String bookName; - //男主角姓名 - private String heroName; - //女主角姓名 - private String ladyName; - //作品风格,0:甜宠,1:虐恋,2:其他 - private Integer bookStyle; - //作品标签 - private String bookLabel; - //作者id - //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) - //所以通过序列化成字符串来解决 - @JsonSerialize(using = LongToStringSerializer.class) - private Long authorId; - //作者名 - private String authorName; - //书籍描述 - private String bookDesc; - //评分,预留字段 - private Float score; - //书籍状态,0:连载中,1:已完结 - private Integer bookStatus; - //点击量 - //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) - //所以通过序列化成字符串来解决 - @JsonSerialize(using = LongToStringSerializer.class) - private Long visitCount; - //总字数 - private Integer wordCount; - //评论数 - private Integer commentCount; - //昨日订阅数 - private Integer yesterdayBuy; - //最新目录ID - //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) - //所以通过序列化成字符串来解决 - @JsonSerialize(using = LongToStringSerializer.class) - private Long lastIndexId; - //最新目录名 - private String lastIndexName; - //最新目录更新时间 - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date lastIndexUpdateTime; - //是否收费,1:收费,0:免费 - private Integer isVip; - //状态,0:入库,1:上架 - private Integer status; - //更新时间 - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date updateTime; - //创建时间 - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date createTime; - //爬虫源站ID - private Integer crawlSourceId; - //抓取的源站小说ID - private String crawlBookId; - //最后一次的抓取时间 - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date crawlLastTime; - //是否已停止更新,0:未停止,1:已停止 - private Integer crawlIsStop; + private static final long serialVersionUID = 1L; - /** - * 设置:主键 - */ - public void setId(Long id) { - this.id = id; - } - /** - * 获取:主键 - */ - public Long getId() { - return id; - } - /** - * 设置:作品方向,0:男频,1:女频' - */ - public void setWorkDirection(Integer workDirection) { - this.workDirection = workDirection; - } - /** - * 获取:作品方向,0:男频,1:女频' - */ - public Integer getWorkDirection() { - return workDirection; - } - /** - * 设置:分类ID - */ - public void setCatId(Integer catId) { - this.catId = catId; - } - /** - * 获取:分类ID - */ - public Integer getCatId() { - return catId; - } - /** - * 设置:分类名 - */ - public void setCatName(String catName) { - this.catName = catName; - } - /** - * 获取:分类名 - */ - public String getCatName() { - return catName; - } - /** - * 设置:子分类ID - */ - public void setCatChildId(Integer catChildId) { - this.catChildId = catChildId; - } - /** - * 获取:子分类ID - */ - public Integer getCatChildId() { - return catChildId; - } - /** - * 设置:子分类名 - */ - public void setCatChildName(String catChildName) { - this.catChildName = catChildName; - } - /** - * 获取:子分类名 - */ - public String getCatChildName() { - return catChildName; - } - /** - * 设置:小说封面 - */ - public void setPicUrl(String picUrl) { - this.picUrl = picUrl; - } - /** - * 获取:小说封面 - */ - public String getPicUrl() { - return picUrl; - } - /** - * 设置:小说名 - */ - public void setBookName(String bookName) { - this.bookName = bookName; - } - /** - * 获取:小说名 - */ - public String getBookName() { - return bookName; - } - /** - * 设置:男主角姓名 - */ - public void setHeroName(String heroName) { - this.heroName = heroName; - } - /** - * 获取:男主角姓名 - */ - public String getHeroName() { - return heroName; - } - /** - * 设置:女主角姓名 - */ - public void setLadyName(String ladyName) { - this.ladyName = ladyName; - } - /** - * 获取:女主角姓名 - */ - public String getLadyName() { - return ladyName; - } - /** - * 设置:作品风格,0:甜宠,1:虐恋,2:其他 - */ - public void setBookStyle(Integer bookStyle) { - this.bookStyle = bookStyle; - } - /** - * 获取:作品风格,0:甜宠,1:虐恋,2:其他 - */ - public Integer getBookStyle() { - return bookStyle; - } - /** - * 设置:作品标签 - */ - public void setBookLabel(String bookLabel) { - this.bookLabel = bookLabel; - } - /** - * 获取:作品标签 - */ - public String getBookLabel() { - return bookLabel; - } - /** - * 设置:作者id - */ - public void setAuthorId(Long authorId) { - this.authorId = authorId; - } - /** - * 获取:作者id - */ - public Long getAuthorId() { - return authorId; - } - /** - * 设置:作者名 - */ - public void setAuthorName(String authorName) { - this.authorName = authorName; - } - /** - * 获取:作者名 - */ - public String getAuthorName() { - return authorName; - } - /** - * 设置:书籍描述 - */ - public void setBookDesc(String bookDesc) { - this.bookDesc = bookDesc; - } - /** - * 获取:书籍描述 - */ - public String getBookDesc() { - return bookDesc; - } - /** - * 设置:评分,预留字段 - */ - public void setScore(Float score) { - this.score = score; - } - /** - * 获取:评分,预留字段 - */ - public Float getScore() { - return score; - } - /** - * 设置:书籍状态,0:连载中,1:已完结 - */ - public void setBookStatus(Integer bookStatus) { - this.bookStatus = bookStatus; - } - /** - * 获取:书籍状态,0:连载中,1:已完结 - */ - public Integer getBookStatus() { - return bookStatus; - } - /** - * 设置:点击量 - */ - public void setVisitCount(Long visitCount) { - this.visitCount = visitCount; - } - /** - * 获取:点击量 - */ - public Long getVisitCount() { - return visitCount; - } - /** - * 设置:总字数 - */ - public void setWordCount(Integer wordCount) { - this.wordCount = wordCount; - } - /** - * 获取:总字数 - */ - public Integer getWordCount() { - return wordCount; - } - /** - * 设置:评论数 - */ - public void setCommentCount(Integer commentCount) { - this.commentCount = commentCount; - } - /** - * 获取:评论数 - */ - public Integer getCommentCount() { - return commentCount; - } - /** - * 设置:昨日订阅数 - */ - public void setYesterdayBuy(Integer yesterdayBuy) { - this.yesterdayBuy = yesterdayBuy; - } - /** - * 获取:昨日订阅数 - */ - public Integer getYesterdayBuy() { - return yesterdayBuy; - } - /** - * 设置:最新目录ID - */ - public void setLastIndexId(Long lastIndexId) { - this.lastIndexId = lastIndexId; - } - /** - * 获取:最新目录ID - */ - public Long getLastIndexId() { - return lastIndexId; - } - /** - * 设置:最新目录名 - */ - public void setLastIndexName(String lastIndexName) { - this.lastIndexName = lastIndexName; - } - /** - * 获取:最新目录名 - */ - public String getLastIndexName() { - return lastIndexName; - } - /** - * 设置:最新目录更新时间 - */ - public void setLastIndexUpdateTime(Date lastIndexUpdateTime) { - this.lastIndexUpdateTime = lastIndexUpdateTime; - } - /** - * 获取:最新目录更新时间 - */ - public Date getLastIndexUpdateTime() { - return lastIndexUpdateTime; - } - /** - * 设置:是否收费,1:收费,0:免费 - */ - public void setIsVip(Integer isVip) { - this.isVip = isVip; - } - /** - * 获取:是否收费,1:收费,0:免费 - */ - public Integer getIsVip() { - return isVip; - } - /** - * 设置:状态,0:入库,1:上架 - */ - public void setStatus(Integer status) { - this.status = status; - } - /** - * 获取:状态,0:入库,1:上架 - */ - public Integer getStatus() { - return status; - } - /** - * 设置:更新时间 - */ - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - /** - * 获取:更新时间 - */ - public Date getUpdateTime() { - return updateTime; - } - /** - * 设置:创建时间 - */ - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - /** - * 获取:创建时间 - */ - public Date getCreateTime() { - return createTime; - } - /** - * 设置:爬虫源站ID - */ - public void setCrawlSourceId(Integer crawlSourceId) { - this.crawlSourceId = crawlSourceId; - } - /** - * 获取:爬虫源站ID - */ - public Integer getCrawlSourceId() { - return crawlSourceId; - } - /** - * 设置:抓取的源站小说ID - */ - public void setCrawlBookId(String crawlBookId) { - this.crawlBookId = crawlBookId; - } - /** - * 获取:抓取的源站小说ID - */ - public String getCrawlBookId() { - return crawlBookId; - } - /** - * 设置:最后一次的抓取时间 - */ - public void setCrawlLastTime(Date crawlLastTime) { - this.crawlLastTime = crawlLastTime; - } - /** - * 获取:最后一次的抓取时间 - */ - public Date getCrawlLastTime() { - return crawlLastTime; - } - /** - * 设置:是否已停止更新,0:未停止,1:已停止 - */ - public void setCrawlIsStop(Integer crawlIsStop) { - this.crawlIsStop = crawlIsStop; - } - /** - * 获取:是否已停止更新,0:未停止,1:已停止 - */ - public Integer getCrawlIsStop() { - return crawlIsStop; - } + + //主键 + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long id; + //作品方向,0:男频,1:女频' + private Integer workDirection; + //分类ID + private Integer catId; + //分类名 + private String catName; + //小说封面 + private String picUrl; + //小说名 + private String bookName; + //作者id + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long authorId; + //作者名 + private String authorName; + //书籍描述 + private String bookDesc; + //评分,预留字段 + private Float score; + //书籍状态,0:连载中,1:已完结 + private Integer bookStatus; + //点击量 + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long visitCount; + //总字数 + private Integer wordCount; + //评论数 + private Integer commentCount; + //昨日订阅数 + private Integer yesterdayBuy; + //最新目录ID + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long lastIndexId; + //最新目录名 + private String lastIndexName; + //最新目录更新时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date lastIndexUpdateTime; + //是否收费,1:收费,0:免费 + private Integer isVip; + //状态,0:入库,1:上架 + private Integer status; + //更新时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + //创建时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + //爬虫源站ID + private Integer crawlSourceId; + //抓取的源站小说ID + private String crawlBookId; + //最后一次的抓取时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date crawlLastTime; + //是否已停止更新,0:未停止,1:已停止 + private Integer crawlIsStop; + + /** + * 设置:主键 + */ + public void setId(Long id) { + this.id = id; + } + + /** + * 获取:主键 + */ + public Long getId() { + return id; + } + + /** + * 设置:作品方向,0:男频,1:女频' + */ + public void setWorkDirection(Integer workDirection) { + this.workDirection = workDirection; + } + + /** + * 获取:作品方向,0:男频,1:女频' + */ + public Integer getWorkDirection() { + return workDirection; + } + + /** + * 设置:分类ID + */ + public void setCatId(Integer catId) { + this.catId = catId; + } + + /** + * 获取:分类ID + */ + public Integer getCatId() { + return catId; + } + + /** + * 设置:分类名 + */ + public void setCatName(String catName) { + this.catName = catName; + } + + /** + * 获取:分类名 + */ + public String getCatName() { + return catName; + } + + /** + * 设置:小说封面 + */ + public void setPicUrl(String picUrl) { + this.picUrl = picUrl; + } + + /** + * 获取:小说封面 + */ + public String getPicUrl() { + return picUrl; + } + + /** + * 设置:小说名 + */ + public void setBookName(String bookName) { + this.bookName = bookName; + } + + /** + * 获取:小说名 + */ + public String getBookName() { + return bookName; + } + + /** + * 设置:作者id + */ + public void setAuthorId(Long authorId) { + this.authorId = authorId; + } + + /** + * 获取:作者id + */ + public Long getAuthorId() { + return authorId; + } + + /** + * 设置:作者名 + */ + public void setAuthorName(String authorName) { + this.authorName = authorName; + } + + /** + * 获取:作者名 + */ + public String getAuthorName() { + return authorName; + } + + /** + * 设置:书籍描述 + */ + public void setBookDesc(String bookDesc) { + this.bookDesc = bookDesc; + } + + /** + * 获取:书籍描述 + */ + public String getBookDesc() { + return bookDesc; + } + + /** + * 设置:评分,预留字段 + */ + public void setScore(Float score) { + this.score = score; + } + + /** + * 获取:评分,预留字段 + */ + public Float getScore() { + return score; + } + + /** + * 设置:书籍状态,0:连载中,1:已完结 + */ + public void setBookStatus(Integer bookStatus) { + this.bookStatus = bookStatus; + } + + /** + * 获取:书籍状态,0:连载中,1:已完结 + */ + public Integer getBookStatus() { + return bookStatus; + } + + /** + * 设置:点击量 + */ + public void setVisitCount(Long visitCount) { + this.visitCount = visitCount; + } + + /** + * 获取:点击量 + */ + public Long getVisitCount() { + return visitCount; + } + + /** + * 设置:总字数 + */ + public void setWordCount(Integer wordCount) { + this.wordCount = wordCount; + } + + /** + * 获取:总字数 + */ + public Integer getWordCount() { + return wordCount; + } + + /** + * 设置:评论数 + */ + public void setCommentCount(Integer commentCount) { + this.commentCount = commentCount; + } + + /** + * 获取:评论数 + */ + public Integer getCommentCount() { + return commentCount; + } + + /** + * 设置:昨日订阅数 + */ + public void setYesterdayBuy(Integer yesterdayBuy) { + this.yesterdayBuy = yesterdayBuy; + } + + /** + * 获取:昨日订阅数 + */ + public Integer getYesterdayBuy() { + return yesterdayBuy; + } + + /** + * 设置:最新目录ID + */ + public void setLastIndexId(Long lastIndexId) { + this.lastIndexId = lastIndexId; + } + + /** + * 获取:最新目录ID + */ + public Long getLastIndexId() { + return lastIndexId; + } + + /** + * 设置:最新目录名 + */ + public void setLastIndexName(String lastIndexName) { + this.lastIndexName = lastIndexName; + } + + /** + * 获取:最新目录名 + */ + public String getLastIndexName() { + return lastIndexName; + } + + /** + * 设置:最新目录更新时间 + */ + public void setLastIndexUpdateTime(Date lastIndexUpdateTime) { + this.lastIndexUpdateTime = lastIndexUpdateTime; + } + + /** + * 获取:最新目录更新时间 + */ + public Date getLastIndexUpdateTime() { + return lastIndexUpdateTime; + } + + /** + * 设置:是否收费,1:收费,0:免费 + */ + public void setIsVip(Integer isVip) { + this.isVip = isVip; + } + + /** + * 获取:是否收费,1:收费,0:免费 + */ + public Integer getIsVip() { + return isVip; + } + + /** + * 设置:状态,0:入库,1:上架 + */ + public void setStatus(Integer status) { + this.status = status; + } + + /** + * 获取:状态,0:入库,1:上架 + */ + public Integer getStatus() { + return status; + } + + /** + * 设置:更新时间 + */ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** + * 获取:更新时间 + */ + public Date getUpdateTime() { + return updateTime; + } + + /** + * 设置:创建时间 + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * 获取:创建时间 + */ + public Date getCreateTime() { + return createTime; + } + + /** + * 设置:爬虫源站ID + */ + public void setCrawlSourceId(Integer crawlSourceId) { + this.crawlSourceId = crawlSourceId; + } + + /** + * 获取:爬虫源站ID + */ + public Integer getCrawlSourceId() { + return crawlSourceId; + } + + /** + * 设置:抓取的源站小说ID + */ + public void setCrawlBookId(String crawlBookId) { + this.crawlBookId = crawlBookId; + } + + /** + * 获取:抓取的源站小说ID + */ + public String getCrawlBookId() { + return crawlBookId; + } + + /** + * 设置:最后一次的抓取时间 + */ + public void setCrawlLastTime(Date crawlLastTime) { + this.crawlLastTime = crawlLastTime; + } + + /** + * 获取:最后一次的抓取时间 + */ + public Date getCrawlLastTime() { + return crawlLastTime; + } + + /** + * 设置:是否已停止更新,0:未停止,1:已停止 + */ + public void setCrawlIsStop(Integer crawlIsStop) { + this.crawlIsStop = crawlIsStop; + } + + /** + * 获取:是否已停止更新,0:未停止,1:已停止 + */ + public Integer getCrawlIsStop() { + return crawlIsStop; + } } diff --git a/novel-admin/src/main/resources/mybatis/novel/BookMapper.xml b/novel-admin/src/main/resources/mybatis/novel/BookMapper.xml index 0a43d3c..c8565d5 100644 --- a/novel-admin/src/main/resources/mybatis/novel/BookMapper.xml +++ b/novel-admin/src/main/resources/mybatis/novel/BookMapper.xml @@ -3,304 +3,287 @@ - + - + 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 + + and id = #{id} + and work_direction = #{workDirection} + and cat_id = #{catId} + and cat_name = #{catName} + and pic_url = #{picUrl} + and book_name = #{bookName} + and author_id = #{authorId} + and author_name = #{authorName} + and book_desc = #{bookDesc} + and score = #{score} + and book_status = #{bookStatus} + and visit_count = #{visitCount} + and word_count = #{wordCount} + and comment_count = #{commentCount} + and yesterday_buy = #{yesterdayBuy} + and last_index_id = #{lastIndexId} + and last_index_name = #{lastIndexName} + and last_index_update_time = + #{lastIndexUpdateTime} + + and is_vip = #{isVip} + and status = #{status} + and update_time = #{updateTime} + and create_time = #{createTime} + and crawl_source_id = #{crawlSourceId} + and crawl_book_id = #{crawlBookId} + and crawl_last_time = #{crawlLastTime} + and crawl_is_stop = #{crawlIsStop} + order by ${sort} ${order} - + order by id desc - + - - limit #{offset}, #{limit} - - - - - - - insert into book - ( - `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` - ) - values - ( - #{id}, - #{workDirection}, - #{catId}, - #{catName}, - #{catChildId}, - #{catChildName}, - #{picUrl}, - #{bookName}, - #{heroName}, - #{ladyName}, - #{bookStyle}, - #{bookLabel}, - #{authorId}, - #{authorName}, - #{bookDesc}, - #{score}, - #{bookStatus}, - #{visitCount}, - #{wordCount}, - #{commentCount}, - #{yesterdayBuy}, - #{lastIndexId}, - #{lastIndexName}, - #{lastIndexUpdateTime}, - #{isVip}, - #{status}, - #{updateTime}, - #{createTime}, - #{crawlSourceId}, - #{crawlBookId}, - #{crawlLastTime}, - #{crawlIsStop} - ) - + + limit #{offset}, #{limit} + + - - insert into book - ( - `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` - ) - values - ( - #{id}, - #{workDirection}, - #{catId}, - #{catName}, - #{catChildId}, - #{catChildName}, - #{picUrl}, - #{bookName}, - #{heroName}, - #{ladyName}, - #{bookStyle}, - #{bookLabel}, - #{authorId}, - #{authorName}, - #{bookDesc}, - #{score}, - #{bookStatus}, - #{visitCount}, - #{wordCount}, - #{commentCount}, - #{yesterdayBuy}, - #{lastIndexId}, - #{lastIndexName}, - #{lastIndexUpdateTime}, - #{isVip}, - #{status}, - #{updateTime}, - #{createTime}, - #{crawlSourceId}, - #{crawlBookId}, - #{crawlLastTime}, - #{crawlIsStop} - ) - - - - update book - - `work_direction` = #{workDirection}, - `cat_id` = #{catId}, - `cat_name` = #{catName}, - `cat_child_id` = #{catChildId}, - `cat_child_name` = #{catChildName}, - `pic_url` = #{picUrl}, - `book_name` = #{bookName}, - `hero_name` = #{heroName}, - `lady_name` = #{ladyName}, - `book_style` = #{bookStyle}, - `book_label` = #{bookLabel}, - `author_id` = #{authorId}, - `author_name` = #{authorName}, - `book_desc` = #{bookDesc}, - `score` = #{score}, - `book_status` = #{bookStatus}, - `visit_count` = #{visitCount}, - `word_count` = #{wordCount}, - `comment_count` = #{commentCount}, - `yesterday_buy` = #{yesterdayBuy}, - `last_index_id` = #{lastIndexId}, - `last_index_name` = #{lastIndexName}, - `last_index_update_time` = #{lastIndexUpdateTime}, - `is_vip` = #{isVip}, - `status` = #{status}, - `update_time` = #{updateTime}, - `create_time` = #{createTime}, - `crawl_source_id` = #{crawlSourceId}, - `crawl_book_id` = #{crawlBookId}, - `crawl_last_time` = #{crawlLastTime}, - `crawl_is_stop` = #{crawlIsStop} - - where id = #{id} - - - - delete from book where id = #{value} - - - - delete from book where id in - - #{id} - - + - + + insert into book + (`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`) + values (#{id}, + #{workDirection}, + #{catId}, + #{catName}, + #{picUrl}, + #{bookName}, + #{authorId}, + #{authorName}, + #{bookDesc}, + #{score}, + #{bookStatus}, + #{visitCount}, + #{wordCount}, + #{commentCount}, + #{yesterdayBuy}, + #{lastIndexId}, + #{lastIndexName}, + #{lastIndexUpdateTime}, + #{isVip}, + #{status}, + #{updateTime}, + #{createTime}, + #{crawlSourceId}, + #{crawlBookId}, + #{crawlLastTime}, + #{crawlIsStop}) + + + + insert into book + ( + `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` + ) + values + ( + #{id}, + #{workDirection}, + #{catId}, + #{catName}, + #{picUrl}, + #{bookName}, + #{authorId}, + #{authorName}, + #{bookDesc}, + #{score}, + #{bookStatus}, + #{visitCount}, + #{wordCount}, + #{commentCount}, + #{yesterdayBuy}, + #{lastIndexId}, + #{lastIndexName}, + #{lastIndexUpdateTime}, + #{isVip}, + #{status}, + #{updateTime}, + #{createTime}, + #{crawlSourceId}, + #{crawlBookId}, + #{crawlLastTime}, + #{crawlIsStop} + ) + + + + update book + + `work_direction` = #{workDirection}, + `cat_id` = #{catId}, + `cat_name` = #{catName}, + `pic_url` = #{picUrl}, + `book_name` = #{bookName}, + `author_id` = #{authorId}, + `author_name` = #{authorName}, + `book_desc` = #{bookDesc}, + `score` = #{score}, + `book_status` = #{bookStatus}, + `visit_count` = #{visitCount}, + `word_count` = #{wordCount}, + `comment_count` = #{commentCount}, + `yesterday_buy` = #{yesterdayBuy}, + `last_index_id` = #{lastIndexId}, + `last_index_name` = #{lastIndexName}, + `last_index_update_time` = #{lastIndexUpdateTime}, + `is_vip` = #{isVip}, + `status` = #{status}, + `update_time` = #{updateTime}, + `create_time` = #{createTime}, + `crawl_source_id` = #{crawlSourceId}, + `crawl_book_id` = #{crawlBookId}, + `crawl_last_time` = #{crawlLastTime}, + `crawl_is_stop` = #{crawlIsStop} + + where id = #{id} + + + + delete + from book + where id = #{value} + + + + delete from book where id in + + #{id} + + + + \ No newline at end of file diff --git a/novel-admin/src/main/resources/static/js/appjs/novel/book/book.js b/novel-admin/src/main/resources/static/js/appjs/novel/book/book.js index 4f3d0ec..7ae039f 100644 --- a/novel-admin/src/main/resources/static/js/appjs/novel/book/book.js +++ b/novel-admin/src/main/resources/static/js/appjs/novel/book/book.js @@ -59,220 +59,91 @@ function load() { return arguments[2] + 1; } }, - { - field: 'id', - title: '主键' - }, - - { - field: 'workDirection', - title: '作品方向,0:男频,1:女频' - }, - - - { - field: 'catId', - title: '分类ID' - }, - - - { - 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: '操作', - field: 'id', - align: 'center', + { + field: 'workDirection', + title: '作品方向', formatter: function (value, row, index) { - var d = ' '; - var e = ' '; - var r = ' '; - return d + e + r; + 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: 'lastIndexUpdateTime', + title: '最新章节更新时间' + }, + + + { + field: 'isVip', + title: '是否收费', + formatter: function (value, row, index) { + return value === 1 ? '收费' : '免费'; + } + }, + + { + field: 'createTime', + title: '入库时间' + } + + ] }); } + function reLoad() { $('#exampleTable').bootstrapTable('refresh'); } + function add() { layer.open({ type: 2, @@ -283,6 +154,7 @@ function add() { content: prefix + '/add' // iframe的url }); } + function detail(id) { layer.open({ type: 2, @@ -293,6 +165,7 @@ function detail(id) { content: prefix + '/detail/' + id // iframe的url }); } + function edit(id) { layer.open({ type: 2, @@ -303,6 +176,7 @@ function edit(id) { content: prefix + '/edit/' + id // iframe的url }); } + function remove(id) { layer.confirm('确定要删除选中的记录?', { btn: ['确定', '取消'] @@ -327,6 +201,7 @@ function remove(id) { function resetPwd(id) { } + function batchRemove() { var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组 if (rows.length == 0) { diff --git a/novel-admin/src/main/resources/templates/main.html b/novel-admin/src/main/resources/templates/main.html index 4d1274e..934f3a3 100644 --- a/novel-admin/src/main/resources/templates/main.html +++ b/novel-admin/src/main/resources/templates/main.html @@ -10,28 +10,142 @@ @@ -133,7 +247,7 @@ 项目名称 - 小说精品屋 + novel @@ -142,21 +256,25 @@ 主要特色 - 小说 / 漫画 / 自适应 / 弹幕 / 采集 + Spring Boot 3 / Vue 3 / 项目实战 / 保姆级教程 下载地址 - Gitee / - Github + Gitee / + Github Gitee
- star - fork + star + fork
@@ -164,8 +282,10 @@ Github
- - + +
@@ -186,7 +306,7 @@ 项目名称 - 小说精品屋-plus + novel-plus @@ -208,8 +328,12 @@ Gitee
- star - fork + star + fork
@@ -217,8 +341,10 @@ Github
- - + +
@@ -239,7 +365,7 @@ 项目名称 - 小说精品屋-微服务版 + novel-cloud @@ -248,7 +374,7 @@ 主要特色 - SpringCloudAlibaba / Redis / RabbitMq / ElasticSearch / Sharding-Jdbc / Docker + 微服务 / Spring Cloud 2022 / Spring Cloud Alibaba 2022 下载地址 @@ -261,8 +387,12 @@ Gitee
- star - fork + star + fork
@@ -270,8 +400,10 @@ Github
- - + +
@@ -303,7 +435,7 @@ }, }); - layui.use(['layer', 'layuimini','echarts'], function () { + layui.use(['layer', 'layuimini', 'echarts'], function () { var $ = layui.jquery, layer = layui.layer, layuimini = layui.layuimini, @@ -322,14 +454,14 @@ '\n'; parent.layer.open({ type: 1, - title: '系统公告'+''+noticeTime+'', + title: '系统公告' + '' + noticeTime + '', area: '300px;', shade: 0.8, id: 'layuimini-notice', btn: ['查看', '取消'], btnAlign: 'c', moveType: 1, - content:html, + content: html, success: function (layero) { var btn = layero.find('.layui-layer-btn'); btn.find('.layui-layer-btn0').attr({ @@ -349,52 +481,51 @@ data: {}, success: function (r) { if (r.code == 0) { - var legendData = ['会员新增','作家新增','作品新增','交易新增']; + var legendData = ['会员新增', '作家新增', '作品新增', '交易新增']; var userSeries = [ { - name:'会员新增', - type:'line', - data:[] - },{ - name:'作家新增', - type:'line', - data:[] - },{ - name:'作品新增', - type:'line', - data:[] - },{ - name:'交易新增', - type:'line', - data:[] + name: '会员新增', + type: 'line', + data: [] + }, { + name: '作家新增', + type: 'line', + data: [] + }, { + name: '作品新增', + type: 'line', + data: [] + }, { + name: '交易新增', + type: 'line', + data: [] }]; var xAxisData = r.dateList; 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; } 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; } 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; } 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; } - var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden'); var optionRecords = { tooltip: { trigger: 'axis' }, legend: { - data:legendData + data: legendData }, grid: { left: '3%', @@ -420,7 +551,7 @@ echartsRecords.setOption(optionRecords); // echarts 窗口缩放自适应 - window.onresize = function(){ + window.onresize = function () { echartsRecords.resize(); } diff --git a/novel-admin/src/main/resources/templates/novel/book/add.html b/novel-admin/src/main/resources/templates/novel/book/add.html index 9782f91..6f29bba 100644 --- a/novel-admin/src/main/resources/templates/novel/book/add.html +++ b/novel-admin/src/main/resources/templates/novel/book/add.html @@ -9,294 +9,294 @@
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
diff --git a/novel-admin/src/main/resources/templates/novel/book/book.html b/novel-admin/src/main/resources/templates/novel/book/book.html index 3119bba..259313e 100644 --- a/novel-admin/src/main/resources/templates/novel/book/book.html +++ b/novel-admin/src/main/resources/templates/novel/book/book.html @@ -8,7 +8,7 @@
-
+
- + +
+
+