mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
add book
This commit is contained in:
parent
fe80c21812
commit
4c3d3c67ee
@ -0,0 +1,135 @@
|
||||
package com.java2nb.novel.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
|
||||
import com.java2nb.novel.domain.BookDO;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
import com.java2nb.common.utils.PageBean;
|
||||
import com.java2nb.common.utils.Query;
|
||||
import com.java2nb.common.utils.R;
|
||||
|
||||
/**
|
||||
* 小说表
|
||||
*
|
||||
* @author phacks
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2020-05-16 15:08:34
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/novel/book")
|
||||
public class BookController {
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
|
||||
@GetMapping()
|
||||
@RequiresPermissions("novel:book:book")
|
||||
String Book() {
|
||||
return "novel/book/book";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取小说表列表", notes = "获取小说表列表")
|
||||
@ResponseBody
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("novel:book:book")
|
||||
public R list(@RequestParam Map<String, Object> params) {
|
||||
//查询列表数据
|
||||
Query query = new Query(params);
|
||||
List<BookDO> bookList = bookService.list(query);
|
||||
int total = bookService.count(query);
|
||||
PageBean pageBean = new PageBean(bookList, total);
|
||||
return R.ok().put("data", pageBean);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增小说表页面", notes = "新增小说表页面")
|
||||
@GetMapping("/add")
|
||||
@RequiresPermissions("novel:book:add")
|
||||
String add() {
|
||||
return "novel/book/add";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改小说表页面", notes = "修改小说表页面")
|
||||
@GetMapping("/edit/{id}")
|
||||
@RequiresPermissions("novel:book:edit")
|
||||
String edit(@PathVariable("id") Long id, Model model) {
|
||||
BookDO book = bookService.get(id);
|
||||
model.addAttribute("book", book);
|
||||
return "novel/book/edit";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查看小说表页面", notes = "查看小说表页面")
|
||||
@GetMapping("/detail/{id}")
|
||||
@RequiresPermissions("novel:book:detail")
|
||||
String detail(@PathVariable("id") Long id, Model model) {
|
||||
BookDO book = bookService.get(id);
|
||||
model.addAttribute("book", book);
|
||||
return "novel/book/detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@ApiOperation(value = "新增小说表", notes = "新增小说表")
|
||||
@ResponseBody
|
||||
@PostMapping("/save")
|
||||
@RequiresPermissions("novel:book:add")
|
||||
public R save( BookDO book) {
|
||||
if (bookService.save(book) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@ApiOperation(value = "修改小说表", notes = "修改小说表")
|
||||
@ResponseBody
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("novel:book:edit")
|
||||
public R update( BookDO book) {
|
||||
bookService.update(book);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "删除小说表", notes = "删除小说表")
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("novel:book:remove")
|
||||
public R remove( Long id) {
|
||||
if (bookService.remove(id) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除小说表", notes = "批量删除小说表")
|
||||
@PostMapping("/batchRemove")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("novel:book:batchRemove")
|
||||
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||
bookService.batchRemove(ids);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
32
novel-admin/src/main/java/com/java2nb/novel/dao/BookDao.java
Normal file
32
novel-admin/src/main/java/com/java2nb/novel/dao/BookDao.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.java2nb.novel.dao;
|
||||
|
||||
import com.java2nb.novel.domain.BookDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 小说表
|
||||
* @author phacks
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2020-05-16 15:08:34
|
||||
*/
|
||||
@Mapper
|
||||
public interface BookDao {
|
||||
|
||||
BookDO get(Long id);
|
||||
|
||||
List<BookDO> list(Map<String,Object> map);
|
||||
|
||||
int count(Map<String,Object> map);
|
||||
|
||||
int save(BookDO book);
|
||||
|
||||
int update(BookDO book);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
}
|
395
novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java
Normal file
395
novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java
Normal file
@ -0,0 +1,395 @@
|
||||
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 phacks
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2020-05-16 15:08:34
|
||||
*/
|
||||
public class BookDO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
//主键
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long id;
|
||||
//作品方向,0:男频,1:女频'
|
||||
private Integer workDirection;
|
||||
//分类ID
|
||||
private Integer catId;
|
||||
//分类名
|
||||
private String catName;
|
||||
//小说封面
|
||||
private String picUrl;
|
||||
//小说名
|
||||
private String bookName;
|
||||
//作者id
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long authorId;
|
||||
//作者名
|
||||
private String authorName;
|
||||
//书籍描述
|
||||
private String bookDesc;
|
||||
//评分,预留字段
|
||||
private Float score;
|
||||
//书籍状态,0:连载中,1:已完结
|
||||
private Integer bookStatus;
|
||||
//点击量
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long visitCount;
|
||||
//总字数
|
||||
private Integer wordCount;
|
||||
//评论数
|
||||
private Integer commentCount;
|
||||
//最新目录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;
|
||||
}
|
||||
/**
|
||||
* 设置:最新目录ID
|
||||
*/
|
||||
public void setLastIndexId(Long lastIndexId) {
|
||||
this.lastIndexId = lastIndexId;
|
||||
}
|
||||
/**
|
||||
* 获取:最新目录ID
|
||||
*/
|
||||
public Long getLastIndexId() {
|
||||
return lastIndexId;
|
||||
}
|
||||
/**
|
||||
* 设置:最新目录名
|
||||
*/
|
||||
public void setLastIndexName(String lastIndexName) {
|
||||
this.lastIndexName = lastIndexName;
|
||||
}
|
||||
/**
|
||||
* 获取:最新目录名
|
||||
*/
|
||||
public String getLastIndexName() {
|
||||
return lastIndexName;
|
||||
}
|
||||
/**
|
||||
* 设置:最新目录更新时间
|
||||
*/
|
||||
public void setLastIndexUpdateTime(Date lastIndexUpdateTime) {
|
||||
this.lastIndexUpdateTime = lastIndexUpdateTime;
|
||||
}
|
||||
/**
|
||||
* 获取:最新目录更新时间
|
||||
*/
|
||||
public Date getLastIndexUpdateTime() {
|
||||
return lastIndexUpdateTime;
|
||||
}
|
||||
/**
|
||||
* 设置:是否收费,1:收费,0:免费
|
||||
*/
|
||||
public void setIsVip(Integer isVip) {
|
||||
this.isVip = isVip;
|
||||
}
|
||||
/**
|
||||
* 获取:是否收费,1:收费,0:免费
|
||||
*/
|
||||
public Integer getIsVip() {
|
||||
return isVip;
|
||||
}
|
||||
/**
|
||||
* 设置:状态,0:入库,1:上架
|
||||
*/
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
/**
|
||||
* 获取:状态,0:入库,1:上架
|
||||
*/
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
/**
|
||||
* 设置:更新时间
|
||||
*/
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
/**
|
||||
* 获取:更新时间
|
||||
*/
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
/**
|
||||
* 设置:创建时间
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
/**
|
||||
* 获取:创建时间
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
/**
|
||||
* 设置:爬虫源站ID
|
||||
*/
|
||||
public void setCrawlSourceId(Integer crawlSourceId) {
|
||||
this.crawlSourceId = crawlSourceId;
|
||||
}
|
||||
/**
|
||||
* 获取:爬虫源站ID
|
||||
*/
|
||||
public Integer getCrawlSourceId() {
|
||||
return crawlSourceId;
|
||||
}
|
||||
/**
|
||||
* 设置:抓取的源站小说ID
|
||||
*/
|
||||
public void setCrawlBookId(String crawlBookId) {
|
||||
this.crawlBookId = crawlBookId;
|
||||
}
|
||||
/**
|
||||
* 获取:抓取的源站小说ID
|
||||
*/
|
||||
public String getCrawlBookId() {
|
||||
return crawlBookId;
|
||||
}
|
||||
/**
|
||||
* 设置:最后一次的抓取时间
|
||||
*/
|
||||
public void setCrawlLastTime(Date crawlLastTime) {
|
||||
this.crawlLastTime = crawlLastTime;
|
||||
}
|
||||
/**
|
||||
* 获取:最后一次的抓取时间
|
||||
*/
|
||||
public Date getCrawlLastTime() {
|
||||
return crawlLastTime;
|
||||
}
|
||||
/**
|
||||
* 设置:是否已停止更新,0:未停止,1:已停止
|
||||
*/
|
||||
public void setCrawlIsStop(Integer crawlIsStop) {
|
||||
this.crawlIsStop = crawlIsStop;
|
||||
}
|
||||
/**
|
||||
* 获取:是否已停止更新,0:未停止,1:已停止
|
||||
*/
|
||||
public Integer getCrawlIsStop() {
|
||||
return crawlIsStop;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.java2nb.novel.service;
|
||||
|
||||
import com.java2nb.novel.domain.BookDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 小说表
|
||||
*
|
||||
* @author phacks
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2020-05-16 15:08:34
|
||||
*/
|
||||
public interface BookService {
|
||||
|
||||
BookDO get(Long id);
|
||||
|
||||
List<BookDO> list(Map<String, Object> map);
|
||||
|
||||
int count(Map<String, Object> map);
|
||||
|
||||
int save(BookDO book);
|
||||
|
||||
int update(BookDO book);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
}
|
@ -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.BookDao;
|
||||
import com.java2nb.novel.domain.BookDO;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class BookServiceImpl implements BookService {
|
||||
@Autowired
|
||||
private BookDao bookDao;
|
||||
|
||||
@Override
|
||||
public BookDO get(Long id){
|
||||
return bookDao.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BookDO> list(Map<String, Object> map){
|
||||
return bookDao.list(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int count(Map<String, Object> map){
|
||||
return bookDao.count(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(BookDO book){
|
||||
return bookDao.save(book);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(BookDO book){
|
||||
return bookDao.update(book);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remove(Long id){
|
||||
return bookDao.remove(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchRemove(Long[] ids){
|
||||
return bookDao.batchRemove(ids);
|
||||
}
|
||||
|
||||
}
|
241
novel-admin/src/main/resources/mybatis/novel/BookMapper.xml
Normal file
241
novel-admin/src/main/resources/mybatis/novel/BookMapper.xml
Normal file
@ -0,0 +1,241 @@
|
||||
<?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.BookDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.novel.domain.BookDO">
|
||||
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`,`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`,`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`,`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>
|
||||
<if test="id != null and id != ''"> and id = #{id} </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="catName != null and catName != ''"> and cat_name = #{catName} </if>
|
||||
<if test="picUrl != null and picUrl != ''"> and pic_url = #{picUrl} </if>
|
||||
<if test="bookName != null and bookName != ''"> and book_name = #{bookName} </if>
|
||||
<if test="authorId != null and authorId != ''"> and author_id = #{authorId} </if>
|
||||
<if test="authorName != null and authorName != ''"> and author_name = #{authorName} </if>
|
||||
<if test="bookDesc != null and bookDesc != ''"> and book_desc = #{bookDesc} </if>
|
||||
<if test="score != null and score != ''"> and score = #{score} </if>
|
||||
<if test="bookStatus != null and bookStatus != ''"> and book_status = #{bookStatus} </if>
|
||||
<if test="visitCount != null and visitCount != ''"> and visit_count = #{visitCount} </if>
|
||||
<if test="wordCount != null and wordCount != ''"> and word_count = #{wordCount} </if>
|
||||
<if test="commentCount != null and commentCount != ''"> and comment_count = #{commentCount} </if>
|
||||
<if test="lastIndexId != null and lastIndexId != ''"> and last_index_id = #{lastIndexId} </if>
|
||||
<if test="lastIndexName != null and lastIndexName != ''"> and last_index_name = #{lastIndexName} </if>
|
||||
<if test="lastIndexUpdateTime != null and lastIndexUpdateTime != ''"> and last_index_update_time = #{lastIndexUpdateTime} </if>
|
||||
<if test="isVip != null and isVip != ''"> and is_vip = #{isVip} </if>
|
||||
<if test="status != null and status != ''"> and status = #{status} </if>
|
||||
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||
<if test="crawlSourceId != null and crawlSourceId != ''"> and crawl_source_id = #{crawlSourceId} </if>
|
||||
<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>
|
||||
<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
|
||||
<where>
|
||||
<if test="id != null and id != ''"> and id = #{id} </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="catName != null and catName != ''"> and cat_name = #{catName} </if>
|
||||
<if test="picUrl != null and picUrl != ''"> and pic_url = #{picUrl} </if>
|
||||
<if test="bookName != null and bookName != ''"> and book_name = #{bookName} </if>
|
||||
<if test="authorId != null and authorId != ''"> and author_id = #{authorId} </if>
|
||||
<if test="authorName != null and authorName != ''"> and author_name = #{authorName} </if>
|
||||
<if test="bookDesc != null and bookDesc != ''"> and book_desc = #{bookDesc} </if>
|
||||
<if test="score != null and score != ''"> and score = #{score} </if>
|
||||
<if test="bookStatus != null and bookStatus != ''"> and book_status = #{bookStatus} </if>
|
||||
<if test="visitCount != null and visitCount != ''"> and visit_count = #{visitCount} </if>
|
||||
<if test="wordCount != null and wordCount != ''"> and word_count = #{wordCount} </if>
|
||||
<if test="commentCount != null and commentCount != ''"> and comment_count = #{commentCount} </if>
|
||||
<if test="lastIndexId != null and lastIndexId != ''"> and last_index_id = #{lastIndexId} </if>
|
||||
<if test="lastIndexName != null and lastIndexName != ''"> and last_index_name = #{lastIndexName} </if>
|
||||
<if test="lastIndexUpdateTime != null and lastIndexUpdateTime != ''"> and last_index_update_time = #{lastIndexUpdateTime} </if>
|
||||
<if test="isVip != null and isVip != ''"> and is_vip = #{isVip} </if>
|
||||
<if test="status != null and status != ''"> and status = #{status} </if>
|
||||
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||
<if test="crawlSourceId != null and crawlSourceId != ''"> and crawl_source_id = #{crawlSourceId} </if>
|
||||
<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>
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.novel.domain.BookDO" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into book
|
||||
(
|
||||
`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`,
|
||||
`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
|
||||
(
|
||||
#{workDirection},
|
||||
#{catId},
|
||||
#{catName},
|
||||
#{picUrl},
|
||||
#{bookName},
|
||||
#{authorId},
|
||||
#{authorName},
|
||||
#{bookDesc},
|
||||
#{score},
|
||||
#{bookStatus},
|
||||
#{visitCount},
|
||||
#{wordCount},
|
||||
#{commentCount},
|
||||
#{lastIndexId},
|
||||
#{lastIndexName},
|
||||
#{lastIndexUpdateTime},
|
||||
#{isVip},
|
||||
#{status},
|
||||
#{updateTime},
|
||||
#{createTime},
|
||||
#{crawlSourceId},
|
||||
#{crawlBookId},
|
||||
#{crawlLastTime},
|
||||
#{crawlIsStop}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookDO" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into book
|
||||
(
|
||||
<if test="id != null"> `id`, </if>
|
||||
<if test="workDirection != null"> `work_direction`, </if>
|
||||
<if test="catId != null"> `cat_id`, </if>
|
||||
<if test="catName != null"> `cat_name`, </if>
|
||||
<if test="picUrl != null"> `pic_url`, </if>
|
||||
<if test="bookName != null"> `book_name`, </if>
|
||||
<if test="authorId != null"> `author_id`, </if>
|
||||
<if test="authorName != null"> `author_name`, </if>
|
||||
<if test="bookDesc != null"> `book_desc`, </if>
|
||||
<if test="score != null"> `score`, </if>
|
||||
<if test="bookStatus != null"> `book_status`, </if>
|
||||
<if test="visitCount != null"> `visit_count`, </if>
|
||||
<if test="wordCount != null"> `word_count`, </if>
|
||||
<if test="commentCount != null"> `comment_count`, </if>
|
||||
<if test="lastIndexId != null"> `last_index_id`, </if>
|
||||
<if test="lastIndexName != null"> `last_index_name`, </if>
|
||||
<if test="lastIndexUpdateTime != null"> `last_index_update_time`, </if>
|
||||
<if test="isVip != null"> `is_vip`, </if>
|
||||
<if test="status != null"> `status`, </if>
|
||||
<if test="updateTime != null"> `update_time`, </if>
|
||||
<if test="createTime != null"> `create_time`, </if>
|
||||
<if test="crawlSourceId != null"> `crawl_source_id`, </if>
|
||||
<if test="crawlBookId != null"> `crawl_book_id`, </if>
|
||||
<if test="crawlLastTime != null"> `crawl_last_time`, </if>
|
||||
<if test="crawlIsStop != null"> `crawl_is_stop` </if>
|
||||
)
|
||||
values
|
||||
(
|
||||
<if test="id != null"> #{id}, </if>
|
||||
<if test="workDirection != null"> #{workDirection}, </if>
|
||||
<if test="catId != null"> #{catId}, </if>
|
||||
<if test="catName != null"> #{catName}, </if>
|
||||
<if test="picUrl != null"> #{picUrl}, </if>
|
||||
<if test="bookName != null"> #{bookName}, </if>
|
||||
<if test="authorId != null"> #{authorId}, </if>
|
||||
<if test="authorName != null"> #{authorName}, </if>
|
||||
<if test="bookDesc != null"> #{bookDesc}, </if>
|
||||
<if test="score != null"> #{score}, </if>
|
||||
<if test="bookStatus != null"> #{bookStatus}, </if>
|
||||
<if test="visitCount != null"> #{visitCount}, </if>
|
||||
<if test="wordCount != null"> #{wordCount}, </if>
|
||||
<if test="commentCount != null"> #{commentCount}, </if>
|
||||
<if test="lastIndexId != null"> #{lastIndexId}, </if>
|
||||
<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 book
|
||||
<set>
|
||||
<if test="workDirection != null">`work_direction` = #{workDirection}, </if>
|
||||
<if test="catId != null">`cat_id` = #{catId}, </if>
|
||||
<if test="catName != null">`cat_name` = #{catName}, </if>
|
||||
<if test="picUrl != null">`pic_url` = #{picUrl}, </if>
|
||||
<if test="bookName != null">`book_name` = #{bookName}, </if>
|
||||
<if test="authorId != null">`author_id` = #{authorId}, </if>
|
||||
<if test="authorName != null">`author_name` = #{authorName}, </if>
|
||||
<if test="bookDesc != null">`book_desc` = #{bookDesc}, </if>
|
||||
<if test="score != null">`score` = #{score}, </if>
|
||||
<if test="bookStatus != null">`book_status` = #{bookStatus}, </if>
|
||||
<if test="visitCount != null">`visit_count` = #{visitCount}, </if>
|
||||
<if test="wordCount != null">`word_count` = #{wordCount}, </if>
|
||||
<if test="commentCount != null">`comment_count` = #{commentCount}, </if>
|
||||
<if test="lastIndexId != null">`last_index_id` = #{lastIndexId}, </if>
|
||||
<if test="lastIndexName != null">`last_index_name` = #{lastIndexName}, </if>
|
||||
<if test="lastIndexUpdateTime != null">`last_index_update_time` = #{lastIndexUpdateTime}, </if>
|
||||
<if test="isVip != null">`is_vip` = #{isVip}, </if>
|
||||
<if test="status != null">`status` = #{status}, </if>
|
||||
<if test="updateTime != null">`update_time` = #{updateTime}, </if>
|
||||
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||
<if test="crawlSourceId != null">`crawl_source_id` = #{crawlSourceId}, </if>
|
||||
<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 from book where id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from book where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
107
novel-admin/src/main/resources/static/js/appjs/novel/book/add.js
Normal file
107
novel-admin/src/main/resources/static/js/appjs/novel/book/add.js
Normal file
@ -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/book/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,321 @@
|
||||
var prefix = "/novel/book"
|
||||
$(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: 'workDirection',
|
||||
title: '作品方向,0:男频,1:女频'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'catId',
|
||||
title: '分类ID'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'catName',
|
||||
title: '分类名'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'picUrl',
|
||||
title: '小说封面'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'bookName',
|
||||
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: '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',
|
||||
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/book/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: {
|
||||
}
|
||||
})
|
||||
}
|
18
novel-admin/src/main/resources/static/sql/novel/book/menu.js
Normal file
18
novel-admin/src/main/resources/static/sql/novel/book/menu.js
Normal file
@ -0,0 +1,18 @@
|
||||
-- 菜单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';
|
252
novel-admin/src/main/resources/templates/novel/book/add.html
Normal file
252
novel-admin/src/main/resources/templates/novel/book/add.html
Normal file
@ -0,0 +1,252 @@
|
||||
<!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">作品方向,0:男频,1:女频:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="workDirection" name="workDirection"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">分类ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="catId" name="catId"
|
||||
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="catName" name="catName"
|
||||
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="picUrl" name="picUrl"
|
||||
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="bookName" name="bookName"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">作者id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="authorId" name="authorId"
|
||||
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="authorName" name="authorName"
|
||||
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="bookDesc" name="bookDesc"
|
||||
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="score" name="score"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">书籍状态,0:连载中,1:已完结:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="bookStatus" name="bookStatus"
|
||||
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="visitCount" name="visitCount"
|
||||
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="wordCount" name="wordCount"
|
||||
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="commentCount" name="commentCount"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">最新目录ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="lastIndexId" name="lastIndexId"
|
||||
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="lastIndexName" name="lastIndexName"
|
||||
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="lastIndexUpdateTime"
|
||||
name="lastIndexUpdateTime"
|
||||
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">是否收费,1:收费,0:免费:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="isVip" name="isVip"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态,0:入库,1:上架:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="status" name="status"
|
||||
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="updateTime"
|
||||
name="updateTime"
|
||||
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 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">爬虫源站ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="crawlSourceId" name="crawlSourceId"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">抓取的源站小说ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="crawlBookId" name="crawlBookId"
|
||||
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="crawlLastTime"
|
||||
name="crawlLastTime"
|
||||
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">是否已停止更新,0:未停止,1:已停止:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="crawlIsStop" name="crawlIsStop"
|
||||
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/book/add.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,77 @@
|
||||
<!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:book:add" type="button"
|
||||
class="btn btn-primary" onclick="add()">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||
</button>
|
||||
<button shiro:hasPermission="novel:book:batchRemove" type="button"
|
||||
class="btn btn-danger"
|
||||
onclick="batchRemove()">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="columns pull-left">
|
||||
<button shiro:hasPermission="novel:book:add" type="button"
|
||||
class="btn btn-primary" onclick="add()">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||
</button>
|
||||
<button shiro:hasPermission="novel:book: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:book:edit">
|
||||
<script type="text/javascript">
|
||||
s_edit_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div shiro:hasPermission="novel:book: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/book/book.js"></script>
|
||||
</body>
|
||||
</html>
|
258
novel-admin/src/main/resources/templates/novel/book/detail.html
Normal file
258
novel-admin/src/main/resources/templates/novel/book/detail.html
Normal file
@ -0,0 +1,258 @@
|
||||
<!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="${book.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">作品方向,0:男频,1:女频:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${book.workDirection}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">分类ID:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${book.catId}">
|
||||
</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="${book.catName}">
|
||||
</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="${book.picUrl}">
|
||||
</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="${book.bookName}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">作者id:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${book.authorId}">
|
||||
</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="${book.authorName}">
|
||||
</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="${book.bookDesc}">
|
||||
</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="${book.score}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">书籍状态,0:连载中,1:已完结:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${book.bookStatus}">
|
||||
</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="${book.visitCount}">
|
||||
</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="${book.wordCount}">
|
||||
</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="${book.commentCount}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">最新目录ID:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${book.lastIndexId}">
|
||||
</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="${book.lastIndexName}">
|
||||
</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="${book.lastIndexUpdateTime}==null?null:${#dates.format(book.lastIndexUpdateTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否收费,1:收费,0:免费:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${book.isVip}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态,0:入库,1:上架:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${book.status}">
|
||||
</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="${book.updateTime}==null?null:${#dates.format(book.updateTime,'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="${book.createTime}==null?null:${#dates.format(book.createTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">爬虫源站ID:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${book.crawlSourceId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">抓取的源站小说ID:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${book.crawlBookId}">
|
||||
</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="${book.crawlLastTime}==null?null:${#dates.format(book.crawlLastTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否已停止更新,0:未停止,1:已停止:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${book.crawlIsStop}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
</body>
|
||||
</html>
|
254
novel-admin/src/main/resources/templates/novel/book/edit.html
Normal file
254
novel-admin/src/main/resources/templates/novel/book/edit.html
Normal file
@ -0,0 +1,254 @@
|
||||
<!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="${book.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">作品方向,0:男频,1:女频:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="workDirection" name="workDirection"
|
||||
th:value="${book.workDirection}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">分类ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="catId" name="catId"
|
||||
th:value="${book.catId}"
|
||||
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="catName" name="catName"
|
||||
th:value="${book.catName}"
|
||||
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="picUrl" name="picUrl"
|
||||
th:value="${book.picUrl}"
|
||||
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="bookName" name="bookName"
|
||||
th:value="${book.bookName}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">作者id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="authorId" name="authorId"
|
||||
th:value="${book.authorId}"
|
||||
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="authorName" name="authorName"
|
||||
th:value="${book.authorName}"
|
||||
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="bookDesc" name="bookDesc"
|
||||
th:value="${book.bookDesc}"
|
||||
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="score" name="score"
|
||||
th:value="${book.score}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">书籍状态,0:连载中,1:已完结:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="bookStatus" name="bookStatus"
|
||||
th:value="${book.bookStatus}"
|
||||
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="visitCount" name="visitCount"
|
||||
th:value="${book.visitCount}"
|
||||
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="wordCount" name="wordCount"
|
||||
th:value="${book.wordCount}"
|
||||
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="commentCount" name="commentCount"
|
||||
th:value="${book.commentCount}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">最新目录ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="lastIndexId" name="lastIndexId"
|
||||
th:value="${book.lastIndexId}"
|
||||
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="lastIndexName" name="lastIndexName"
|
||||
th:value="${book.lastIndexName}"
|
||||
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="lastIndexUpdateTime"
|
||||
name="lastIndexUpdateTime"
|
||||
th:value="${book.lastIndexUpdateTime}==null?null:${#dates.format(book.lastIndexUpdateTime,'yyyy-MM-dd HH:mm:ss')}"
|
||||
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">是否收费,1:收费,0:免费:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="isVip" name="isVip"
|
||||
th:value="${book.isVip}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态,0:入库,1:上架:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="status" name="status"
|
||||
th:value="${book.status}"
|
||||
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="updateTime"
|
||||
name="updateTime"
|
||||
th:value="${book.updateTime}==null?null:${#dates.format(book.updateTime,'yyyy-MM-dd HH:mm:ss')}"
|
||||
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 type="text" class="laydate-icon layer-date form-control"
|
||||
id="createTime"
|
||||
name="createTime"
|
||||
th:value="${book.createTime}==null?null:${#dates.format(book.createTime,'yyyy-MM-dd HH:mm:ss')}"
|
||||
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">爬虫源站ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="crawlSourceId" name="crawlSourceId"
|
||||
th:value="${book.crawlSourceId}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">抓取的源站小说ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="crawlBookId" name="crawlBookId"
|
||||
th:value="${book.crawlBookId}"
|
||||
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="crawlLastTime"
|
||||
name="crawlLastTime"
|
||||
th:value="${book.crawlLastTime}==null?null:${#dates.format(book.crawlLastTime,'yyyy-MM-dd HH:mm:ss')}"
|
||||
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">是否已停止更新,0:未停止,1:已停止:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="crawlIsStop" name="crawlIsStop"
|
||||
th:value="${book.crawlIsStop}"
|
||||
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/book/edit.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user