后台新闻模块开发完成

This commit is contained in:
xiongxiaoyang 2020-12-01 12:14:25 +08:00
parent f7375c5779
commit 7f4d315f25
31 changed files with 2673 additions and 2 deletions

View File

@ -14,7 +14,7 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe
/**
* 假如有有html 代码是自己传来的 需要设定对应的name 不过滤
*/
private static final List<String> noFilterNames = Arrays.asList("attach","push_ip");
private static final List<String> noFilterNames = Arrays.asList("attach","push_ip","content");
public XssAndSqlHttpServletRequestWrapper(HttpServletRequest request) {
super(request);

View File

@ -0,0 +1,135 @@
package com.java2nb.novel.controller;
import java.util.List;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import io.swagger.annotations.ApiOperation;
import com.java2nb.novel.domain.CategoryDO;
import com.java2nb.novel.service.CategoryService;
import com.java2nb.common.utils.PageBean;
import com.java2nb.common.utils.Query;
import com.java2nb.common.utils.R;
/**
* 新闻类别表
*
* @author xiongxy
* @email 1179705413@qq.com
* @date 2020-12-01 10:03:41
*/
@Controller
@RequestMapping("/novel/category")
public class CategoryController {
@Autowired
private CategoryService categoryService;
@GetMapping()
@RequiresPermissions("novel:category:category")
String Category() {
return "novel/category/category";
}
@ApiOperation(value = "获取新闻类别表列表", notes = "获取新闻类别表列表")
@ResponseBody
@GetMapping("/list")
@RequiresPermissions("novel:category:category")
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
Query query = new Query(params);
List<CategoryDO> categoryList = categoryService.list(query);
int total = categoryService.count(query);
PageBean pageBean = new PageBean(categoryList, total);
return R.ok().put("data", pageBean);
}
@ApiOperation(value = "新增新闻类别表页面", notes = "新增新闻类别表页面")
@GetMapping("/add")
@RequiresPermissions("novel:category:add")
String add() {
return "novel/category/add";
}
@ApiOperation(value = "修改新闻类别表页面", notes = "修改新闻类别表页面")
@GetMapping("/edit/{id}")
@RequiresPermissions("novel:category:edit")
String edit(@PathVariable("id") Integer id, Model model) {
CategoryDO category = categoryService.get(id);
model.addAttribute("category", category);
return "novel/category/edit";
}
@ApiOperation(value = "查看新闻类别表页面", notes = "查看新闻类别表页面")
@GetMapping("/detail/{id}")
@RequiresPermissions("novel:category:detail")
String detail(@PathVariable("id") Integer id, Model model) {
CategoryDO category = categoryService.get(id);
model.addAttribute("category", category);
return "novel/category/detail";
}
/**
* 保存
*/
@ApiOperation(value = "新增新闻类别表", notes = "新增新闻类别表")
@ResponseBody
@PostMapping("/save")
@RequiresPermissions("novel:category:add")
public R save( CategoryDO category) {
if (categoryService.save(category) > 0) {
return R.ok();
}
return R.error();
}
/**
* 修改
*/
@ApiOperation(value = "修改新闻类别表", notes = "修改新闻类别表")
@ResponseBody
@RequestMapping("/update")
@RequiresPermissions("novel:category:edit")
public R update( CategoryDO category) {
categoryService.update(category);
return R.ok();
}
/**
* 删除
*/
@ApiOperation(value = "删除新闻类别表", notes = "删除新闻类别表")
@PostMapping("/remove")
@ResponseBody
@RequiresPermissions("novel:category:remove")
public R remove( Integer id) {
if (categoryService.remove(id) > 0) {
return R.ok();
}
return R.error();
}
/**
* 删除
*/
@ApiOperation(value = "批量删除新闻类别表", notes = "批量删除新闻类别表")
@PostMapping("/batchRemove")
@ResponseBody
@RequiresPermissions("novel:category:batchRemove")
public R remove(@RequestParam("ids[]") Integer[] ids) {
categoryService.batchRemove(ids);
return R.ok();
}
}

View File

@ -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.NewsDO;
import com.java2nb.novel.service.NewsService;
import com.java2nb.common.utils.PageBean;
import com.java2nb.common.utils.Query;
import com.java2nb.common.utils.R;
/**
* 新闻表
*
* @author xiongxy
* @email 1179705413@qq.com
* @date 2020-12-01 10:05:51
*/
@Controller
@RequestMapping("/novel/news")
public class NewsController {
@Autowired
private NewsService newsService;
@GetMapping()
@RequiresPermissions("novel:news:news")
String News() {
return "novel/news/news";
}
@ApiOperation(value = "获取新闻表列表", notes = "获取新闻表列表")
@ResponseBody
@GetMapping("/list")
@RequiresPermissions("novel:news:news")
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
Query query = new Query(params);
List<NewsDO> newsList = newsService.list(query);
int total = newsService.count(query);
PageBean pageBean = new PageBean(newsList, total);
return R.ok().put("data", pageBean);
}
@ApiOperation(value = "新增新闻表页面", notes = "新增新闻表页面")
@GetMapping("/add")
@RequiresPermissions("novel:news:add")
String add() {
return "novel/news/add";
}
@ApiOperation(value = "修改新闻表页面", notes = "修改新闻表页面")
@GetMapping("/edit/{id}")
@RequiresPermissions("novel:news:edit")
String edit(@PathVariable("id") Long id, Model model) {
NewsDO news = newsService.get(id);
model.addAttribute("news", news);
return "novel/news/edit";
}
@ApiOperation(value = "查看新闻表页面", notes = "查看新闻表页面")
@GetMapping("/detail/{id}")
@RequiresPermissions("novel:news:detail")
String detail(@PathVariable("id") Long id, Model model) {
NewsDO news = newsService.get(id);
model.addAttribute("news", news);
return "novel/news/detail";
}
/**
* 保存
*/
@ApiOperation(value = "新增新闻表", notes = "新增新闻表")
@ResponseBody
@PostMapping("/save")
@RequiresPermissions("novel:news:add")
public R save( NewsDO news) {
if (newsService.save(news) > 0) {
return R.ok();
}
return R.error();
}
/**
* 修改
*/
@ApiOperation(value = "修改新闻表", notes = "修改新闻表")
@ResponseBody
@RequestMapping("/update")
@RequiresPermissions("novel:news:edit")
public R update( NewsDO news) {
newsService.update(news);
return R.ok();
}
/**
* 删除
*/
@ApiOperation(value = "删除新闻表", notes = "删除新闻表")
@PostMapping("/remove")
@ResponseBody
@RequiresPermissions("novel:news:remove")
public R remove( Long id) {
if (newsService.remove(id) > 0) {
return R.ok();
}
return R.error();
}
/**
* 删除
*/
@ApiOperation(value = "批量删除新闻表", notes = "批量删除新闻表")
@PostMapping("/batchRemove")
@ResponseBody
@RequiresPermissions("novel:news:batchRemove")
public R remove(@RequestParam("ids[]") Long[] ids) {
newsService.batchRemove(ids);
return R.ok();
}
}

View File

@ -0,0 +1,32 @@
package com.java2nb.novel.dao;
import com.java2nb.novel.domain.CategoryDO;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
/**
* 新闻类别表
* @author xiongxy
* @email 1179705413@qq.com
* @date 2020-12-01 10:03:41
*/
@Mapper
public interface CategoryDao {
CategoryDO get(Integer id);
List<CategoryDO> list(Map<String,Object> map);
int count(Map<String,Object> map);
int save(CategoryDO category);
int update(CategoryDO category);
int remove(Integer id);
int batchRemove(Integer[] ids);
}

View File

@ -0,0 +1,32 @@
package com.java2nb.novel.dao;
import com.java2nb.novel.domain.NewsDO;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
/**
* 新闻表
* @author xiongxy
* @email 1179705413@qq.com
* @date 2020-12-01 10:05:51
*/
@Mapper
public interface NewsDao {
NewsDO get(Long id);
List<NewsDO> list(Map<String,Object> map);
int count(Map<String,Object> map);
int save(NewsDO news);
int update(NewsDO news);
int remove(Long id);
int batchRemove(Long[] ids);
}

View File

@ -0,0 +1,135 @@
package com.java2nb.novel.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.java2nb.common.jsonserializer.LongToStringSerializer;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 新闻类别表
*
* @author xiongxy
* @email 1179705413@qq.com
* @date 2020-12-01 10:03:41
*/
public class CategoryDO implements Serializable {
private static final long serialVersionUID = 1L;
//主键
private Integer id;
//分类名
private String name;
//排序
private Integer sort;
//
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
//所以通过序列化成字符串来解决
@JsonSerialize(using = LongToStringSerializer.class)
private Long createUserId;
//
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
//
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
//所以通过序列化成字符串来解决
@JsonSerialize(using = LongToStringSerializer.class)
private Long updateUserId;
//
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 设置主键
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取主键
*/
public Integer getId() {
return id;
}
/**
* 设置分类名
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取分类名
*/
public String getName() {
return name;
}
/**
* 设置排序
*/
public void setSort(Integer sort) {
this.sort = sort;
}
/**
* 获取排序
*/
public Integer getSort() {
return sort;
}
/**
* 设置
*/
public void setCreateUserId(Long createUserId) {
this.createUserId = createUserId;
}
/**
* 获取
*/
public Long getCreateUserId() {
return createUserId;
}
/**
* 设置
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置
*/
public void setUpdateUserId(Long updateUserId) {
this.updateUserId = updateUserId;
}
/**
* 获取
*/
public Long getUpdateUserId() {
return updateUserId;
}
/**
* 设置
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取
*/
public Date getUpdateTime() {
return updateTime;
}
}

View File

@ -0,0 +1,180 @@
package com.java2nb.novel.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.java2nb.common.jsonserializer.LongToStringSerializer;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 新闻表
*
* @author xiongxy
* @email 1179705413@qq.com
* @date 2020-12-01 10:05:51
*/
public class NewsDO implements Serializable {
private static final long serialVersionUID = 1L;
//主键
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
//所以通过序列化成字符串来解决
@JsonSerialize(using = LongToStringSerializer.class)
private Long id;
//类别ID
private Integer catId;
//分类名
private String catName;
//来源
private String sourceName;
//标题
private String title;
//内容
private String content;
//发布时间
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
//发布人ID
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
//所以通过序列化成字符串来解决
@JsonSerialize(using = LongToStringSerializer.class)
private Long createUserId;
//更新时间
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
//更新人ID
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
//所以通过序列化成字符串来解决
@JsonSerialize(using = LongToStringSerializer.class)
private Long updateUserId;
/**
* 设置主键
*/
public void setId(Long id) {
this.id = id;
}
/**
* 获取主键
*/
public Long getId() {
return id;
}
/**
* 设置类别ID
*/
public void setCatId(Integer catId) {
this.catId = catId;
}
/**
* 获取类别ID
*/
public Integer getCatId() {
return catId;
}
/**
* 设置分类名
*/
public void setCatName(String catName) {
this.catName = catName;
}
/**
* 获取分类名
*/
public String getCatName() {
return catName;
}
/**
* 设置来源
*/
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
/**
* 获取来源
*/
public String getSourceName() {
return sourceName;
}
/**
* 设置标题
*/
public void setTitle(String title) {
this.title = title;
}
/**
* 获取标题
*/
public String getTitle() {
return title;
}
/**
* 设置内容
*/
public void setContent(String content) {
this.content = content;
}
/**
* 获取内容
*/
public String getContent() {
return content;
}
/**
* 设置发布时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取发布时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置发布人ID
*/
public void setCreateUserId(Long createUserId) {
this.createUserId = createUserId;
}
/**
* 获取发布人ID
*/
public Long getCreateUserId() {
return createUserId;
}
/**
* 设置更新时间
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取更新时间
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* 设置更新人ID
*/
public void setUpdateUserId(Long updateUserId) {
this.updateUserId = updateUserId;
}
/**
* 获取更新人ID
*/
public Long getUpdateUserId() {
return updateUserId;
}
}

View File

@ -0,0 +1,30 @@
package com.java2nb.novel.service;
import com.java2nb.novel.domain.CategoryDO;
import java.util.List;
import java.util.Map;
/**
* 新闻类别表
*
* @author xiongxy
* @email 1179705413@qq.com
* @date 2020-12-01 10:03:41
*/
public interface CategoryService {
CategoryDO get(Integer id);
List<CategoryDO> list(Map<String, Object> map);
int count(Map<String, Object> map);
int save(CategoryDO category);
int update(CategoryDO category);
int remove(Integer id);
int batchRemove(Integer[] ids);
}

View File

@ -0,0 +1,30 @@
package com.java2nb.novel.service;
import com.java2nb.novel.domain.NewsDO;
import java.util.List;
import java.util.Map;
/**
* 新闻表
*
* @author xiongxy
* @email 1179705413@qq.com
* @date 2020-12-01 10:05:51
*/
public interface NewsService {
NewsDO get(Long id);
List<NewsDO> list(Map<String, Object> map);
int count(Map<String, Object> map);
int save(NewsDO news);
int update(NewsDO news);
int remove(Long id);
int batchRemove(Long[] ids);
}

View File

@ -0,0 +1,58 @@
package com.java2nb.novel.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.java2nb.novel.dao.CategoryDao;
import com.java2nb.novel.domain.CategoryDO;
import com.java2nb.novel.service.CategoryService;
@Service
public class CategoryServiceImpl implements CategoryService {
@Autowired
private CategoryDao categoryDao;
@Override
public CategoryDO get(Integer id){
return categoryDao.get(id);
}
@Override
public List<CategoryDO> list(Map<String, Object> map){
return categoryDao.list(map);
}
@Override
public int count(Map<String, Object> map){
return categoryDao.count(map);
}
@Override
public int save(CategoryDO category){
category.setCreateTime(new Date());
return categoryDao.save(category);
}
@Override
public int update(CategoryDO category){
category.setUpdateTime(new Date());
return categoryDao.update(category);
}
@Override
public int remove(Integer id){
return categoryDao.remove(id);
}
@Override
public int batchRemove(Integer[] ids){
return categoryDao.batchRemove(ids);
}
}

View File

@ -0,0 +1,58 @@
package com.java2nb.novel.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.java2nb.novel.dao.NewsDao;
import com.java2nb.novel.domain.NewsDO;
import com.java2nb.novel.service.NewsService;
@Service
public class NewsServiceImpl implements NewsService {
@Autowired
private NewsDao newsDao;
@Override
public NewsDO get(Long id){
return newsDao.get(id);
}
@Override
public List<NewsDO> list(Map<String, Object> map){
return newsDao.list(map);
}
@Override
public int count(Map<String, Object> map){
return newsDao.count(map);
}
@Override
public int save(NewsDO news){
news.setCreateTime(new Date());
return newsDao.save(news);
}
@Override
public int update(NewsDO news){
news.setUpdateTime(new Date());
return newsDao.update(news);
}
@Override
public int remove(Long id){
return newsDao.remove(id);
}
@Override
public int batchRemove(Long[] ids){
return newsDao.batchRemove(ids);
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.java2nb.novel.dao.CategoryDao">
<select id="get" resultType="com.java2nb.novel.domain.CategoryDO">
select `id`,`name`,`sort`,`create_user_id`,`create_time`,`update_user_id`,`update_time` from news_category where id = #{value}
</select>
<select id="list" resultType="com.java2nb.novel.domain.CategoryDO">
select `id`,`name`,`sort`,`create_user_id`,`create_time`,`update_user_id`,`update_time` from news_category
<where>
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="count" resultType="int">
select count(*) from news_category
<where>
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
</where>
</select>
<insert id="save" parameterType="com.java2nb.novel.domain.CategoryDO">
insert into news_category
(
`id`,
`name`,
`sort`,
`create_user_id`,
`create_time`,
`update_user_id`,
`update_time`
)
values
(
#{id},
#{name},
#{sort},
#{createUserId},
#{createTime},
#{updateUserId},
#{updateTime}
)
</insert>
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.CategoryDO">
insert into news_category
(
<if test="id != null"> `id`, </if>
<if test="name != null"> `name`, </if>
<if test="sort != null"> `sort`, </if>
<if test="createUserId != null"> `create_user_id`, </if>
<if test="createTime != null"> `create_time`, </if>
<if test="updateUserId != null"> `update_user_id`, </if>
<if test="updateTime != null"> `update_time` </if>
)
values
(
<if test="id != null"> #{id}, </if>
<if test="name != null"> #{name}, </if>
<if test="sort != null"> #{sort}, </if>
<if test="createUserId != null"> #{createUserId}, </if>
<if test="createTime != null"> #{createTime}, </if>
<if test="updateUserId != null"> #{updateUserId}, </if>
<if test="updateTime != null"> #{updateTime} </if>
)
</insert>
<update id="update" parameterType="com.java2nb.novel.domain.CategoryDO">
update news_category
<set>
<if test="name != null">`name` = #{name}, </if>
<if test="sort != null">`sort` = #{sort}, </if>
<if test="createUserId != null">`create_user_id` = #{createUserId}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="updateUserId != null">`update_user_id` = #{updateUserId}, </if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
</update>
<delete id="remove">
delete from news_category where id = #{value}
</delete>
<delete id="batchRemove">
delete from news_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,138 @@
<?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.NewsDao">
<select id="get" resultType="com.java2nb.novel.domain.NewsDO">
select `id`,`cat_id`,`cat_name`,`source_name`,`title`,`content`,`create_time`,`create_user_id`,`update_time`,`update_user_id` from news where id = #{value}
</select>
<select id="list" resultType="com.java2nb.novel.domain.NewsDO">
select `id`,`cat_id`,`cat_name`,`source_name`,`title`,`content`,`create_time`,`create_user_id`,`update_time`,`update_user_id` from news
<where>
<if test="id != null and id != ''"> and id = #{id} </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="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
<if test="title != null and title != ''"> and title like concat('%',#{title},'%') </if>
<if test="content != null and content != ''"> and content = #{content} </if>
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="count" resultType="int">
select count(*) from news
<where>
<if test="id != null and id != ''"> and id = #{id} </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="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
<if test="title != null and title != ''"> and title = #{title} </if>
<if test="content != null and content != ''"> and content = #{content} </if>
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
</where>
</select>
<insert id="save" parameterType="com.java2nb.novel.domain.NewsDO">
insert into news
(
`id`,
`cat_id`,
`cat_name`,
`source_name`,
`title`,
`content`,
`create_time`,
`create_user_id`,
`update_time`,
`update_user_id`
)
values
(
#{id},
#{catId},
#{catName},
#{sourceName},
#{title},
#{content},
#{createTime},
#{createUserId},
#{updateTime},
#{updateUserId}
)
</insert>
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.NewsDO">
insert into news
(
<if test="id != null"> `id`, </if>
<if test="catId != null"> `cat_id`, </if>
<if test="catName != null"> `cat_name`, </if>
<if test="sourceName != null"> `source_name`, </if>
<if test="title != null"> `title`, </if>
<if test="content != null"> `content`, </if>
<if test="createTime != null"> `create_time`, </if>
<if test="createUserId != null"> `create_user_id`, </if>
<if test="updateTime != null"> `update_time`, </if>
<if test="updateUserId != null"> `update_user_id` </if>
)
values
(
<if test="id != null"> #{id}, </if>
<if test="catId != null"> #{catId}, </if>
<if test="catName != null"> #{catName}, </if>
<if test="sourceName != null"> #{sourceName}, </if>
<if test="title != null"> #{title}, </if>
<if test="content != null"> #{content}, </if>
<if test="createTime != null"> #{createTime}, </if>
<if test="createUserId != null"> #{createUserId}, </if>
<if test="updateTime != null"> #{updateTime}, </if>
<if test="updateUserId != null"> #{updateUserId} </if>
)
</insert>
<update id="update" parameterType="com.java2nb.novel.domain.NewsDO">
update news
<set>
<if test="catId != null">`cat_id` = #{catId}, </if>
<if test="catName != null">`cat_name` = #{catName}, </if>
<if test="sourceName != null">`source_name` = #{sourceName}, </if>
<if test="title != null">`title` = #{title}, </if>
<if test="content != null">`content` = #{content}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="createUserId != null">`create_user_id` = #{createUserId}, </if>
<if test="updateTime != null">`update_time` = #{updateTime}, </if>
<if test="updateUserId != null">`update_user_id` = #{updateUserId}</if>
</set>
where id = #{id}
</update>
<delete id="remove">
delete from news where id = #{value}
</delete>
<delete id="batchRemove">
delete from news where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,111 @@
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/category/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: {
name: {
required: true
}, },
messages: {
name: {
required: icon + "请选择分类名"
}, }
})
}

View File

@ -0,0 +1,193 @@
var prefix = "/novel/category"
$(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排序列orderdesc或者,以及所有列的键值对
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: 'name',
title: '分类名'
},
{
field: 'sort',
title: '排序'
},
{
title: '操作',
field: 'id',
align: 'center',
formatter: function (value, row, index) {
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
+ row.id
+ '\')"><i class="fa fa-file"></i></a> ';
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
+ row.id
+ '\')"><i class="fa fa-edit"></i></a> ';
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
+ row.id
+ '\')"><i class="fa fa-remove"></i></a> ';
return 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 () {
});
}

View File

@ -0,0 +1,109 @@
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/category/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: {
name:
{
required: true
}, },
messages: {
name:
{
required: icon + "请选择分类名"
}, }
})
}

View File

@ -0,0 +1,123 @@
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/news/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: {
catId: {
required: true
}, catName: {
required: true
}, title: {
required: true
}, content: {
required: true
}, },
messages: {
catId: {
required: icon + "请选择类别ID"
}, catName: {
required: icon + "请选择分类名"
}, title: {
required: icon + "请选择标题"
}, content: {
required: icon + "请选择内容"
}, }
})
}

View File

@ -0,0 +1,127 @@
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/news/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: {
catId:
{
required: true
}, catName:
{
required: true
}, title:
{
required: true
}, content:
{
required: true
}, },
messages: {
catId:
{
required: icon + "请选择类别ID"
}, catName:
{
required: icon + "请选择分类名"
}, title:
{
required: icon + "请选择标题"
}, content:
{
required: icon + "请选择内容"
}, }
})
}

View File

@ -0,0 +1,206 @@
var prefix = "/novel/news"
$(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排序列orderdesc或者,以及所有列的键值对
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: 'catName',
title: '分类名'
},
{
field: 'sourceName',
title: '来源'
},
{
field: 'title',
title: '标题'
},
{
field: 'createTime',
title: '发布时间'
},
{
title: '操作',
field: 'id',
align: 'center',
formatter: function (value, row, index) {
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
+ row.id
+ '\')"><i class="fa fa-file"></i></a> ';
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
+ row.id
+ '\')"><i class="fa fa-edit"></i></a> ';
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
+ row.id
+ '\')"><i class="fa fa-remove"></i></a> ';
return 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 () {
});
}

View File

@ -0,0 +1,18 @@
-- 菜单SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
VALUES ('1', '新闻类别表', 'novel/category', 'novel:category:category', '1', 'fa', '6');
-- 按钮父菜单ID
set @parentId = @@identity;
-- 菜单对应按钮SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '查看', null, 'novel:category:detail', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '新增', null, 'novel:category:add', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '修改', null, 'novel:category:edit', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '删除', null, 'novel:category:remove', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '批量删除', null, 'novel:category:batchRemove', '2', null, '6';

View File

@ -0,0 +1,18 @@
-- 菜单SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
VALUES ('1', '新闻表', 'novel/news', 'novel:news:news', '1', 'fa', '6');
-- 按钮父菜单ID
set @parentId = @@identity;
-- 菜单对应按钮SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '查看', null, 'novel:news:detail', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '新增', null, 'novel:news:add', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '修改', null, 'novel:news:edit', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '删除', null, 'novel:news:remove', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '批量删除', null, 'novel:news:batchRemove', '2', null, '6';

View File

@ -0,0 +1,46 @@
<!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">分类名:</label>
<div class="col-sm-3">
<input id="name" name="name"
class="form-control"
type="text" maxlength="10">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">排序:</label>
<div class="col-sm-2">
<input id="sort" name="sort"
class="form-control"
type="number" maxlength="2">
</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/category/add.js">
</script>
</body>
</html>

View File

@ -0,0 +1,57 @@
<!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:category:add" type="button"
class="btn btn-primary" onclick="add()">
<i class="fa fa-plus" aria-hidden="true"></i>添加
</button>
<button shiro:hasPermission="novel:category:batchRemove" type="button"
class="btn btn-danger"
onclick="batchRemove()">
<i class="fa fa-trash" aria-hidden="true"></i>删除
</button>
</div>
</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:category:edit">
<script type="text/javascript">
s_edit_h = '';
</script>
</div>
<div shiro:hasPermission="novel:category: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/category/category.js"></script>
</body>
</html>

View File

@ -0,0 +1,80 @@
<!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="${category.id}"
type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">分类名:</label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${category.name}">
</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="${category.sort}">
</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="${category.createUserId}">
</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="${category.createTime}==null?null:${#dates.format(category.createTime,'yyyy-MM-dd HH:mm:ss')}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${category.updateUserId}">
</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="${category.updateTime}==null?null:${#dates.format(category.updateTime,'yyyy-MM-dd HH:mm:ss')}">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div th:include="include::footer"></div>
</body>
</html>

View File

@ -0,0 +1,48 @@
<!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="${category.id}"
type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">分类名:</label>
<div class="col-sm-3">
<input id="name" name="name"
th:value="${category.name}"
class="form-control"
type="text" maxlength="10">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">排序:</label>
<div class="col-sm-2">
<input id="sort" name="sort"
th:value="${category.sort}"
class="form-control"
type="number" maxlength="2">
</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/category/edit.js">
</script>
</body>
</html>

View File

@ -0,0 +1,105 @@
<!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">类别:</label>
<div class="col-sm-3">
<select data-placeholder="--选择--" id="catId"
name="catId"
class="form-control chosen-select" tabindex="2"
>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-8">
<input type="hidden" id="catName" name="catName"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">来源:</label>
<div class="col-sm-3">
<input id="sourceName" name="sourceName"
class="form-control"
type="text" maxlength="10">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">标题:</label>
<div class="col-sm-8">
<input id="title" name="title"
class="form-control"
type="text" maxlength="30">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">内容:</label>
<div class="col-sm-8">
<input type="hidden" id="content" name="content"/>
<div id="contentEditorcontent">
</div>
</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/news/add.js">
</script>
<script>
$.ajax({
type: "GET",
url: "/novel/category/list",
data: {limit:100,offset:0},
success: function (r) {
if (r.code == 0) {
var list = r.data.rows;
var catHtml = "<option>请选择</option>";
for(var i = 0 ; i < list.length ; i++){
var cat = list[i];
catHtml += ("<option value='"+cat.id+"'>"+cat.name+"</option>");
}
$("#catId").html(catHtml);
$("#catId").change(function(){
var catName = $(this).find("option:selected").text();
if(catName != '请选择'){
$("#catName").val(catName);
}else{
$("#catName").val('');
}
});
} else {
layer.msg(r.msg);
}
},
});
</script>
</body>
</html>

View File

@ -0,0 +1,108 @@
<!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="${news.id}"
type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">类别ID</label>
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="${column.dictType}"
th:attr="dict-value=${news.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="${news.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="${news.sourceName}">
</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="${news.title}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">内容:</label>
<div style="padding-top:8px" class="col-sm-8"
th:utext="${news.content}"></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="${news.createTime}==null?null:${#dates.format(news.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="${news.createUserId}">
</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="${news.updateTime}==null?null:${#dates.format(news.updateTime,'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="${news.updateUserId}">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div th:include="include::footer"></div>
</body>
</html>

View File

@ -0,0 +1,109 @@
<!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="${news.id}"
type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">类别:</label>
<div class="col-sm-3">
<select data-placeholder="--选择--" id="catId"
name="catId"
class="form-control chosen-select" tabindex="2"
th:value="${news.catId}">
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-8">
<input type="hidden" id="catName" name="catName" th:value="${news.catName}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">来源:</label>
<div class="col-sm-3">
<input id="sourceName" name="sourceName"
th:value="${news.sourceName}"
class="form-control"
type="text" maxlength="10">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">标题:</label>
<div class="col-sm-8">
<input id="title" name="title"
th:value="${news.title}"
class="form-control"
type="text" maxlength="30">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">内容:</label>
<div class="col-sm-8">
<input type="hidden" id="content" name="content" th:value="${news.content}"/>
<div id="contentEditorcontent">
</div>
</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/news/edit.js">
</script>
<script>
$.ajax({
type: "GET",
url: "/novel/category/list",
data: {limit:100,offset:0},
success: function (r) {
if (r.code == 0) {
var list = r.data.rows;
var catHtml = "<option>请选择</option>";
for(var i = 0 ; i < list.length ; i++){
var cat = list[i];
if(cat.id == $("#catId").attr("value")){
catHtml += ("<option selected value='"+cat.id+"'>"+cat.name+"</option>");
}else{
catHtml += ("<option value='"+cat.id+"'>"+cat.name+"</option>");
}
}
$("#catId").html(catHtml);
$("#catId").change(function(){
var catName = $(this).find("option:selected").text();
if(catName != '请选择'){
$("#catName").val(catName);
}else{
$("#catName").val('');
}
});
} else {
layer.msg(r.msg);
}
},
});
</script>
</body>
</html>

View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-body">
<div class="fixed-table-toolbar">
<div class="columns pull-left">
<button shiro:hasPermission="novel:news:add" type="button"
class="btn btn-primary" onclick="add()">
<i class="fa fa-plus" aria-hidden="true"></i>添加
</button>
<button shiro:hasPermission="novel:news: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="title" name="title" 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:news:edit">
<script type="text/javascript">
s_edit_h = '';
</script>
</div>
<div shiro:hasPermission="novel:news: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/news/news.js"></script>
</body>
</html>

32
sql/20201201.sql Normal file
View File

@ -0,0 +1,32 @@
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (246, 241, '批量删除', NULL, 'novel:news:batchRemove', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (245, 241, '删除', NULL, 'novel:news:remove', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (244, 241, '修改', NULL, 'novel:news:edit', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (243, 241, '新增', NULL, 'novel:news:add', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (242, 241, '查看', NULL, 'novel:news:detail', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (241, 234, '新闻列表', 'novel/news', 'novel:news:news', 1, 'fa', 8, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (240, 235, '批量删除', NULL, 'novel:category:batchRemove', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (239, 235, '删除', NULL, 'novel:category:remove', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (238, 235, '修改', NULL, 'novel:category:edit', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (237, 235, '新增', NULL, 'novel:category:add', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (236, 235, '查看', NULL, 'novel:category:detail', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (235, 234, '类别管理', 'novel/category', 'novel:category:category', 1, 'fa', 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (234, 0, '新闻管理', '', '', 0, 'fa fa-newspaper-o', 8, NULL, NULL);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4889, 1, 246);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4890, 1, 245);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4891, 1, 244);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4892, 1, 243);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4893, 1, 242);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4899, 1, 241);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4894, 1, 240);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4895, 1, 239);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4896, 1, 238);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4897, 1, 237);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4898, 1, 236);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4900, 1, 235);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4888, 1, 234);
delete from sys_menu where menu_id = 202;

View File

@ -1869,4 +1869,39 @@ CREATE TABLE `author_income` (
alter table book add column `yesterday_buy` int(11) DEFAULT '0' COMMENT '昨日订阅数' after comment_count;
alter table book_index add column `book_price` int(3) DEFAULT 0 COMMENT '章节费用屋币' after `is_vip`;
alter table book_index add column `book_price` int(3) DEFAULT 0 COMMENT '章节费用屋币' after `is_vip`;
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (246, 241, '批量删除', NULL, 'novel:news:batchRemove', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (245, 241, '删除', NULL, 'novel:news:remove', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (244, 241, '修改', NULL, 'novel:news:edit', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (243, 241, '新增', NULL, 'novel:news:add', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (242, 241, '查看', NULL, 'novel:news:detail', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (241, 234, '新闻列表', 'novel/news', 'novel:news:news', 1, 'fa', 8, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (240, 235, '批量删除', NULL, 'novel:category:batchRemove', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (239, 235, '删除', NULL, 'novel:category:remove', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (238, 235, '修改', NULL, 'novel:category:edit', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (237, 235, '新增', NULL, 'novel:category:add', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (236, 235, '查看', NULL, 'novel:category:detail', 2, NULL, 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (235, 234, '类别管理', 'novel/category', 'novel:category:category', 1, 'fa', 6, NULL, NULL);
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (234, 0, '新闻管理', '', '', 0, 'fa fa-newspaper-o', 8, NULL, NULL);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4889, 1, 246);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4890, 1, 245);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4891, 1, 244);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4892, 1, 243);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4893, 1, 242);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4899, 1, 241);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4894, 1, 240);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4895, 1, 239);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4896, 1, 238);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4897, 1, 237);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4898, 1, 236);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4900, 1, 235);
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4888, 1, 234);
delete from sys_menu where menu_id = 202;