mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-01 15:26:37 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
b02a2b3b2c | |||
f28c8a9c16 | |||
e44978617f | |||
aa2929a3cd | |||
281561c85b | |||
cab350dbb2 | |||
9ed465784a | |||
e2cfa5a788 |
@ -9,7 +9,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
👉 <a href='https://novel.xxyopen.com'>官网</a> | 👉 <a href='http://47.106.243.172:8888'>演示站点</a> | 👉 <a href='https://docs.xxyopen.com/course/novelplus/'>项目文档(含安装教程)</a>
|
👉 <a href='https://novel.xxyopen.com'>官网</a> | 👉 <a href='https://www.bilibili.com/video/BV1Zo4y187Mi'>项目演示</a> | 👉 <a href='https://docs.xxyopen.com/course/novelplus/1.html'>安装教程</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## 项目介绍
|
## 项目介绍
|
||||||
|
51
doc/sql/20230418.sql
Normal file
51
doc/sql/20230418.sql
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('轮播图', '0', 'book_rec_type', '小说推荐类型', 0, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('顶部小说栏', '1', 'book_rec_type', '小说推荐类型', 1, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('本周强推', '2', 'book_rec_type', '小说推荐类型', 2, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('热门推荐', '3', 'book_rec_type', '小说推荐类型', 3, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('精品推荐', '4', 'book_rec_type', '小说推荐类型', 4, null, null, null, null, null, '', null);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (320, '300', '小说推荐', 'novel/bookSetting', 'novel:bookSetting:bookSetting', '1', 'fa', '6');
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (321, '320', '查看', null, 'novel:bookSetting:detail', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (322, '320', '新增', null, 'novel:bookSetting:add', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (323, '320', '修改', null, 'novel:bookSetting:edit', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (324, '320', '删除', null, 'novel:bookSetting:remove', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (325, '320', '批量删除', null, 'novel:bookSetting:batchRemove', '2', null, '6');
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 320);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 321);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 322);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 323);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 324);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 325);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (410, '400', '会员反馈', 'novel/userFeedback', 'novel:userFeedback:userFeedback', '1', 'fa', '16');
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 410);
|
@ -2947,4 +2947,56 @@ VALUES (1, 603);
|
|||||||
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
VALUES (604, 603, '删除', null, 'novel:bookComment:remove', '2', null, '6');
|
VALUES (604, 603, '删除', null, 'novel:bookComment:remove', '2', null, '6');
|
||||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
VALUES (1, 604);
|
VALUES (1, 604);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('轮播图', '0', 'book_rec_type', '小说推荐类型', 0, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('顶部小说栏', '1', 'book_rec_type', '小说推荐类型', 1, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('本周强推', '2', 'book_rec_type', '小说推荐类型', 2, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('热门推荐', '3', 'book_rec_type', '小说推荐类型', 3, null, null, null, null, null, '', null);
|
||||||
|
INSERT INTO sys_dict (name, value, type, description, sort, parent_id, create_by, create_date, update_by,
|
||||||
|
update_date, remarks, del_flag)
|
||||||
|
VALUES ('精品推荐', '4', 'book_rec_type', '小说推荐类型', 4, null, null, null, null, null, '', null);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (320, '300', '小说推荐', 'novel/bookSetting', 'novel:bookSetting:bookSetting', '1', 'fa', '6');
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (321, '320', '查看', null, 'novel:bookSetting:detail', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (322, '320', '新增', null, 'novel:bookSetting:add', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (323, '320', '修改', null, 'novel:bookSetting:edit', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (324, '320', '删除', null, 'novel:bookSetting:remove', '2', null, '6');
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (325, '320', '批量删除', null, 'novel:bookSetting:batchRemove', '2', null, '6');
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 320);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 321);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 322);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 323);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 324);
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 325);
|
||||||
|
|
||||||
|
INSERT INTO `sys_menu` (`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES (410, '400', '会员反馈', 'novel/userFeedback', 'novel:userFeedback:userFeedback', '1', 'fa', '16');
|
||||||
|
|
||||||
|
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||||
|
VALUES (1, 410);
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<artifactId>novel-admin</artifactId>
|
<artifactId>novel-admin</artifactId>
|
||||||
<version>4.0.0</version>
|
<version>4.1.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>novel-admin</name>
|
<name>novel-admin</name>
|
||||||
|
@ -0,0 +1,134 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import com.java2nb.common.config.CacheKey;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
import com.java2nb.novel.domain.BookSettingDO;
|
||||||
|
import com.java2nb.novel.service.BookSettingService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页小说推荐
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 10:01:13
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/bookSetting")
|
||||||
|
public class BookSettingController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BookSettingService bookSettingService;
|
||||||
|
@Autowired
|
||||||
|
private StringRedisTemplate redisTemplate;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:bookSetting:bookSetting")
|
||||||
|
String BookSetting() {
|
||||||
|
return "novel/bookSetting/bookSetting";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取首页小说设置表列表", notes = "获取首页小说设置表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:bookSetting:bookSetting")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<BookSettingDO> bookSettingList = bookSettingService.list(query);
|
||||||
|
int total = bookSettingService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(bookSettingList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增首页小说设置表页面", notes = "新增首页小说设置表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:bookSetting:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/bookSetting/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改首页小说设置表页面", notes = "修改首页小说设置表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:bookSetting:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookSettingDO bookSetting = bookSettingService.get(id);
|
||||||
|
model.addAttribute("bookSetting", bookSetting);
|
||||||
|
return "novel/bookSetting/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看首页小说设置表页面", notes = "查看首页小说设置表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:bookSetting:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookSettingDO bookSetting = bookSettingService.get(id);
|
||||||
|
model.addAttribute("bookSetting", bookSetting);
|
||||||
|
return "novel/bookSetting/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增首页小说设置表", notes = "新增首页小说设置表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:bookSetting:add")
|
||||||
|
public R save(BookSettingDO bookSetting) {
|
||||||
|
if (bookSettingService.save(bookSetting) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改首页小说设置表", notes = "修改首页小说设置表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:bookSetting:edit")
|
||||||
|
public R update(BookSettingDO bookSetting) {
|
||||||
|
bookSettingService.update(bookSetting);
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_BOOK_SETTINGS_KEY);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除首页小说设置表", notes = "删除首页小说设置表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:bookSetting:remove")
|
||||||
|
public R remove(Long id) {
|
||||||
|
if (bookSettingService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除首页小说设置表", notes = "批量删除首页小说设置表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:bookSetting:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
bookSettingService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,26 +1,21 @@
|
|||||||
package com.java2nb.novel.controller;
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import com.java2nb.common.config.CacheKey;
|
||||||
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.PageBean;
|
||||||
import com.java2nb.common.utils.Query;
|
import com.java2nb.common.utils.Query;
|
||||||
import com.java2nb.common.utils.R;
|
import com.java2nb.common.utils.R;
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
import com.java2nb.novel.service.NewsService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新闻表
|
* 新闻表
|
||||||
@ -33,8 +28,11 @@ import com.java2nb.common.utils.R;
|
|||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/novel/news")
|
@RequestMapping("/novel/news")
|
||||||
public class NewsController {
|
public class NewsController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private NewsService newsService;
|
private NewsService newsService;
|
||||||
|
@Autowired
|
||||||
|
private RedisTemplate<Object, Object> redisTemplate;
|
||||||
|
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
@RequiresPermissions("novel:news:news")
|
@RequiresPermissions("novel:news:news")
|
||||||
@ -66,7 +64,7 @@ public class NewsController {
|
|||||||
@GetMapping("/edit/{id}")
|
@GetMapping("/edit/{id}")
|
||||||
@RequiresPermissions("novel:news:edit")
|
@RequiresPermissions("novel:news:edit")
|
||||||
String edit(@PathVariable("id") Long id, Model model) {
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
NewsDO news = newsService.get(id);
|
NewsDO news = newsService.get(id);
|
||||||
model.addAttribute("news", news);
|
model.addAttribute("news", news);
|
||||||
return "novel/news/edit";
|
return "novel/news/edit";
|
||||||
}
|
}
|
||||||
@ -75,7 +73,7 @@ public class NewsController {
|
|||||||
@GetMapping("/detail/{id}")
|
@GetMapping("/detail/{id}")
|
||||||
@RequiresPermissions("novel:news:detail")
|
@RequiresPermissions("novel:news:detail")
|
||||||
String detail(@PathVariable("id") Long id, Model model) {
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
NewsDO news = newsService.get(id);
|
NewsDO news = newsService.get(id);
|
||||||
model.addAttribute("news", news);
|
model.addAttribute("news", news);
|
||||||
return "novel/news/detail";
|
return "novel/news/detail";
|
||||||
}
|
}
|
||||||
@ -87,8 +85,9 @@ public class NewsController {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
@RequiresPermissions("novel:news:add")
|
@RequiresPermissions("novel:news:add")
|
||||||
public R save( NewsDO news) {
|
public R save(NewsDO news) {
|
||||||
if (newsService.save(news) > 0) {
|
if (newsService.save(news) > 0) {
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_NEWS_KEY);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
return R.error();
|
return R.error();
|
||||||
@ -101,8 +100,9 @@ public class NewsController {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping("/update")
|
@RequestMapping("/update")
|
||||||
@RequiresPermissions("novel:news:edit")
|
@RequiresPermissions("novel:news:edit")
|
||||||
public R update( NewsDO news) {
|
public R update(NewsDO news) {
|
||||||
newsService.update(news);
|
newsService.update(news);
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_NEWS_KEY);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,8 +113,9 @@ public class NewsController {
|
|||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequiresPermissions("novel:news:remove")
|
@RequiresPermissions("novel:news:remove")
|
||||||
public R remove( Long id) {
|
public R remove(Long id) {
|
||||||
if (newsService.remove(id) > 0) {
|
if (newsService.remove(id) > 0) {
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_NEWS_KEY);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
return R.error();
|
return R.error();
|
||||||
@ -128,7 +129,8 @@ public class NewsController {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequiresPermissions("novel:news:batchRemove")
|
@RequiresPermissions("novel:news:batchRemove")
|
||||||
public R remove(@RequestParam("ids[]") Long[] ids) {
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
newsService.batchRemove(ids);
|
newsService.batchRemove(ids);
|
||||||
|
redisTemplate.delete(CacheKey.INDEX_NEWS_KEY);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserFeedbackDO;
|
||||||
|
import com.java2nb.novel.service.UserFeedbackService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 11:08:54
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/userFeedback")
|
||||||
|
public class UserFeedbackController {
|
||||||
|
@Autowired
|
||||||
|
private UserFeedbackService userFeedbackService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:userFeedback:userFeedback")
|
||||||
|
String UserFeedback() {
|
||||||
|
return "novel/userFeedback/userFeedback";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取列表", notes = "获取列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:userFeedback:userFeedback")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<UserFeedbackDO> userFeedbackList = userFeedbackService.list(query);
|
||||||
|
int total = userFeedbackService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(userFeedbackList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增页面", notes = "新增页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:userFeedback:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/userFeedback/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改页面", notes = "修改页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:userFeedback:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
UserFeedbackDO userFeedback = userFeedbackService.get(id);
|
||||||
|
model.addAttribute("userFeedback", userFeedback);
|
||||||
|
return "novel/userFeedback/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看页面", notes = "查看页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:userFeedback:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
UserFeedbackDO userFeedback = userFeedbackService.get(id);
|
||||||
|
model.addAttribute("userFeedback", userFeedback);
|
||||||
|
return "novel/userFeedback/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增", notes = "新增")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:userFeedback:add")
|
||||||
|
public R save( UserFeedbackDO userFeedback) {
|
||||||
|
if (userFeedbackService.save(userFeedback) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改", notes = "修改")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:userFeedback:edit")
|
||||||
|
public R update( UserFeedbackDO userFeedback) {
|
||||||
|
userFeedbackService.update(userFeedback);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除", notes = "删除")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:userFeedback:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (userFeedbackService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除", notes = "批量删除")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:userFeedback:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
userFeedbackService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -28,7 +28,7 @@ public class WebsiteInfoController {
|
|||||||
private WebsiteInfoService websiteInfoService;
|
private WebsiteInfoService websiteInfoService;
|
||||||
|
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
@RequiresPermissions("novel:websiteInfo:detail")
|
@RequiresPermissions("novel:websiteInfo:websiteInfo")
|
||||||
String detail(Model model) {
|
String detail(Model model) {
|
||||||
WebsiteInfoDO websiteInfo = websiteInfoService.get(1L);
|
WebsiteInfoDO websiteInfo = websiteInfoService.get(1L);
|
||||||
model.addAttribute("websiteInfo", websiteInfo);
|
model.addAttribute("websiteInfo", websiteInfo);
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookSettingDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页小说设置表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 10:01:13
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BookSettingDao {
|
||||||
|
|
||||||
|
BookSettingDO get(Long id);
|
||||||
|
|
||||||
|
List<BookSettingDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(BookSettingDO bookSetting);
|
||||||
|
|
||||||
|
int update(BookSettingDO bookSetting);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserFeedbackDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 11:08:54
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserFeedbackDao {
|
||||||
|
|
||||||
|
UserFeedbackDO get(Long id);
|
||||||
|
|
||||||
|
List<UserFeedbackDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(UserFeedbackDO userFeedback);
|
||||||
|
|
||||||
|
int update(UserFeedbackDO userFeedback);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,175 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页小说设置表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 10:01:13
|
||||||
|
*/
|
||||||
|
public class BookSettingDO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//小说ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long bookId;
|
||||||
|
//排序号
|
||||||
|
private Integer sort;
|
||||||
|
//类型,0:轮播图,1:顶部小说栏设置,2:本周强推,3:热门推荐,4:精品推荐
|
||||||
|
private Integer type;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//创建人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
//更新人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long updateUserId;
|
||||||
|
|
||||||
|
private String bookName;
|
||||||
|
|
||||||
|
public String getBookName() {
|
||||||
|
return bookName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBookName(String bookName) {
|
||||||
|
this.bookName = bookName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:小说ID
|
||||||
|
*/
|
||||||
|
public void setBookId(Long bookId) {
|
||||||
|
this.bookId = bookId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:小说ID
|
||||||
|
*/
|
||||||
|
public Long getBookId() {
|
||||||
|
return bookId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:排序号
|
||||||
|
*/
|
||||||
|
public void setSort(Integer sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:排序号
|
||||||
|
*/
|
||||||
|
public Integer getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:类型,0:轮播图,1:顶部小说栏设置,2:本周强推,3:热门推荐,4:精品推荐
|
||||||
|
*/
|
||||||
|
public void setType(Integer type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:类型,0:轮播图,1:顶部小说栏设置,2:本周强推,3:热门推荐,4:精品推荐
|
||||||
|
*/
|
||||||
|
public Integer getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:创建人ID
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:创建人ID
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:更新人ID
|
||||||
|
*/
|
||||||
|
public void setUpdateUserId(Long updateUserId) {
|
||||||
|
this.updateUserId = updateUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:更新人ID
|
||||||
|
*/
|
||||||
|
public Long getUpdateUserId() {
|
||||||
|
return updateUserId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 11:08:54
|
||||||
|
*/
|
||||||
|
public class UserFeedbackDO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键id
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//用户id
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long userId;
|
||||||
|
//反馈内容
|
||||||
|
private String content;
|
||||||
|
//反馈时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键id
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:主键id
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:用户id
|
||||||
|
*/
|
||||||
|
public void setUserId(Long userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:用户id
|
||||||
|
*/
|
||||||
|
public Long getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:反馈内容
|
||||||
|
*/
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:反馈内容
|
||||||
|
*/
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:反馈时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取:反馈时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookSettingDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 首页小说设置表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 10:01:13
|
||||||
|
*/
|
||||||
|
public interface BookSettingService {
|
||||||
|
|
||||||
|
BookSettingDO get(Long id);
|
||||||
|
|
||||||
|
List<BookSettingDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(BookSettingDO bookSetting);
|
||||||
|
|
||||||
|
int update(BookSettingDO bookSetting);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserFeedbackDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2023-04-18 11:08:54
|
||||||
|
*/
|
||||||
|
public interface UserFeedbackService {
|
||||||
|
|
||||||
|
UserFeedbackDO get(Long id);
|
||||||
|
|
||||||
|
List<UserFeedbackDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(UserFeedbackDO userFeedback);
|
||||||
|
|
||||||
|
int update(UserFeedbackDO userFeedback);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.BookDao;
|
||||||
|
import com.java2nb.novel.dao.BookSettingDao;
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
import com.java2nb.novel.domain.BookSettingDO;
|
||||||
|
import com.java2nb.novel.service.BookSettingService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BookSettingServiceImpl implements BookSettingService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BookSettingDao bookSettingDao;
|
||||||
|
@Autowired
|
||||||
|
private BookDao bookDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BookSettingDO get(Long id) {
|
||||||
|
return bookSettingDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BookSettingDO> list(Map<String, Object> map) {
|
||||||
|
List<BookSettingDO> list = bookSettingDao.list(map);
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
List<Long> bookIds = list.stream().map(BookSettingDO::getBookId).collect(Collectors.toList());
|
||||||
|
Map<Long, String> bookNameMap = bookDao.batchGet(bookIds).stream()
|
||||||
|
.collect(Collectors.toMap(BookDO::getId, BookDO::getBookName));
|
||||||
|
list = list.stream().filter(v -> bookNameMap.containsKey(v.getBookId())).collect(Collectors.toList());
|
||||||
|
list.forEach(v -> v.setBookName(bookNameMap.get(v.getBookId())));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map) {
|
||||||
|
return bookSettingDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(BookSettingDO bookSetting) {
|
||||||
|
return bookSettingDao.save(bookSetting);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(BookSettingDO bookSetting) {
|
||||||
|
return bookSettingDao.update(bookSetting);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id) {
|
||||||
|
return bookSettingDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids) {
|
||||||
|
return bookSettingDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.UserDao;
|
||||||
|
import com.java2nb.novel.dao.UserFeedbackDao;
|
||||||
|
import com.java2nb.novel.domain.UserDO;
|
||||||
|
import com.java2nb.novel.domain.UserFeedbackDO;
|
||||||
|
import com.java2nb.novel.service.UserFeedbackService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserFeedbackServiceImpl implements UserFeedbackService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserFeedbackDao userFeedbackDao;
|
||||||
|
@Autowired
|
||||||
|
private UserDao userDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserFeedbackDO get(Long id) {
|
||||||
|
return userFeedbackDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserFeedbackDO> list(Map<String, Object> map) {
|
||||||
|
List<UserFeedbackDO> list = userFeedbackDao.list(map);
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
List<Long> userIds = list.stream().map(UserFeedbackDO::getUserId).collect(Collectors.toList());
|
||||||
|
Map<Long, String> userNameMap = userDao.batchGet(userIds).stream()
|
||||||
|
.collect(Collectors.toMap(UserDO::getId, UserDO::getUsername));
|
||||||
|
list.forEach(v -> v.setUserName(userNameMap.get(v.getUserId())));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map) {
|
||||||
|
return userFeedbackDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(UserFeedbackDO userFeedback) {
|
||||||
|
return userFeedbackDao.save(userFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(UserFeedbackDO userFeedback) {
|
||||||
|
return userFeedbackDao.update(userFeedback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id) {
|
||||||
|
return userFeedbackDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids) {
|
||||||
|
return userFeedbackDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,131 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.BookSettingDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.BookSettingDO">
|
||||||
|
select `id`,
|
||||||
|
`book_id`,
|
||||||
|
`sort`,
|
||||||
|
`type`,
|
||||||
|
`create_time`,
|
||||||
|
`create_user_id`,
|
||||||
|
`update_time`,
|
||||||
|
`update_user_id`
|
||||||
|
from book_setting
|
||||||
|
where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.BookSettingDO">
|
||||||
|
select `id`,`book_id`,`sort`,`type`,`create_time`,`create_user_id`,`update_time`,`update_user_id` from
|
||||||
|
book_setting
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
|
<if test="bookId != null and bookId != ''">and book_id = #{bookId}</if>
|
||||||
|
<if test="sort != null and sort != ''">and sort = #{sort}</if>
|
||||||
|
<if test="type != null and type != ''">and type = #{type}</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 book_setting t1 inner join book t2 on t1.book_id = t2.id
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''">and t1.id = #{id}</if>
|
||||||
|
<if test="bookId != null and bookId != ''">and t1.book_id = #{bookId}</if>
|
||||||
|
<if test="sort != null and sort != ''">and t1.sort = #{sort}</if>
|
||||||
|
<if test="type != null and type != ''">and t1.type = #{type}</if>
|
||||||
|
<if test="createTime != null and createTime != ''">and t1.create_time = #{createTime}</if>
|
||||||
|
<if test="createUserId != null and createUserId != ''">and t1.create_user_id = #{createUserId}</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">and t1.update_time = #{updateTime}</if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''">and t1.update_user_id = #{updateUserId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.BookSettingDO">
|
||||||
|
insert into book_setting
|
||||||
|
(`id`,
|
||||||
|
`book_id`,
|
||||||
|
`sort`,
|
||||||
|
`type`,
|
||||||
|
`create_time`,
|
||||||
|
`create_user_id`,
|
||||||
|
`update_time`,
|
||||||
|
`update_user_id`)
|
||||||
|
values (#{id},
|
||||||
|
#{bookId},
|
||||||
|
#{sort},
|
||||||
|
#{type},
|
||||||
|
#{createTime},
|
||||||
|
#{createUserId},
|
||||||
|
#{updateTime},
|
||||||
|
#{updateUserId})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookSettingDO">
|
||||||
|
insert into book_setting
|
||||||
|
(
|
||||||
|
<if test="id != null">`id`,</if>
|
||||||
|
<if test="bookId != null">`book_id`,</if>
|
||||||
|
<if test="sort != null">`sort`,</if>
|
||||||
|
<if test="type != null">`type`,</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="bookId != null">#{bookId},</if>
|
||||||
|
<if test="sort != null">#{sort},</if>
|
||||||
|
<if test="type != null">#{type},</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.BookSettingDO">
|
||||||
|
update book_setting
|
||||||
|
<set>
|
||||||
|
<if test="bookId != null">`book_id` = #{bookId},</if>
|
||||||
|
<if test="sort != null">`sort` = #{sort},</if>
|
||||||
|
<if test="type != null">`type` = #{type},</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 book_setting
|
||||||
|
where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from book_setting where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,96 @@
|
|||||||
|
<?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.UserFeedbackDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.UserFeedbackDO">
|
||||||
|
select `id`,`user_id`,`content`,`create_time` from user_feedback where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.UserFeedbackDO">
|
||||||
|
select `id`,`user_id`,`content`,`create_time` from user_feedback
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="userId != null and userId != ''"> and user_id = #{userId} </if>
|
||||||
|
<if test="content != null and content != ''"> and content = #{content} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </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 user_feedback
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="userId != null and userId != ''"> and user_id = #{userId} </if>
|
||||||
|
<if test="content != null and content != ''"> and content = #{content} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.UserFeedbackDO">
|
||||||
|
insert into user_feedback
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`user_id`,
|
||||||
|
`content`,
|
||||||
|
`create_time`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{userId},
|
||||||
|
#{content},
|
||||||
|
#{createTime}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.UserFeedbackDO">
|
||||||
|
insert into user_feedback
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="userId != null"> `user_id`, </if>
|
||||||
|
<if test="content != null"> `content`, </if>
|
||||||
|
<if test="createTime != null"> `create_time` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="userId != null"> #{userId}, </if>
|
||||||
|
<if test="content != null"> #{content}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.UserFeedbackDO">
|
||||||
|
update user_feedback
|
||||||
|
<set>
|
||||||
|
<if test="userId != null">`user_id` = #{userId}, </if>
|
||||||
|
<if test="content != null">`content` = #{content}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from user_feedback where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from user_feedback where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -50,9 +50,6 @@ function load() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
|
||||||
checkbox: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
@ -60,6 +57,11 @@ function load() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '小说ID'
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
field: 'workDirection',
|
field: 'workDirection',
|
||||||
title: '作品方向',
|
title: '作品方向',
|
||||||
|
@ -0,0 +1,119 @@
|
|||||||
|
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/bookSetting/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: {
|
||||||
|
bookId: {
|
||||||
|
required: true
|
||||||
|
}, sort: {
|
||||||
|
required: true
|
||||||
|
}, type: {
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
|
messages: {
|
||||||
|
bookId: {
|
||||||
|
required: icon + "请选择小说ID"
|
||||||
|
}, sort: {
|
||||||
|
required: icon + "请选择排序号"
|
||||||
|
}, type: {
|
||||||
|
required: icon + "请选择推荐类型"
|
||||||
|
}, }
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,191 @@
|
|||||||
|
var prefix = "/novel/bookSetting"
|
||||||
|
$(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: [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'bookId',
|
||||||
|
title: '小说ID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'bookName',
|
||||||
|
title: '小说名'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'type',
|
||||||
|
title: '推荐类型',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return formatDict("book_rec_type", value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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> ';
|
||||||
|
return d + e;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
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,121 @@
|
|||||||
|
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/bookSetting/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: {
|
||||||
|
bookId:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, sort:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, type:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
|
messages: {
|
||||||
|
bookId:
|
||||||
|
{
|
||||||
|
required: icon + "请选择小说ID"
|
||||||
|
}, sort:
|
||||||
|
{
|
||||||
|
required: icon + "请选择排序号"
|
||||||
|
}, type:
|
||||||
|
{
|
||||||
|
required: icon + "请选择推荐类型"
|
||||||
|
}, }
|
||||||
|
})
|
||||||
|
}
|
@ -50,9 +50,6 @@ function load() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
|
||||||
checkbox: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
|
@ -50,9 +50,6 @@ function load() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
|
||||||
checkbox: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
|
@ -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/userFeedback/save",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/userFeedback/update",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,177 @@
|
|||||||
|
var prefix = "/novel/userFeedback"
|
||||||
|
$(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: [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'userName',
|
||||||
|
title: '反馈用户'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'content',
|
||||||
|
title: '反馈内容'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '反馈时间'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
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,18 @@
|
|||||||
|
-- 菜单SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES ('1', '首页小说设置表', 'novel/bookSetting', 'novel:bookSetting:bookSetting', '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:bookSetting:detail', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '新增', null, 'novel:bookSetting:add', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '修改', null, 'novel:bookSetting:edit', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '删除', null, 'novel:bookSetting:remove', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '批量删除', null, 'novel:bookSetting:batchRemove', '2', null, '6';
|
@ -0,0 +1,18 @@
|
|||||||
|
-- 菜单SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES ('1', '', 'novel/userFeedback', 'novel:userFeedback:userFeedback', '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:userFeedback:detail', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '新增', null, 'novel:userFeedback:add', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '修改', null, 'novel:userFeedback:edit', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '删除', null, 'novel:userFeedback:remove', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '批量删除', null, 'novel:userFeedback:batchRemove', '2', null, '6';
|
@ -0,0 +1,58 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">小说ID:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="bookId" name="bookId"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">排序号:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="sort" name="sort"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">推荐类型:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
|
||||||
|
<select data-placeholder="--选择--" id="type"
|
||||||
|
name="type"
|
||||||
|
class="form-control chosen-select" tabindex="2"
|
||||||
|
dict-type="book_rec_type">
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</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/bookSetting/add.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,58 @@
|
|||||||
|
<!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-right">
|
||||||
|
<button class="btn btn-success" onclick="reLoad()">查询</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form id="searchForm">
|
||||||
|
<div class="columns pull-right col-md-2">
|
||||||
|
<select data-placeholder="--推荐类型--" id="type"
|
||||||
|
name="type"
|
||||||
|
class="form-control chosen-select" tabindex="2"
|
||||||
|
dict-type="book_rec_type">
|
||||||
|
</select>
|
||||||
|
</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:bookSetting:edit">
|
||||||
|
<script type="text/javascript">
|
||||||
|
s_edit_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="novel:bookSetting: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/bookSetting/bookSetting.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,90 @@
|
|||||||
|
<!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="${bookSetting.id}"
|
||||||
|
type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">小说ID:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${bookSetting.bookId}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">排序号:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${bookSetting.sort}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">推荐类型:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="book_rec_type"
|
||||||
|
th:attr="dict-value=${bookSetting.type}">
|
||||||
|
</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="${bookSetting.createTime}==null?null:${#dates.format(bookSetting.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="${bookSetting.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="${bookSetting.updateTime}==null?null:${#dates.format(bookSetting.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="${bookSetting.updateUserId}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div th:include="include::footer"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,60 @@
|
|||||||
|
<!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="${bookSetting.id}"
|
||||||
|
type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">小说ID:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="bookId" name="bookId"
|
||||||
|
th:value="${bookSetting.bookId}"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">排序号:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="sort" name="sort"
|
||||||
|
th:value="${bookSetting.sort}"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">推荐类型:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
|
||||||
|
<select data-placeholder="--选择--" id="type" disabled
|
||||||
|
name="type"
|
||||||
|
class="form-control chosen-select" tabindex="2"
|
||||||
|
dict-type="book_rec_type"
|
||||||
|
th:attr="dict-value=${bookSetting.type}">
|
||||||
|
</select>
|
||||||
|
</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/bookSetting/edit.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -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="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户id:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="userId" name="userId"
|
||||||
|
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="content" name="content"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">反馈时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
|
id="createTime"
|
||||||
|
name="createTime"
|
||||||
|
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||||
|
style="background-color: #fff;" readonly="readonly"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<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/userFeedback/add.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,51 @@
|
|||||||
|
<!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="${userFeedback.id}"
|
||||||
|
type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户id:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${userFeedback.userId}">
|
||||||
|
</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="${userFeedback.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="${userFeedback.createTime}==null?null:${#dates.format(userFeedback.createTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div th:include="include::footer"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,59 @@
|
|||||||
|
<!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="${userFeedback.id}"
|
||||||
|
type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户id:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="userId" name="userId"
|
||||||
|
th:value="${userFeedback.userId}"
|
||||||
|
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="content" name="content"
|
||||||
|
th:value="${userFeedback.content}"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">反馈时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
|
id="createTime"
|
||||||
|
name="createTime"
|
||||||
|
th:value="${userFeedback.createTime}==null?null:${#dates.format(userFeedback.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">
|
||||||
|
<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/userFeedback/edit.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,45 @@
|
|||||||
|
<!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>
|
||||||
|
<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:userFeedback:edit">
|
||||||
|
<script type="text/javascript">
|
||||||
|
s_edit_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="novel:userFeedback: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/userFeedback/userFeedback.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<version>4.0.0</version>
|
<version>4.1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package com.java2nb.novel.core.utils;
|
package com.java2nb.novel.core.utils;
|
||||||
|
|
||||||
import com.java2nb.novel.core.cache.CacheService;
|
import lombok.SneakyThrows;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,27 +18,27 @@ public class RandomValidateCodeUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 放到session中的key
|
* 放到session中的key
|
||||||
* */
|
*/
|
||||||
public static final String RANDOM_CODE_KEY = "randomValidateCodeKey";
|
public static final String RANDOM_CODE_KEY = "randomValidateCodeKey";
|
||||||
/**
|
/**
|
||||||
* 随机产生只有数字的字符串 private String
|
* 随机产生只有数字的字符串 private String
|
||||||
* */
|
*/
|
||||||
private String randString = "0123456789";
|
private String randString = "0123456789";
|
||||||
/**
|
/**
|
||||||
* 图片宽
|
* 图片宽
|
||||||
* */
|
*/
|
||||||
private int width = 100;
|
private int width = 100;
|
||||||
/**
|
/**
|
||||||
* 图片高
|
* 图片高
|
||||||
* */
|
*/
|
||||||
private int height = 38;
|
private int height = 38;
|
||||||
/**
|
/**
|
||||||
* 干扰线数量
|
* 干扰线数量
|
||||||
* */
|
*/
|
||||||
private int lineSize = 40;
|
private int lineSize = 40;
|
||||||
/**
|
/**
|
||||||
* 随机产生字符数量
|
* 随机产生字符数量
|
||||||
* */
|
*/
|
||||||
private int stringNum = 4;
|
private int stringNum = 4;
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(RandomValidateCodeUtil.class);
|
private static final Logger logger = LoggerFactory.getLogger(RandomValidateCodeUtil.class);
|
||||||
@ -69,9 +69,10 @@ public class RandomValidateCodeUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成随机图片
|
* 生成随机码图片
|
||||||
*/
|
*/
|
||||||
public void getRandcode(CacheService cacheService, HttpServletResponse response) {
|
@SneakyThrows
|
||||||
|
public String genRandCodeImage(OutputStream out) {
|
||||||
// BufferedImage类是具有缓冲区的Image类,Image类是用于描述图像信息的类
|
// BufferedImage类是具有缓冲区的Image类,Image类是用于描述图像信息的类
|
||||||
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
|
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
|
||||||
// 产生Image对象的Graphics对象,改对象可以在图像上进行各种绘制操作
|
// 产生Image对象的Graphics对象,改对象可以在图像上进行各种绘制操作
|
||||||
@ -80,7 +81,7 @@ public class RandomValidateCodeUtil {
|
|||||||
g.fillRect(0, 0, width, height);
|
g.fillRect(0, 0, width, height);
|
||||||
//字体大小
|
//字体大小
|
||||||
//字体颜色
|
//字体颜色
|
||||||
g.setColor(new Color(204,204,204));
|
g.setColor(new Color(204, 204, 204));
|
||||||
// 绘制干扰线
|
// 绘制干扰线
|
||||||
for (int i = 0; i <= lineSize; i++) {
|
for (int i = 0; i <= lineSize; i++) {
|
||||||
drowLine(g);
|
drowLine(g);
|
||||||
@ -90,17 +91,10 @@ public class RandomValidateCodeUtil {
|
|||||||
for (int i = 1; i <= stringNum; i++) {
|
for (int i = 1; i <= stringNum; i++) {
|
||||||
randomString = drowString(g, randomString, i);
|
randomString = drowString(g, randomString, i);
|
||||||
}
|
}
|
||||||
logger.info(randomString);
|
|
||||||
//将生成的随机字符串保存到缓存中
|
|
||||||
cacheService.set(RANDOM_CODE_KEY,randomString,60*5);
|
|
||||||
g.dispose();
|
g.dispose();
|
||||||
try {
|
// 将内存中的图片通过流动形式输出到客户端
|
||||||
// 将内存中的图片通过流动形式输出到客户端
|
ImageIO.write(image, "JPEG", out);
|
||||||
ImageIO.write(image, "JPEG", response.getOutputStream());
|
return randomString;
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("将内存中的图片通过流动形式输出到客户端失败>>>> ", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,9 +103,9 @@ public class RandomValidateCodeUtil {
|
|||||||
private String drowString(Graphics g, String randomString, int i) {
|
private String drowString(Graphics g, String randomString, int i) {
|
||||||
g.setFont(getFont());
|
g.setFont(getFont());
|
||||||
g.setColor(new Color(random.nextInt(101), random.nextInt(111), random
|
g.setColor(new Color(random.nextInt(101), random.nextInt(111), random
|
||||||
.nextInt(121)));
|
.nextInt(121)));
|
||||||
String rand = String.valueOf(getRandomString(random.nextInt(randString
|
String rand = String.valueOf(getRandomString(random.nextInt(randString
|
||||||
.length())));
|
.length())));
|
||||||
randomString += rand;
|
randomString += rand;
|
||||||
g.translate(random.nextInt(3), random.nextInt(3));
|
g.translate(random.nextInt(3), random.nextInt(3));
|
||||||
g.drawString(rand, 13 * i, 23);
|
g.drawString(rand, 13 * i, 23);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<version>4.0.0</version>
|
<version>4.1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<version>4.0.0</version>
|
<version>4.1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import com.java2nb.novel.core.cache.CacheService;
|
|||||||
import com.java2nb.novel.core.enums.ResponseStatus;
|
import com.java2nb.novel.core.enums.ResponseStatus;
|
||||||
import com.java2nb.novel.core.utils.Constants;
|
import com.java2nb.novel.core.utils.Constants;
|
||||||
import com.java2nb.novel.core.utils.FileUtil;
|
import com.java2nb.novel.core.utils.FileUtil;
|
||||||
|
import com.java2nb.novel.core.utils.IpUtil;
|
||||||
import com.java2nb.novel.core.utils.RandomValidateCodeUtil;
|
import com.java2nb.novel.core.utils.RandomValidateCodeUtil;
|
||||||
import io.github.xxyopen.model.resp.RestResult;
|
import io.github.xxyopen.model.resp.RestResult;
|
||||||
import io.github.xxyopen.util.UUIDUtil;
|
import io.github.xxyopen.util.UUIDUtil;
|
||||||
@ -41,24 +42,25 @@ public class FileController {
|
|||||||
* 生成验证码
|
* 生成验证码
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "getVerify")
|
@GetMapping(value = "getVerify")
|
||||||
|
@SneakyThrows
|
||||||
public void getVerify(HttpServletRequest request, HttpServletResponse response) {
|
public void getVerify(HttpServletRequest request, HttpServletResponse response) {
|
||||||
try {
|
//设置相应类型,告诉浏览器输出的内容为图片
|
||||||
//设置相应类型,告诉浏览器输出的内容为图片
|
response.setContentType("image/jpeg");
|
||||||
response.setContentType("image/jpeg");
|
//设置响应头信息,告诉浏览器不要缓存此内容
|
||||||
//设置响应头信息,告诉浏览器不要缓存此内容
|
response.setHeader("Pragma", "No-cache");
|
||||||
response.setHeader("Pragma", "No-cache");
|
response.setHeader("Cache-Control", "no-cache");
|
||||||
response.setHeader("Cache-Control", "no-cache");
|
response.setDateHeader("Expire", 0);
|
||||||
response.setDateHeader("Expire", 0);
|
RandomValidateCodeUtil randomValidateCode = new RandomValidateCodeUtil();
|
||||||
RandomValidateCodeUtil randomValidateCode = new RandomValidateCodeUtil();
|
//输出验证码图片方法
|
||||||
//输出验证码图片方法
|
String randomString = randomValidateCode.genRandCodeImage(response.getOutputStream());
|
||||||
randomValidateCode.getRandcode(cacheService, response);
|
//将生成的随机字符串保存到缓存中
|
||||||
} catch (Exception e) {
|
cacheService.set(RandomValidateCodeUtil.RANDOM_CODE_KEY + ":" + IpUtil.getRealIp(request), randomString,
|
||||||
log.error("获取验证码失败>>>> ", e);
|
60 * 5);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片上传
|
* 图片上传
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@ -67,25 +69,26 @@ public class FileController {
|
|||||||
RestResult<String> upload(@RequestParam("file") MultipartFile file) {
|
RestResult<String> upload(@RequestParam("file") MultipartFile file) {
|
||||||
Date currentDate = new Date();
|
Date currentDate = new Date();
|
||||||
String savePath =
|
String savePath =
|
||||||
Constants.LOCAL_PIC_PREFIX + DateUtils.formatDate(currentDate, "yyyy") + "/" +
|
Constants.LOCAL_PIC_PREFIX + DateUtils.formatDate(currentDate, "yyyy") + "/" +
|
||||||
DateUtils.formatDate(currentDate, "MM") + "/" +
|
DateUtils.formatDate(currentDate, "MM") + "/" +
|
||||||
DateUtils.formatDate(currentDate, "dd");
|
DateUtils.formatDate(currentDate, "dd");
|
||||||
String oriName = file.getOriginalFilename();
|
String oriName = file.getOriginalFilename();
|
||||||
assert oriName != null;
|
assert oriName != null;
|
||||||
String saveFileName = UUIDUtil.getUUID32() + oriName.substring(oriName.lastIndexOf("."));
|
String saveFileName = UUIDUtil.getUUID32() + oriName.substring(oriName.lastIndexOf("."));
|
||||||
File saveFile = new File(picSavePath + savePath, saveFileName);
|
File saveFile = new File(picSavePath + savePath, saveFileName);
|
||||||
if (!saveFile.getParentFile().exists()) {
|
if (!saveFile.getParentFile().exists()) {
|
||||||
boolean isSuccess = saveFile.getParentFile().mkdirs();
|
boolean isSuccess = saveFile.getParentFile().mkdirs();
|
||||||
if(!isSuccess){
|
if (!isSuccess) {
|
||||||
throw new BusinessException(ResponseStatus.FILE_DIR_MAKE_FAIL);
|
throw new BusinessException(ResponseStatus.FILE_DIR_MAKE_FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file.transferTo(saveFile);
|
file.transferTo(saveFile);
|
||||||
if(!FileUtil.isImage(saveFile)){
|
if (!FileUtil.isImage(saveFile)) {
|
||||||
//上传的文件不是图片
|
//上传的文件不是图片
|
||||||
saveFile.delete();
|
saveFile.delete();
|
||||||
throw new BusinessException(ResponseStatus.FILE_NOT_IMAGE);
|
throw new BusinessException(ResponseStatus.FILE_NOT_IMAGE);
|
||||||
};
|
}
|
||||||
|
;
|
||||||
return RestResult.ok(savePath + "/" + saveFileName);
|
return RestResult.ok(savePath + "/" + saveFileName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ package com.java2nb.novel.controller;
|
|||||||
import com.java2nb.novel.core.bean.UserDetails;
|
import com.java2nb.novel.core.bean.UserDetails;
|
||||||
import com.java2nb.novel.core.cache.CacheService;
|
import com.java2nb.novel.core.cache.CacheService;
|
||||||
import com.java2nb.novel.core.enums.ResponseStatus;
|
import com.java2nb.novel.core.enums.ResponseStatus;
|
||||||
|
import com.java2nb.novel.core.utils.IpUtil;
|
||||||
import com.java2nb.novel.core.utils.RandomValidateCodeUtil;
|
import com.java2nb.novel.core.utils.RandomValidateCodeUtil;
|
||||||
import com.java2nb.novel.entity.User;
|
import com.java2nb.novel.entity.User;
|
||||||
import com.java2nb.novel.entity.UserBuyRecord;
|
import com.java2nb.novel.entity.UserBuyRecord;
|
||||||
@ -59,11 +60,12 @@ public class UserController extends BaseController {
|
|||||||
* 注册
|
* 注册
|
||||||
*/
|
*/
|
||||||
@PostMapping("register")
|
@PostMapping("register")
|
||||||
public RestResult<?> register(@Validated({AddGroup.class}) User user, @RequestParam(value = "velCode", defaultValue = "") String velCode) {
|
public RestResult<?> register(@Validated({AddGroup.class}) User user,
|
||||||
|
@RequestParam(value = "velCode", defaultValue = "") String velCode, HttpServletRequest request) {
|
||||||
|
|
||||||
//判断验证码是否正确
|
//判断验证码是否正确
|
||||||
if (!velCode.equals(cacheService.get(RandomValidateCodeUtil.RANDOM_CODE_KEY))) {
|
if (!velCode.equals(
|
||||||
|
cacheService.get(RandomValidateCodeUtil.RANDOM_CODE_KEY + ":" + IpUtil.getRealIp(request)))) {
|
||||||
return RestResult.fail(ResponseStatus.VEL_CODE_ERROR);
|
return RestResult.fail(ResponseStatus.VEL_CODE_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,95 +115,98 @@ public class UserController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 加入书架
|
* 加入书架
|
||||||
* */
|
*/
|
||||||
@PostMapping("addToBookShelf")
|
@PostMapping("addToBookShelf")
|
||||||
public RestResult<Void> addToBookShelf(Long bookId,Long preContentId, HttpServletRequest request) {
|
public RestResult<Void> addToBookShelf(Long bookId, Long preContentId, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
userService.addToBookShelf(userDetails.getId(),bookId,preContentId);
|
userService.addToBookShelf(userDetails.getId(), bookId, preContentId);
|
||||||
return RestResult.ok();
|
return RestResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 移出书架
|
* 移出书架
|
||||||
* */
|
*/
|
||||||
@DeleteMapping("removeFromBookShelf/{bookId}")
|
@DeleteMapping("removeFromBookShelf/{bookId}")
|
||||||
public RestResult<?> removeFromBookShelf(@PathVariable("bookId") Long bookId, HttpServletRequest request) {
|
public RestResult<?> removeFromBookShelf(@PathVariable("bookId") Long bookId, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
userService.removeFromBookShelf(userDetails.getId(),bookId);
|
userService.removeFromBookShelf(userDetails.getId(), bookId);
|
||||||
return RestResult.ok();
|
return RestResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询书架
|
* 分页查询书架
|
||||||
* */
|
*/
|
||||||
@GetMapping("listBookShelfByPage")
|
@GetMapping("listBookShelfByPage")
|
||||||
public RestResult<?> listBookShelfByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize,HttpServletRequest request) {
|
public RestResult<?> listBookShelfByPage(@RequestParam(value = "curr", defaultValue = "1") int page,
|
||||||
|
@RequestParam(value = "limit", defaultValue = "10") int pageSize, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
return RestResult.ok(userService.listBookShelfByPage(userDetails.getId(),page,pageSize));
|
return RestResult.ok(userService.listBookShelfByPage(userDetails.getId(), page, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询阅读记录
|
* 分页查询阅读记录
|
||||||
* */
|
*/
|
||||||
@GetMapping("listReadHistoryByPage")
|
@GetMapping("listReadHistoryByPage")
|
||||||
public RestResult<?> listReadHistoryByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize,HttpServletRequest request) {
|
public RestResult<?> listReadHistoryByPage(@RequestParam(value = "curr", defaultValue = "1") int page,
|
||||||
|
@RequestParam(value = "limit", defaultValue = "10") int pageSize, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
return RestResult.ok(userService.listReadHistoryByPage(userDetails.getId(),page,pageSize));
|
return RestResult.ok(userService.listReadHistoryByPage(userDetails.getId(), page, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加阅读记录
|
* 添加阅读记录
|
||||||
* */
|
*/
|
||||||
@PostMapping("addReadHistory")
|
@PostMapping("addReadHistory")
|
||||||
public RestResult<?> addReadHistory(Long bookId,Long preContentId, HttpServletRequest request) {
|
public RestResult<?> addReadHistory(Long bookId, Long preContentId, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
userService.addReadHistory(userDetails.getId(),bookId,preContentId);
|
userService.addReadHistory(userDetails.getId(), bookId, preContentId);
|
||||||
return RestResult.ok();
|
return RestResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加反馈
|
* 添加反馈
|
||||||
* */
|
*/
|
||||||
@PostMapping("addFeedBack")
|
@PostMapping("addFeedBack")
|
||||||
public RestResult<?> addFeedBack(String content, HttpServletRequest request) {
|
public RestResult<?> addFeedBack(String content, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
userService.addFeedBack(userDetails.getId(),content);
|
userService.addFeedBack(userDetails.getId(), content);
|
||||||
return RestResult.ok();
|
return RestResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询我的反馈列表
|
* 分页查询我的反馈列表
|
||||||
* */
|
*/
|
||||||
@GetMapping("listUserFeedBackByPage")
|
@GetMapping("listUserFeedBackByPage")
|
||||||
public RestResult<?> listUserFeedBackByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize, HttpServletRequest request){
|
public RestResult<?> listUserFeedBackByPage(@RequestParam(value = "curr", defaultValue = "1") int page,
|
||||||
|
@RequestParam(value = "limit", defaultValue = "5") int pageSize, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
return RestResult.ok(userService.listUserFeedBackByPage(userDetails.getId(),page,pageSize));
|
return RestResult.ok(userService.listUserFeedBackByPage(userDetails.getId(), page, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询个人信息
|
* 查询个人信息
|
||||||
* */
|
*/
|
||||||
@GetMapping("userInfo")
|
@GetMapping("userInfo")
|
||||||
public RestResult<?> userInfo(HttpServletRequest request) {
|
public RestResult<?> userInfo(HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
@ -213,15 +218,15 @@ public class UserController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新个人信息
|
* 更新个人信息
|
||||||
* */
|
*/
|
||||||
@PostMapping("updateUserInfo")
|
@PostMapping("updateUserInfo")
|
||||||
public RestResult<?> updateUserInfo(@Validated({UpdateGroup.class}) User user, HttpServletRequest request) {
|
public RestResult<?> updateUserInfo(@Validated({UpdateGroup.class}) User user, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
userService.updateUserInfo(userDetails.getId(),user);
|
userService.updateUserInfo(userDetails.getId(), user);
|
||||||
if(user.getNickName() != null){
|
if (user.getNickName() != null) {
|
||||||
userDetails.setNickName(user.getNickName());
|
userDetails.setNickName(user.getNickName());
|
||||||
Map<String, Object> data = new HashMap<>(1);
|
Map<String, Object> data = new HashMap<>(1);
|
||||||
data.put("token", jwtTokenUtil.generateToken(userDetails));
|
data.put("token", jwtTokenUtil.generateToken(userDetails));
|
||||||
@ -233,36 +238,38 @@ public class UserController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新密码
|
* 更新密码
|
||||||
* */
|
*/
|
||||||
@PostMapping("updatePassword")
|
@PostMapping("updatePassword")
|
||||||
public RestResult<?> updatePassword(String oldPassword,String newPassword1,String newPassword2,HttpServletRequest request) {
|
public RestResult<?> updatePassword(String oldPassword, String newPassword1, String newPassword2,
|
||||||
|
HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
if(!(StringUtils.isNotBlank(newPassword1) && newPassword1.equals(newPassword2))){
|
if (!(StringUtils.isNotBlank(newPassword1) && newPassword1.equals(newPassword2))) {
|
||||||
RestResult.fail(ResponseStatus.TWO_PASSWORD_DIFF);
|
RestResult.fail(ResponseStatus.TWO_PASSWORD_DIFF);
|
||||||
}
|
}
|
||||||
userService.updatePassword(userDetails.getId(),oldPassword,newPassword1);
|
userService.updatePassword(userDetails.getId(), oldPassword, newPassword1);
|
||||||
return RestResult.ok();
|
return RestResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询用户书评
|
* 分页查询用户书评
|
||||||
* */
|
*/
|
||||||
@GetMapping("listCommentByPage")
|
@GetMapping("listCommentByPage")
|
||||||
public RestResult<?> listCommentByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize,HttpServletRequest request) {
|
public RestResult<?> listCommentByPage(@RequestParam(value = "curr", defaultValue = "1") int page,
|
||||||
|
@RequestParam(value = "limit", defaultValue = "5") int pageSize, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
if (userDetails == null) {
|
if (userDetails == null) {
|
||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
return RestResult.ok(bookService.listCommentByPage(userDetails.getId(),null,page,pageSize));
|
return RestResult.ok(bookService.listCommentByPage(userDetails.getId(), null, page, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购买小说章节
|
* 购买小说章节
|
||||||
* */
|
*/
|
||||||
@PostMapping("buyBookIndex")
|
@PostMapping("buyBookIndex")
|
||||||
public RestResult<?> buyBookIndex(UserBuyRecord buyRecord, HttpServletRequest request) {
|
public RestResult<?> buyBookIndex(UserBuyRecord buyRecord, HttpServletRequest request) {
|
||||||
UserDetails userDetails = getUserDetails(request);
|
UserDetails userDetails = getUserDetails(request);
|
||||||
@ -270,12 +277,9 @@ public class UserController extends BaseController {
|
|||||||
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
return RestResult.fail(ResponseStatus.NO_LOGIN);
|
||||||
}
|
}
|
||||||
buyRecord.setBuyAmount(bookService.queryBookIndex(buyRecord.getBookIndexId()).getBookPrice());
|
buyRecord.setBuyAmount(bookService.queryBookIndex(buyRecord.getBookIndexId()).getBookPrice());
|
||||||
userService.buyBookIndex(userDetails.getId(),buyRecord);
|
userService.buyBookIndex(userDetails.getId(), buyRecord);
|
||||||
return RestResult.ok();
|
return RestResult.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.java2nb.novel.core.config;
|
||||||
|
|
||||||
|
import com.java2nb.novel.core.converter.DateConverter;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.format.FormatterRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xiongxiaoyang
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class WebMvcConfig extends WebMvcConfigurerAdapter {
|
||||||
|
@Override
|
||||||
|
public void addFormatters(FormatterRegistry registry) {
|
||||||
|
registry.addConverter(new DateConverter());
|
||||||
|
}
|
||||||
|
}
|
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<artifactId>novel</artifactId>
|
<artifactId>novel</artifactId>
|
||||||
<version>4.0.0</version>
|
<version>4.1.0</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>novel-common</module>
|
<module>novel-common</module>
|
||||||
<module>novel-front</module>
|
<module>novel-front</module>
|
||||||
|
Reference in New Issue
Block a user