mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-01 15:26:37 +00:00
Compare commits
139 Commits
release_v1
...
release_v3
Author | SHA1 | Date | |
---|---|---|---|
2ce51d5fc0 | |||
2f4b671d84 | |||
6ffd8d90d7 | |||
1e2b6f4103 | |||
24c7175872 | |||
a6b009cc84 | |||
04afa759a7 | |||
1be39a0f13 | |||
2fd0349a80 | |||
79fd85ab9b | |||
0b22bbb111 | |||
7f4d315f25 | |||
f7375c5779 | |||
194461f729 | |||
6bf6b44493 | |||
cffa00a54a | |||
b279763383 | |||
cfe19854a5 | |||
28cebad48d | |||
68a1ece57c | |||
77645da2bd | |||
36376aa623 | |||
9e98665cca | |||
9a19a33406 | |||
a4f7042b87 | |||
31aa3192fd | |||
cd11854eff | |||
85f5048fd9 | |||
f625ee38e1 | |||
2c3e346ea7 | |||
66093cb065 | |||
beba6e5154 | |||
04d3aef82b | |||
018daf8d37 | |||
8e0f1f12a4 | |||
165c96cd48 | |||
e343134ce2 | |||
a1adb2c7df | |||
81a82d8e72 | |||
1d33094bd7 | |||
4cccea5d75 | |||
fbfb68583f | |||
655957904b | |||
99e973091d | |||
5fdf618223 | |||
03c4e6c54b | |||
29527301cf | |||
29d03a7a22 | |||
ad4199dc4e | |||
4f7f9af6a9 | |||
ee2a0f514f | |||
70f04bd37c | |||
9d621edaec | |||
56c0a81c1b | |||
6b3b88c147 | |||
894ee67f56 | |||
a88891b72f | |||
5c7724c813 | |||
79c9f3e0f1 | |||
575142f9f3 | |||
83c2460c83 | |||
c7642ac2ef | |||
5af570a514 | |||
0d96ff81b6 | |||
7733cf1e3f | |||
c9c714e71e | |||
3cbb6bf3fb | |||
750e234f60 | |||
c1d485c42b | |||
0e2e6229cd | |||
f8a669eb01 | |||
6d56399d0f | |||
1a0c1f864b | |||
b193aca288 | |||
7a6d7a4442 | |||
5505840b6e | |||
8eb3048b91 | |||
1b138c2aad | |||
f5e2dbaa6b | |||
b6cb9aaedc | |||
f9f1e474ec | |||
06bf848e99 | |||
6e171d20ed | |||
c62acc288e | |||
9975faed01 | |||
8fde3a3725 | |||
430504ee28 | |||
16447c60ec | |||
be7cbe2d6f | |||
8f1ed88b07 | |||
9b9851e7ab | |||
a55edf0408 | |||
856c4c0667 | |||
e4dd5bcb71 | |||
5dbddbdd96 | |||
73be43e1c5 | |||
ce2a3b4647 | |||
68abdeca93 | |||
0b505a3922 | |||
353cb8c536 | |||
e1e1310b9e | |||
4c42ac0d29 | |||
d025d3d514 | |||
a0fb8e481a | |||
80b933db8d | |||
87a060280a | |||
9c78f400dc | |||
c2cdf73893 | |||
a13ea78c3f | |||
0144b77983 | |||
07b9ffde96 | |||
002a0723f7 | |||
8a628f081f | |||
4aa6b82143 | |||
c80b02caf0 | |||
5e16119880 | |||
231b94f1da | |||
92ce982899 | |||
8c2e43c04f | |||
f553d23fb9 | |||
9773b73475 | |||
5543b905cd | |||
e273906441 | |||
83dc04c50b | |||
b4f5b18e93 | |||
fe80c21812 | |||
4c2a7f12c1 | |||
e24e87b546 | |||
b8b074d40a | |||
a662f42bcf | |||
0fa929f9de | |||
401d23871d | |||
4878f17de8 | |||
e9ab6d8bb0 | |||
c8d7a10d9f | |||
d30c6bfd6e | |||
334f3e17a6 | |||
a202100818 | |||
84814e0792 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -11,3 +11,8 @@
|
|||||||
/novel-crawl/novel-crawl.iml
|
/novel-crawl/novel-crawl.iml
|
||||||
/novel-crawl/target
|
/novel-crawl/target
|
||||||
/novel-admin/target
|
/novel-admin/target
|
||||||
|
/*.iml
|
||||||
|
/novel-admin/*.iml
|
||||||
|
.DS_Store
|
||||||
|
/novel-admin/cachedata
|
||||||
|
/novel-admin/logs
|
||||||
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.system.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.system.domain.UserDO;
|
||||||
|
import com.java2nb.system.service.UserService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:46:33
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/system/user")
|
||||||
|
public class UserController {
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("system:user:user")
|
||||||
|
String User() {
|
||||||
|
return "system/user/user";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取列表", notes = "获取列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("system:user:user")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<UserDO> userList = userService.list(query);
|
||||||
|
int total = userService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(userList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增页面", notes = "新增页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("system:user:add")
|
||||||
|
String add() {
|
||||||
|
return "system/user/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改页面", notes = "修改页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("system:user:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
UserDO user = userService.get(id);
|
||||||
|
model.addAttribute("user", user);
|
||||||
|
return "system/user/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看页面", notes = "查看页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("system:user:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
UserDO user = userService.get(id);
|
||||||
|
model.addAttribute("user", user);
|
||||||
|
return "system/user/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增", notes = "新增")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("system:user:add")
|
||||||
|
public R save( UserDO user) {
|
||||||
|
if (userService.save(user) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改", notes = "修改")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("system:user:edit")
|
||||||
|
public R update( UserDO user) {
|
||||||
|
userService.update(user);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除", notes = "删除")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("system:user:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (userService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除", notes = "批量删除")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("system:user:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
userService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.system.dao;
|
||||||
|
|
||||||
|
import com.java2nb.system.domain.UserDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:46:33
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserDao {
|
||||||
|
|
||||||
|
UserDO get(Long id);
|
||||||
|
|
||||||
|
List<UserDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(UserDO user);
|
||||||
|
|
||||||
|
int update(UserDO user);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,177 @@
|
|||||||
|
package com.java2nb.system.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:46:33
|
||||||
|
*/
|
||||||
|
public class UserDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//登录名
|
||||||
|
private String username;
|
||||||
|
//登录密码
|
||||||
|
private String password;
|
||||||
|
//昵称
|
||||||
|
private String nickName;
|
||||||
|
//用户头像
|
||||||
|
private String userPhoto;
|
||||||
|
//用户性别,0:男,1:女
|
||||||
|
private Integer userSex;
|
||||||
|
//账户余额
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long accountBalance;
|
||||||
|
//用户状态,0:正常
|
||||||
|
private Integer status;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:登录名
|
||||||
|
*/
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:登录名
|
||||||
|
*/
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:登录密码
|
||||||
|
*/
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:登录密码
|
||||||
|
*/
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:昵称
|
||||||
|
*/
|
||||||
|
public void setNickName(String nickName) {
|
||||||
|
this.nickName = nickName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:昵称
|
||||||
|
*/
|
||||||
|
public String getNickName() {
|
||||||
|
return nickName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:用户头像
|
||||||
|
*/
|
||||||
|
public void setUserPhoto(String userPhoto) {
|
||||||
|
this.userPhoto = userPhoto;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:用户头像
|
||||||
|
*/
|
||||||
|
public String getUserPhoto() {
|
||||||
|
return userPhoto;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:用户性别,0:男,1:女
|
||||||
|
*/
|
||||||
|
public void setUserSex(Integer userSex) {
|
||||||
|
this.userSex = userSex;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:用户性别,0:男,1:女
|
||||||
|
*/
|
||||||
|
public Integer getUserSex() {
|
||||||
|
return userSex;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:账户余额
|
||||||
|
*/
|
||||||
|
public void setAccountBalance(Long accountBalance) {
|
||||||
|
this.accountBalance = accountBalance;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:账户余额
|
||||||
|
*/
|
||||||
|
public Long getAccountBalance() {
|
||||||
|
return accountBalance;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:用户状态,0:正常
|
||||||
|
*/
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:用户状态,0:正常
|
||||||
|
*/
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.system.service;
|
||||||
|
|
||||||
|
import com.java2nb.system.domain.UserDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:46:33
|
||||||
|
*/
|
||||||
|
public interface UserService {
|
||||||
|
|
||||||
|
UserDO get(Long id);
|
||||||
|
|
||||||
|
List<UserDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(UserDO user);
|
||||||
|
|
||||||
|
int update(UserDO user);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.java2nb.system.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.java2nb.system.dao.UserDao;
|
||||||
|
import com.java2nb.system.domain.UserDO;
|
||||||
|
import com.java2nb.system.service.UserService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserServiceImpl implements UserService {
|
||||||
|
@Autowired
|
||||||
|
private UserDao userDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDO get(Long id){
|
||||||
|
return userDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserDO> list(Map<String, Object> map){
|
||||||
|
return userDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return userDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(UserDO user){
|
||||||
|
return userDao.save(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(UserDO user){
|
||||||
|
return userDao.update(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return userDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return userDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,138 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.system.dao.UserDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.system.domain.UserDO">
|
||||||
|
select `id`,`username`,`password`,`nick_name`,`user_photo`,`user_sex`,`account_balance`,`status`,`create_time`,`update_time` from user where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.system.domain.UserDO">
|
||||||
|
select `id`,`username`,`password`,`nick_name`,`user_photo`,`user_sex`,`account_balance`,`status`,`create_time`,`update_time` from user
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="username != null and username != ''"> and username = #{username} </if>
|
||||||
|
<if test="password != null and password != ''"> and password = #{password} </if>
|
||||||
|
<if test="nickName != null and nickName != ''"> and nick_name = #{nickName} </if>
|
||||||
|
<if test="userPhoto != null and userPhoto != ''"> and user_photo = #{userPhoto} </if>
|
||||||
|
<if test="userSex != null and userSex != ''"> and user_sex = #{userSex} </if>
|
||||||
|
<if test="accountBalance != null and accountBalance != ''"> and account_balance = #{accountBalance} </if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from user
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="username != null and username != ''"> and username = #{username} </if>
|
||||||
|
<if test="password != null and password != ''"> and password = #{password} </if>
|
||||||
|
<if test="nickName != null and nickName != ''"> and nick_name = #{nickName} </if>
|
||||||
|
<if test="userPhoto != null and userPhoto != ''"> and user_photo = #{userPhoto} </if>
|
||||||
|
<if test="userSex != null and userSex != ''"> and user_sex = #{userSex} </if>
|
||||||
|
<if test="accountBalance != null and accountBalance != ''"> and account_balance = #{accountBalance} </if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.system.domain.UserDO">
|
||||||
|
insert into user
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`username`,
|
||||||
|
`password`,
|
||||||
|
`nick_name`,
|
||||||
|
`user_photo`,
|
||||||
|
`user_sex`,
|
||||||
|
`account_balance`,
|
||||||
|
`status`,
|
||||||
|
`create_time`,
|
||||||
|
`update_time`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{username},
|
||||||
|
#{password},
|
||||||
|
#{nickName},
|
||||||
|
#{userPhoto},
|
||||||
|
#{userSex},
|
||||||
|
#{accountBalance},
|
||||||
|
#{status},
|
||||||
|
#{createTime},
|
||||||
|
#{updateTime}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.system.domain.UserDO">
|
||||||
|
insert into user
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="username != null"> `username`, </if>
|
||||||
|
<if test="password != null"> `password`, </if>
|
||||||
|
<if test="nickName != null"> `nick_name`, </if>
|
||||||
|
<if test="userPhoto != null"> `user_photo`, </if>
|
||||||
|
<if test="userSex != null"> `user_sex`, </if>
|
||||||
|
<if test="accountBalance != null"> `account_balance`, </if>
|
||||||
|
<if test="status != null"> `status`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="updateTime != null"> `update_time` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="username != null"> #{username}, </if>
|
||||||
|
<if test="password != null"> #{password}, </if>
|
||||||
|
<if test="nickName != null"> #{nickName}, </if>
|
||||||
|
<if test="userPhoto != null"> #{userPhoto}, </if>
|
||||||
|
<if test="userSex != null"> #{userSex}, </if>
|
||||||
|
<if test="accountBalance != null"> #{accountBalance}, </if>
|
||||||
|
<if test="status != null"> #{status}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="updateTime != null"> #{updateTime} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.system.domain.UserDO">
|
||||||
|
update user
|
||||||
|
<set>
|
||||||
|
<if test="username != null">`username` = #{username}, </if>
|
||||||
|
<if test="password != null">`password` = #{password}, </if>
|
||||||
|
<if test="nickName != null">`nick_name` = #{nickName}, </if>
|
||||||
|
<if test="userPhoto != null">`user_photo` = #{userPhoto}, </if>
|
||||||
|
<if test="userSex != null">`user_sex` = #{userSex}, </if>
|
||||||
|
<if test="accountBalance != null">`account_balance` = #{accountBalance}, </if>
|
||||||
|
<if test="status != null">`status` = #{status}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from user where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from user where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
@ -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: "/system/user/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: "/system/user/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,231 @@
|
|||||||
|
var prefix = "/system/user"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '主键'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'username',
|
||||||
|
title: '登录名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'password',
|
||||||
|
title: '登录密码'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'nickName',
|
||||||
|
title: '昵称'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'userPhoto',
|
||||||
|
title: '用户头像'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'userSex',
|
||||||
|
title: '用户性别,0:男,1:女'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'accountBalance',
|
||||||
|
title: '账户余额'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: '用户状态,0:正常'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'updateTime',
|
||||||
|
title: '更新时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return d + e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
-- 菜单SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
VALUES ('1', '', 'system/user', 'system:user:user', '1', 'fa', '6');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
set @parentId = @@identity;
|
||||||
|
|
||||||
|
-- 菜单对应按钮SQL
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '查看', null, 'system:user:detail', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '新增', null, 'system:user:add', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '修改', null, 'system:user:edit', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '删除', null, 'system:user:remove', '2', null, '6';
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||||
|
SELECT @parentId, '批量删除', null, 'system:user:batchRemove', '2', null, '6';
|
@ -0,0 +1,113 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox float-e-margins">
|
||||||
|
<div class="ibox-content">
|
||||||
|
<form class="form-horizontal m-t" id="signupForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">登录名:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="username" name="username"
|
||||||
|
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="password" name="password"
|
||||||
|
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="nickName" name="nickName"
|
||||||
|
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="userPhoto" name="userPhoto"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户性别,0:男,1:女:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="userSex" name="userSex"
|
||||||
|
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="accountBalance" name="accountBalance"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户状态,0:正常:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="status" name="status"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">创建时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
|
id="createTime"
|
||||||
|
name="createTime"
|
||||||
|
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||||
|
style="background-color: #fff;" readonly="readonly"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">更新时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
|
id="updateTime"
|
||||||
|
name="updateTime"
|
||||||
|
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||||
|
style="background-color: #fff;" readonly="readonly"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<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/system/user/add.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,110 @@
|
|||||||
|
<!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="${user.id}"
|
||||||
|
type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">登录名:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${user.username}">
|
||||||
|
</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="${user.password}">
|
||||||
|
</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="${user.nickName}">
|
||||||
|
</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="${user.userPhoto}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户性别,0:男,1:女:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${user.userSex}">
|
||||||
|
</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="${user.accountBalance}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户状态,0:正常:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${user.status}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">创建时间:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${user.createTime}==null?null:${#dates.format(user.createTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">更新时间:</label>
|
||||||
|
|
||||||
|
<div style="padding-top:8px" class="col-sm-8"
|
||||||
|
th:text="${user.updateTime}==null?null:${#dates.format(user.updateTime,'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,115 @@
|
|||||||
|
<!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="${user.id}"
|
||||||
|
type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">登录名:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="username" name="username"
|
||||||
|
th:value="${user.username}"
|
||||||
|
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="password" name="password"
|
||||||
|
th:value="${user.password}"
|
||||||
|
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="nickName" name="nickName"
|
||||||
|
th:value="${user.nickName}"
|
||||||
|
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="userPhoto" name="userPhoto"
|
||||||
|
th:value="${user.userPhoto}"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户性别,0:男,1:女:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="userSex" name="userSex"
|
||||||
|
th:value="${user.userSex}"
|
||||||
|
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="accountBalance" name="accountBalance"
|
||||||
|
th:value="${user.accountBalance}"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">用户状态,0:正常:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input id="status" name="status"
|
||||||
|
th:value="${user.status}"
|
||||||
|
class="form-control"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">创建时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
|
id="createTime"
|
||||||
|
name="createTime"
|
||||||
|
th:value="${user.createTime}==null?null:${#dates.format(user.createTime,'yyyy-MM-dd HH:mm:ss')}"
|
||||||
|
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||||
|
style="background-color: #fff;" readonly="readonly"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">更新时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input type="text" class="laydate-icon layer-date form-control"
|
||||||
|
id="updateTime"
|
||||||
|
name="updateTime"
|
||||||
|
th:value="${user.updateTime}==null?null:${#dates.format(user.updateTime,'yyyy-MM-dd HH:mm:ss')}"
|
||||||
|
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||||
|
style="background-color: #fff;" readonly="readonly"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<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/system/user/edit.js">
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,66 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<head th:include="include :: header"></head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="wrapper wrapper-content ">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="ibox">
|
||||||
|
<div class="ibox-body">
|
||||||
|
<div class="fixed-table-toolbar">
|
||||||
|
<div class="columns pull-left">
|
||||||
|
<button shiro:hasPermission="system:user:add" type="button"
|
||||||
|
class="btn btn-primary" onclick="add()">
|
||||||
|
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||||
|
</button>
|
||||||
|
<button shiro:hasPermission="system:user:batchRemove" type="button"
|
||||||
|
class="btn btn-danger"
|
||||||
|
onclick="batchRemove()">
|
||||||
|
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="columns pull-right">
|
||||||
|
<button class="btn btn-success" onclick="reLoad()">查询</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form id="searchForm">
|
||||||
|
<div class="columns pull-right col-md-2">
|
||||||
|
<input id="id" name="id" type="text" class="form-control"
|
||||||
|
placeholder="主键">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<table id="exampleTable" data-mobile-responsive="true">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--shiro控制bootstraptable行内按钮看见性 -->
|
||||||
|
<div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var s_detail_h = 'hidden';
|
||||||
|
var s_edit_h = 'hidden';
|
||||||
|
var s_remove_h = 'hidden';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="test:order:detail">
|
||||||
|
<script type="text/javascript">
|
||||||
|
s_detail_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="system:user:edit">
|
||||||
|
<script type="text/javascript">
|
||||||
|
s_edit_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div shiro:hasPermission="system:user:remove">
|
||||||
|
<script type="text/javascript">
|
||||||
|
var s_remove_h = '';
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<div th:include="include :: footer"></div>
|
||||||
|
<script type="text/javascript" src="/js/appjs/system/user/user.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
159
README.md
159
README.md
@ -1,16 +1,29 @@
|
|||||||
[](https://cloud.tencent.com/act/cps/redirect?redirect=1052&cps_key=736e609d66e0ac4e57813316cec6fd0b&from=console)
|
[]( https://cloud.tencent.com/act/cps/redirect?redirect=1052&cps_key=736e609d66e0ac4e57813316cec6fd0b&from=console )
|
||||||
|
|
||||||
# 小说精品屋-plus
|
# 小说精品屋-plus
|
||||||
|
|
||||||
|
#### 新项目:小说精品屋-微服务版
|
||||||
|
|
||||||
|
基于小说精品屋-plus构建的Spring Cloud 微服务小说门户平台。
|
||||||
|
|
||||||
|
Gitee仓库地址: https://gitee.com/xiongxyang/novel-cloud
|
||||||
|
|
||||||
|
GitHub仓库地址: https://github.com/201206030/novel-cloud
|
||||||
|
|
||||||
|
#### 演示地址
|
||||||
|
|
||||||
|
[点击前往](http://47.106.243.172:8888/)
|
||||||
|
|
||||||
|
|
||||||
#### 前言
|
#### 前言
|
||||||
|
|
||||||
小说精品屋-plus致力于打造一个完整的商用小说门户平台。
|
小说精品屋-plus致力于打造一个完整的商用小说门户平台,使用前建议先阅读此文档。
|
||||||
|
|
||||||
#### 项目介绍
|
#### 项目介绍
|
||||||
|
|
||||||
[小说精品屋](https://github.com/201206030/fiction_house)是一个多平台(web、安卓app、微信小程序)、功能完善的小说弹幕网站,包含精品小说专区、轻小说专区和漫画专区。包括小说/漫画分类、小说/漫画搜索、小说/漫画排行、完本小说/漫画、小说/漫画评分、小说/漫画在线阅读、小说/漫画书架、小说/漫画阅读记录、小说下载、小说弹幕、小说/漫画自动爬取、小说内容自动分享到微博、邮件自动推广、链接自动推送到百度搜索引擎等功能。包含电脑端、移动端、微信小程序等多个平台,现已开源web端、安卓端、小程序端源码。
|
小说精品屋-plus是在[小说精品屋](https://github.com/201206030/fiction_house)的基础上,去除了漫画和弹幕模块,专注于小说,是一个多端(PC、移动)阅读、功能完善的小说原创/爬虫网站项目,既包含了作家专区供原创作者上传小说,又提供了爬虫工具通过规则多线程全自动采集任意小说网站数据(已兼容99%的小说网站),新书自动入库,老书自动更新。
|
||||||
|
|
||||||
小说精品屋-plus是在小说精品屋的基础上,重新进行了数据库设计、代码重构和功能增强,提升了程序整体的可读性和性能,增加了很多商用特性。主要升级如下:
|
小说精品屋-plus重新进行了数据库设计、代码重构和功能增强,提升了程序整体的可读性和性能,增加了很多商用特性。主要升级如下:
|
||||||
|
|
||||||
- [x] 数据库重新设计,结构调整。
|
- [x] 数据库重新设计,结构调整。
|
||||||
- [x] 服务端代码重构,MyBatis3升级为MyBatis3DynamicSql。
|
- [x] 服务端代码重构,MyBatis3升级为MyBatis3DynamicSql。
|
||||||
@ -20,9 +33,10 @@
|
|||||||
- [x] 排行榜。
|
- [x] 排行榜。
|
||||||
- [x] 小说评论模块。
|
- [x] 小说评论模块。
|
||||||
- [x] 阅读主题模块。
|
- [x] 阅读主题模块。
|
||||||
- [ ] 作家专区。
|
- [x] 作家专区。
|
||||||
- [ ] 充值。
|
- [x] 充值。
|
||||||
- [ ] 后台管理系统。
|
- [x] 订阅。
|
||||||
|
- [x] 后台管理系统。
|
||||||
- [x] 爬虫管理系统。
|
- [x] 爬虫管理系统。
|
||||||
|
|
||||||
#### 项目结构
|
#### 项目结构
|
||||||
@ -36,53 +50,119 @@ novel-plus -- 父工程
|
|||||||
```
|
```
|
||||||
|
|
||||||
#### 技术选型
|
#### 技术选型
|
||||||
Springboot+Mybatis+Mysql+Ehcache+Thymeleaf+Layui
|
|
||||||
|
| 技术 | 说明
|
||||||
|
| -------------------- | ---------------------------
|
||||||
|
| SpringBoot | Spring应用快速开发脚手架
|
||||||
|
| MyBatis | 持久层ORM框架
|
||||||
|
| MyBatis Dynamic SQL | Mybatis动态sql
|
||||||
|
| PageHelper | MyBatis分页插件
|
||||||
|
| MyBatisGenerator | 持久层代码生成插件
|
||||||
|
| Sharding-Jdbc | 代码层分库分表中间件
|
||||||
|
| JJWT | JWT登录支持
|
||||||
|
| SpringSecurity | 安全框架
|
||||||
|
| Shiro | 安全框架
|
||||||
|
| Ehcache | Java进程内缓存框架(默认缓存)
|
||||||
|
| Redis | 分布式缓存(缓存替换方案,默认关闭,一行配置开启)
|
||||||
|
| ElasticSearch | 搜索引擎(搜索增强方案,默认关闭,一行配置开启)
|
||||||
|
| RabbitMq | 消息队列(流量削峰,默认关闭,一行配置开启)
|
||||||
|
| OSS | 阿里云对象存储服务(图片存储方式之一,一行配置即可切换)
|
||||||
|
| FastDfs |开源轻量级分布式文件系统(图片存储方式之一,一行配置即可切换)
|
||||||
|
| Redisson | 实现分布式锁
|
||||||
|
| Lombok | 简化对象封装工具
|
||||||
|
| Docker | 应用容器引擎
|
||||||
|
| Mysql | 数据库服务
|
||||||
|
| Thymeleaf | 模板引擎
|
||||||
|
| Layui | 前端UI
|
||||||
|
|
||||||
|
|
||||||
#### PC站截图
|
#### PC站截图
|
||||||
|
|
||||||
|
1. 首页
|
||||||
|
|
||||||
|

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

|
2. 分类索引页
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. 搜索页
|
||||||
|
|
||||||

|

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

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

|

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

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

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

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

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

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

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

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

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

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

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

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

|
<img src="https://s3.ax1x.com/2020/12/04/DbsSoj.jpg" alt="index" style="zoom:33%;" />
|
||||||
|
|
||||||
|
2. 小说列表页
|
||||||
|
|
||||||
2. 小说详情页
|
<img src="https://s3.ax1x.com/2020/12/04/DbrfsO.jpg" alt="微信图片_20190904181558" style="zoom: 33%;" />
|
||||||
|
|
||||||

|
3. 小说详情页
|
||||||
|
|
||||||
|
<img src="https://s3.ax1x.com/2020/12/04/DbsklV.jpg" alt="QQ图片20191018161901" style="zoom:33%;" />
|
||||||
|
|
||||||
3. 目录页
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
4. 小说阅读页
|
4. 小说阅读页
|
||||||
|
|
||||||

|
<img src="https://s3.ax1x.com/2020/12/04/Dbsew4.jpg" alt="QQ图片20191018161901" style="zoom:33%;" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 爬虫管理系统截图
|
#### 爬虫管理系统截图
|
||||||
|
|
||||||

|

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

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

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

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

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

|
||||||
|
|
||||||
#### 安装步骤
|
#### 安装步骤
|
||||||
|
|
||||||
@ -107,9 +187,13 @@ Springboot+Mybatis+Mysql+Ehcache+Thymeleaf+Layui
|
|||||||
|
|
||||||
**喜欢此项目的可以给我的GitHub和Gitee加个Star支持一下 。**
|
**喜欢此项目的可以给我的GitHub和Gitee加个Star支持一下 。**
|
||||||
|
|
||||||
#### 演示地址
|
#### 其他安装教程
|
||||||
|
|
||||||
[点击前往](http://www.java2nb.com)(前台门户)
|
包安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4272630)
|
||||||
|
|
||||||
|
宝塔安装教程(非官方):[点击前往](https://www.daniao.org/9166.html)
|
||||||
|
|
||||||
|
docker安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4271989)
|
||||||
|
|
||||||
#### 代码仓库
|
#### 代码仓库
|
||||||
|
|
||||||
@ -119,16 +203,29 @@ Springboot+Mybatis+Mysql+Ehcache+Thymeleaf+Layui
|
|||||||
|
|
||||||
#### QQ交流群
|
#### QQ交流群
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### 捐赠支持
|
#### 微信公众号(发布最新更新资讯)
|
||||||
|
|
||||||
开源项目不易,若此项目能得到你的青睐,可以捐赠支持作者持续开发与维护。
|

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

|
#### 赞赏支持
|
||||||
|
|
||||||
|
开源项目不易,若此项目能得到你的青睐,那么你可以赞赏支持作者持续开发与维护。
|
||||||
|
|
||||||
|
- 服务器的费用也是一笔开销
|
||||||
|
- 为用户提供更好的开发环境
|
||||||
|
- 一杯咖啡
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 免责声明
|
||||||
|
|
||||||
|
本项目提供的爬虫工具仅用于采集项目初期的测试数据,请勿用于商业盈利。
|
||||||
|
用户使用本系统从事任何违法违规的事情,一切后果由用户自行承担,作者不承担任何责任。
|
||||||
|
|
||||||
#### 备注
|
#### 备注
|
||||||
|
|
||||||
精品小说屋所有相关项目均已在开源中国公开,感兴趣的可进入[开源中国](https://www.oschina.net/p/fiction_house)按关键字`精品小说屋`搜索。
|
精品小说屋所有相关项目均已在开源中国公开,感兴趣的可进入[开源中国](https://www.oschina.net/p/fiction_house)按关键字`精品小说屋`搜索。
|
||||||
|
|
||||||
[](https://www.aliyun.com/minisite/goods?userCode=uf4nasee )
|
[](https://www.aliyun.com/minisite/goods?userCode=uf4nasee )
|
||||||
|
BIN
assets/QQ20200520-215756.png
Normal file
BIN
assets/QQ20200520-215756.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 105 KiB |
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 62 KiB |
Binary file not shown.
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 185 KiB |
82
es/index_create.txt
Normal file
82
es/index_create.txt
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
PUT /novel
|
||||||
|
{
|
||||||
|
"mappings" : {
|
||||||
|
"book" : {
|
||||||
|
"properties" : {
|
||||||
|
"id" : {
|
||||||
|
"type" : "long"
|
||||||
|
},
|
||||||
|
"authorId" : {
|
||||||
|
"type" : "long"
|
||||||
|
},
|
||||||
|
"authorName" : {
|
||||||
|
"type" : "text",
|
||||||
|
"analyzer": "ik_smart",
|
||||||
|
"boost": 1.9
|
||||||
|
},
|
||||||
|
|
||||||
|
"bookName" : {
|
||||||
|
"type" : "text",
|
||||||
|
"analyzer": "ik_smart",
|
||||||
|
"boost": 2
|
||||||
|
},
|
||||||
|
|
||||||
|
"bookDesc" : {
|
||||||
|
"type" : "text",
|
||||||
|
"analyzer": "ik_smart",
|
||||||
|
"boost": 0.1
|
||||||
|
},
|
||||||
|
|
||||||
|
"bookStatus" : {
|
||||||
|
"type" : "short"
|
||||||
|
},
|
||||||
|
|
||||||
|
"catId" : {
|
||||||
|
"type" : "integer"
|
||||||
|
},
|
||||||
|
|
||||||
|
"catName" : {
|
||||||
|
"type" : "text",
|
||||||
|
"analyzer": "ik_smart",
|
||||||
|
"boost": 1.0
|
||||||
|
},
|
||||||
|
|
||||||
|
"lastIndexId" : {
|
||||||
|
"type" : "long"
|
||||||
|
},
|
||||||
|
|
||||||
|
"lastIndexName" : {
|
||||||
|
"type" : "text",
|
||||||
|
"analyzer": "ik_smart",
|
||||||
|
"boost": 0.1
|
||||||
|
},
|
||||||
|
|
||||||
|
"lastIndexUpdateTime" : {
|
||||||
|
"type": "keyword"
|
||||||
|
},
|
||||||
|
|
||||||
|
"picUrl" : {
|
||||||
|
"type" : "keyword"
|
||||||
|
},
|
||||||
|
|
||||||
|
"score" : {
|
||||||
|
"type" : "float"
|
||||||
|
},
|
||||||
|
|
||||||
|
"wordCount" : {
|
||||||
|
"type" : "integer"
|
||||||
|
},
|
||||||
|
|
||||||
|
"workDirection" : {
|
||||||
|
"type" : "short"
|
||||||
|
},
|
||||||
|
|
||||||
|
"visitCount" : {
|
||||||
|
"type": "long"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
novel-admin/Dockerfile
Normal file
6
novel-admin/Dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM java:8
|
||||||
|
ADD novel-admin-1.0.0.jar /root
|
||||||
|
ENV dburl=""
|
||||||
|
ENV username=""
|
||||||
|
ENV password=""
|
||||||
|
ENTRYPOINT ["sh","-c","java -Dspring.datasource.url=${dburl} -Dspring.datasource.username=${username} -Dspring.datasource.password=${password} -jar /root/novel-admin-1.0.0.jar"]
|
@ -1,165 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="FacetManager">
|
|
||||||
<facet type="Spring" name="Spring">
|
|
||||||
<configuration />
|
|
||||||
</facet>
|
|
||||||
</component>
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/target/classes" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.10.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.9.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.15.0" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.7.11" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.7.11" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.5.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.13" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.5" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.5" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.5" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.5" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.5" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.29" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.29" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.29" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.9.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.9.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.9.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.4.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.sourceforge.nekohtml:nekohtml:1.9.22" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.11" level="project" />
|
|
||||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.google.protobuf:protobuf-java:2.6.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.4" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.1.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.1.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:2.7.8" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.0.28" level="project" />
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library name="Maven: com.alibaba:jconsole:1.8.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://C:/Program Files/Java/jdk1.8.0_181/lib/jconsole.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="module-library">
|
|
||||||
<library name="Maven: com.alibaba:tools:1.8.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://C:/Program Files/Java/jdk1.8.0_181/lib/tools.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC />
|
|
||||||
<SOURCES />
|
|
||||||
</library>
|
|
||||||
</orderEntry>
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.6" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.10" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.3.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.3" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.3.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.3.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-ehcache:1.4.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-cache:1.4.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-lang:1.4.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.github.theborakompanioni:thymeleaf-extras-shiro:2.0.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.31" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.6.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.10" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.10" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.6.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.6.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.6.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.6.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.6.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.4" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.0.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.6.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.0.1.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.0.6.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.0.6.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.0.6.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.0.5.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:5.0.3.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.1.6.RELEASE" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.23.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.23.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.23.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.23.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.23.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.23.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.9.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.5.0" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.16.20" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-text:1.4" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.10.4" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.java2nb</groupId>
|
<groupId>com.java2nb</groupId>
|
||||||
<artifactId>novel-admin</artifactId>
|
<artifactId>novel-admin</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>2.11.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>novel-admin</name>
|
<name>novel-admin</name>
|
||||||
@ -50,10 +50,10 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- NekoHTML 是一个简单地HTML扫描器和标签补偿器(tag balancer) ,使得程序能解析HTML文档并用标准的XML接口来访问其中的信息。
|
<!-- NekoHTML 是一个简单地HTML扫描器和标签补偿器(tag balancer) ,使得程序能解析HTML文档并用标准的XML接口来访问其中的信息。
|
||||||
这个解析器能投扫描HTML文件并“修正”许多作者(人或机器)在编写HTML文档过程中常犯的错误。
|
这个解析器能投扫描HTML文件并“修正”许多作者(人或机器)在编写HTML文档过程中常犯的错误。
|
||||||
NekoHTML 能增补缺失的父元素、自动用结束标签关闭相应的元素,以及不匹配的内嵌元素标签。
|
NekoHTML 能增补缺失的父元素、自动用结束标签关闭相应的元素,以及不匹配的内嵌元素标签。
|
||||||
NekoHTML 的开发使用了Xerces Native Interface (XNI),后者是Xerces2的实现基础。-->
|
NekoHTML 的开发使用了Xerces Native Interface (XNI),后者是Xerces2的实现基础。-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sourceforge.nekohtml</groupId>
|
<groupId>net.sourceforge.nekohtml</groupId>
|
||||||
<artifactId>nekohtml</artifactId>
|
<artifactId>nekohtml</artifactId>
|
||||||
@ -137,23 +137,19 @@
|
|||||||
<artifactId>velocity</artifactId>
|
<artifactId>velocity</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-cache</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!--<dependency>-->
|
<!--<dependency>-->
|
||||||
<!--<groupId>org.springframework.boot</groupId>-->
|
<!--<groupId>org.springframework.boot</groupId>-->
|
||||||
<!--<artifactId>spring-boot-starter-data-redis</artifactId>-->
|
<!--<artifactId>spring-boot-starter-data-redis</artifactId>-->
|
||||||
<!--</dependency>-->
|
<!--</dependency>-->
|
||||||
<!-- quartz -->
|
<!-- quartz -->
|
||||||
<!--<dependency>-->
|
<!--<dependency>-->
|
||||||
<!--<groupId>org.springframework.boot</groupId>-->
|
<!--<groupId>org.springframework.boot</groupId>-->
|
||||||
<!--<artifactId>spring-boot-starter-cache</artifactId>-->
|
<!--<artifactId>spring-boot-starter-cache</artifactId>-->
|
||||||
<!--</dependency>-->
|
<!--</dependency>-->
|
||||||
|
|
||||||
<!--<dependency>-->
|
<!--<dependency>-->
|
||||||
<!--<groupId>net.sf.ehcache</groupId>-->
|
<!--<groupId>net.sf.ehcache</groupId>-->
|
||||||
<!--<artifactId>ehcache</artifactId>-->
|
<!--<artifactId>ehcache</artifactId>-->
|
||||||
<!--</dependency>-->
|
<!--</dependency>-->
|
||||||
|
|
||||||
|
|
||||||
@ -188,7 +184,6 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
@ -239,18 +234,22 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</plugin>-->
|
</plugin>-->
|
||||||
<!--SpringBoot项目默认使用spring-boot-maven-plugin,要打成被其他项目引用的jar包,需要更换此插件-->
|
<!--SpringBoot项目默认使用spring-boot-maven-plugin,要打成被其他项目引用的jar包,需要更换此插件-->
|
||||||
|
<!-- <plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
</configuration>
|
||||||
|
</plugin>-->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
<encoding>UTF-8</encoding>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<distributionManagement>
|
<!--<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>nexus_release</id>
|
<id>nexus_release</id>
|
||||||
<name>release</name>
|
<name>release</name>
|
||||||
@ -261,5 +260,5 @@
|
|||||||
<name>snapshots</name>
|
<name>snapshots</name>
|
||||||
<url>http://47.106.243.172:8081/nexus/content/repositories/snapshots/</url>
|
<url>http://47.106.243.172:8081/nexus/content/repositories/snapshots/</url>
|
||||||
</snapshotRepository>
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>-->
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
package com.java2nb.common.utils;
|
package com.java2nb.common.utils;
|
||||||
|
|
||||||
|
import lombok.SneakyThrows;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期处理
|
* 日期处理
|
||||||
@ -91,4 +95,37 @@ public class DateUtils {
|
|||||||
r += "前";
|
r += "前";
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取过去第几天的日期
|
||||||
|
*
|
||||||
|
* @param past
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@SneakyThrows
|
||||||
|
public static String getPastDate(int past,Date date) {
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - past);
|
||||||
|
Date today = calendar.getTime();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
return sdf.format(today);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取过去几天的日期集合
|
||||||
|
*
|
||||||
|
* @param past
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<String> getDateList(int past,Date date) {
|
||||||
|
List<String> result = new ArrayList<>(past);
|
||||||
|
for(int i = past - 1 ; i > 0 ; i--){
|
||||||
|
result.add(getPastDate(i,date));
|
||||||
|
}
|
||||||
|
//今天的日期
|
||||||
|
result.add(new SimpleDateFormat("yyyy-MM-dd").format(date));
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe
|
|||||||
/**
|
/**
|
||||||
* 假如有有html 代码是自己传来的 需要设定对应的name 不过滤
|
* 假如有有html 代码是自己传来的 需要设定对应的name 不过滤
|
||||||
*/
|
*/
|
||||||
private static final List<String> noFilterNames = Arrays.asList("attach","push_ip");
|
private static final List<String> noFilterNames = Arrays.asList("attach","push_ip","content");
|
||||||
|
|
||||||
public XssAndSqlHttpServletRequestWrapper(HttpServletRequest request) {
|
public XssAndSqlHttpServletRequestWrapper(HttpServletRequest request) {
|
||||||
super(request);
|
super(request);
|
||||||
|
@ -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.AuthorCodeDO;
|
||||||
|
import com.java2nb.novel.service.AuthorCodeService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作家邀请码表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-05-13 11:29:15
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/authorCode")
|
||||||
|
public class AuthorCodeController {
|
||||||
|
@Autowired
|
||||||
|
private AuthorCodeService authorCodeService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:authorCode:authorCode")
|
||||||
|
String AuthorCode() {
|
||||||
|
return "novel/authorCode/authorCode";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取作家邀请码表列表", notes = "获取作家邀请码表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:authorCode:authorCode")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<AuthorCodeDO> authorCodeList = authorCodeService.list(query);
|
||||||
|
int total = authorCodeService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(authorCodeList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增作家邀请码表页面", notes = "新增作家邀请码表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:authorCode:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/authorCode/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改作家邀请码表页面", notes = "修改作家邀请码表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:authorCode:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
AuthorCodeDO authorCode = authorCodeService.get(id);
|
||||||
|
model.addAttribute("authorCode", authorCode);
|
||||||
|
return "novel/authorCode/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看作家邀请码表页面", notes = "查看作家邀请码表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:authorCode:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
AuthorCodeDO authorCode = authorCodeService.get(id);
|
||||||
|
model.addAttribute("authorCode", authorCode);
|
||||||
|
return "novel/authorCode/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增作家邀请码表", notes = "新增作家邀请码表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:authorCode:add")
|
||||||
|
public R save( AuthorCodeDO authorCode) {
|
||||||
|
if (authorCodeService.save(authorCode) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改作家邀请码表", notes = "修改作家邀请码表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:authorCode:edit")
|
||||||
|
public R update( AuthorCodeDO authorCode) {
|
||||||
|
authorCodeService.update(authorCode);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除作家邀请码表", notes = "删除作家邀请码表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:authorCode:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (authorCodeService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除作家邀请码表", notes = "批量删除作家邀请码表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:authorCode:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
authorCodeService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.AuthorDO;
|
||||||
|
import com.java2nb.novel.service.AuthorService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-05-13 11:16:51
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/author")
|
||||||
|
public class AuthorController {
|
||||||
|
@Autowired
|
||||||
|
private AuthorService authorService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:author:author")
|
||||||
|
String Author() {
|
||||||
|
return "novel/author/author";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取作者表列表", notes = "获取作者表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:author:author")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<AuthorDO> authorList = authorService.list(query);
|
||||||
|
int total = authorService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(authorList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增作者表页面", notes = "新增作者表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:author:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/author/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改作者表页面", notes = "修改作者表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:author:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
AuthorDO author = authorService.get(id);
|
||||||
|
model.addAttribute("author", author);
|
||||||
|
return "novel/author/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看作者表页面", notes = "查看作者表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:author:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
AuthorDO author = authorService.get(id);
|
||||||
|
model.addAttribute("author", author);
|
||||||
|
return "novel/author/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增作者表", notes = "新增作者表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:author:add")
|
||||||
|
public R save( AuthorDO author) {
|
||||||
|
if (authorService.save(author) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改作者表", notes = "修改作者表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:author:edit")
|
||||||
|
public R update( AuthorDO author) {
|
||||||
|
authorService.update(author);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除作者表", notes = "删除作者表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:author:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (authorService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除作者表", notes = "批量删除作者表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:author:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
authorService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
import com.java2nb.novel.service.BookService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:46
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/book")
|
||||||
|
public class BookController {
|
||||||
|
@Autowired
|
||||||
|
private BookService bookService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:book:book")
|
||||||
|
String Book() {
|
||||||
|
return "novel/book/book";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取小说表列表", notes = "获取小说表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:book:book")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<BookDO> bookList = bookService.list(query);
|
||||||
|
int total = bookService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(bookList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增小说表页面", notes = "新增小说表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:book:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/book/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改小说表页面", notes = "修改小说表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:book:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookDO book = bookService.get(id);
|
||||||
|
model.addAttribute("book", book);
|
||||||
|
return "novel/book/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看小说表页面", notes = "查看小说表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:book:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
BookDO book = bookService.get(id);
|
||||||
|
model.addAttribute("book", book);
|
||||||
|
return "novel/book/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增小说表", notes = "新增小说表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:book:add")
|
||||||
|
public R save( BookDO book) {
|
||||||
|
if (bookService.save(book) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改小说表", notes = "修改小说表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:book:edit")
|
||||||
|
public R update( BookDO book) {
|
||||||
|
bookService.update(book);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除小说表", notes = "删除小说表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:book:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (bookService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除小说表", notes = "批量删除小说表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:book:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
bookService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
import com.java2nb.novel.service.CategoryService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/category")
|
||||||
|
public class CategoryController {
|
||||||
|
@Autowired
|
||||||
|
private CategoryService categoryService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:category:category")
|
||||||
|
String Category() {
|
||||||
|
return "novel/category/category";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取新闻类别表列表", notes = "获取新闻类别表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:category:category")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<CategoryDO> categoryList = categoryService.list(query);
|
||||||
|
int total = categoryService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(categoryList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增新闻类别表页面", notes = "新增新闻类别表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:category:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/category/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改新闻类别表页面", notes = "修改新闻类别表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:category:edit")
|
||||||
|
String edit(@PathVariable("id") Integer id, Model model) {
|
||||||
|
CategoryDO category = categoryService.get(id);
|
||||||
|
model.addAttribute("category", category);
|
||||||
|
return "novel/category/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看新闻类别表页面", notes = "查看新闻类别表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:category:detail")
|
||||||
|
String detail(@PathVariable("id") Integer id, Model model) {
|
||||||
|
CategoryDO category = categoryService.get(id);
|
||||||
|
model.addAttribute("category", category);
|
||||||
|
return "novel/category/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增新闻类别表", notes = "新增新闻类别表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:category:add")
|
||||||
|
public R save( CategoryDO category) {
|
||||||
|
if (categoryService.save(category) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改新闻类别表", notes = "修改新闻类别表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:category:edit")
|
||||||
|
public R update( CategoryDO category) {
|
||||||
|
categoryService.update(category);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除新闻类别表", notes = "删除新闻类别表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:category:remove")
|
||||||
|
public R remove( Integer id) {
|
||||||
|
if (categoryService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除新闻类别表", notes = "批量删除新闻类别表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:category:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Integer[] ids) {
|
||||||
|
categoryService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
import com.java2nb.novel.service.NewsService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/news")
|
||||||
|
public class NewsController {
|
||||||
|
@Autowired
|
||||||
|
private NewsService newsService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:news:news")
|
||||||
|
String News() {
|
||||||
|
return "novel/news/news";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取新闻表列表", notes = "获取新闻表列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:news:news")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<NewsDO> newsList = newsService.list(query);
|
||||||
|
int total = newsService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(newsList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增新闻表页面", notes = "新增新闻表页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:news:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/news/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改新闻表页面", notes = "修改新闻表页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:news:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
NewsDO news = newsService.get(id);
|
||||||
|
model.addAttribute("news", news);
|
||||||
|
return "novel/news/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看新闻表页面", notes = "查看新闻表页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:news:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
NewsDO news = newsService.get(id);
|
||||||
|
model.addAttribute("news", news);
|
||||||
|
return "novel/news/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增新闻表", notes = "新增新闻表")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:news:add")
|
||||||
|
public R save( NewsDO news) {
|
||||||
|
if (newsService.save(news) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改新闻表", notes = "修改新闻表")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:news:edit")
|
||||||
|
public R update( NewsDO news) {
|
||||||
|
newsService.update(news);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除新闻表", notes = "删除新闻表")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:news:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (newsService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除新闻表", notes = "批量删除新闻表")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:news:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
newsService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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.PayDO;
|
||||||
|
import com.java2nb.novel.service.PayService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:57
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/pay")
|
||||||
|
public class PayController {
|
||||||
|
@Autowired
|
||||||
|
private PayService payService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:pay:pay")
|
||||||
|
String Pay() {
|
||||||
|
return "novel/pay/pay";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取充值订单列表", notes = "获取充值订单列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:pay:pay")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<PayDO> payList = payService.list(query);
|
||||||
|
int total = payService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(payList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增充值订单页面", notes = "新增充值订单页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:pay:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/pay/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改充值订单页面", notes = "修改充值订单页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:pay:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
PayDO pay = payService.get(id);
|
||||||
|
model.addAttribute("pay", pay);
|
||||||
|
return "novel/pay/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看充值订单页面", notes = "查看充值订单页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:pay:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
PayDO pay = payService.get(id);
|
||||||
|
model.addAttribute("pay", pay);
|
||||||
|
return "novel/pay/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增充值订单", notes = "新增充值订单")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:pay:add")
|
||||||
|
public R save( PayDO pay) {
|
||||||
|
if (payService.save(pay) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改充值订单", notes = "修改充值订单")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:pay:edit")
|
||||||
|
public R update( PayDO pay) {
|
||||||
|
payService.update(pay);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除充值订单", notes = "删除充值订单")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:pay:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (payService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除充值订单", notes = "批量删除充值订单")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:pay:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
payService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
package com.java2nb.novel.controller;
|
||||||
|
|
||||||
|
import com.java2nb.common.utils.DateUtils;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
import com.java2nb.novel.domain.AuthorCodeDO;
|
||||||
|
import com.java2nb.novel.service.*;
|
||||||
|
import com.java2nb.test.service.OrderService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
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.*;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:40:12
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/stat")
|
||||||
|
public class StatController {
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AuthorService authorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BookService bookService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PayService orderPayService;
|
||||||
|
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/countSta")
|
||||||
|
public R countUser() {
|
||||||
|
Map map = new HashMap<>(0);
|
||||||
|
int userCount = userService.count(map);
|
||||||
|
int authorCount = authorService.count(map);
|
||||||
|
int bookCount = bookService.count(map);
|
||||||
|
int orderCount = orderPayService.count(map);
|
||||||
|
return R.ok().put("userCount",userCount)
|
||||||
|
.put("authorCount",authorCount)
|
||||||
|
.put("bookCount",bookCount)
|
||||||
|
.put("orderCount",orderCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/tableSta")
|
||||||
|
@SneakyThrows
|
||||||
|
public R tableSta() {
|
||||||
|
Date currentDate = new Date();
|
||||||
|
List<String> dateList = DateUtils.getDateList(7,currentDate);
|
||||||
|
Date minDate = new SimpleDateFormat("yyyy-MM-dd").parse(dateList.get(0));
|
||||||
|
Map<Object,Object> userTableSta = userService.tableSta(minDate);
|
||||||
|
Map<Object,Object> bookTableSta = bookService.tableSta(minDate);
|
||||||
|
Map<Object,Object> authorTableSta = authorService.tableSta(minDate);
|
||||||
|
Map<Object,Object> orderTableSta = orderPayService.tableSta(minDate);
|
||||||
|
return R.ok().put("dateList",dateList)
|
||||||
|
.put("userTableSta",userTableSta)
|
||||||
|
.put("bookTableSta",bookTableSta)
|
||||||
|
.put("authorTableSta",authorTableSta)
|
||||||
|
.put("orderTableSta",orderTableSta)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -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.UserDO;
|
||||||
|
import com.java2nb.novel.service.UserService;
|
||||||
|
import com.java2nb.common.utils.PageBean;
|
||||||
|
import com.java2nb.common.utils.Query;
|
||||||
|
import com.java2nb.common.utils.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:08
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/novel/user")
|
||||||
|
public class UserController {
|
||||||
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@RequiresPermissions("novel:user:user")
|
||||||
|
String User() {
|
||||||
|
return "novel/user/user";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取列表", notes = "获取列表")
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/list")
|
||||||
|
@RequiresPermissions("novel:user:user")
|
||||||
|
public R list(@RequestParam Map<String, Object> params) {
|
||||||
|
//查询列表数据
|
||||||
|
Query query = new Query(params);
|
||||||
|
List<UserDO> userList = userService.list(query);
|
||||||
|
int total = userService.count(query);
|
||||||
|
PageBean pageBean = new PageBean(userList, total);
|
||||||
|
return R.ok().put("data", pageBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "新增页面", notes = "新增页面")
|
||||||
|
@GetMapping("/add")
|
||||||
|
@RequiresPermissions("novel:user:add")
|
||||||
|
String add() {
|
||||||
|
return "novel/user/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改页面", notes = "修改页面")
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
@RequiresPermissions("novel:user:edit")
|
||||||
|
String edit(@PathVariable("id") Long id, Model model) {
|
||||||
|
UserDO user = userService.get(id);
|
||||||
|
model.addAttribute("user", user);
|
||||||
|
return "novel/user/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查看页面", notes = "查看页面")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
@RequiresPermissions("novel:user:detail")
|
||||||
|
String detail(@PathVariable("id") Long id, Model model) {
|
||||||
|
UserDO user = userService.get(id);
|
||||||
|
model.addAttribute("user", user);
|
||||||
|
return "novel/user/detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增", notes = "新增")
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/save")
|
||||||
|
@RequiresPermissions("novel:user:add")
|
||||||
|
public R save( UserDO user) {
|
||||||
|
if (userService.save(user) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改", notes = "修改")
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("/update")
|
||||||
|
@RequiresPermissions("novel:user:edit")
|
||||||
|
public R update( UserDO user) {
|
||||||
|
userService.update(user);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除", notes = "删除")
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:user:remove")
|
||||||
|
public R remove( Long id) {
|
||||||
|
if (userService.remove(id) > 0) {
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除", notes = "批量删除")
|
||||||
|
@PostMapping("/batchRemove")
|
||||||
|
@ResponseBody
|
||||||
|
@RequiresPermissions("novel:user:batchRemove")
|
||||||
|
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||||
|
userService.batchRemove(ids);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.AuthorCodeDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作家邀请码表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-05-13 11:29:15
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AuthorCodeDao {
|
||||||
|
|
||||||
|
AuthorCodeDO get(Long id);
|
||||||
|
|
||||||
|
List<AuthorCodeDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(AuthorCodeDO authorCode);
|
||||||
|
|
||||||
|
int update(AuthorCodeDO authorCode);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.AuthorDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-05-13 11:16:51
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AuthorDao {
|
||||||
|
|
||||||
|
AuthorDO get(Long id);
|
||||||
|
|
||||||
|
List<AuthorDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(AuthorDO author);
|
||||||
|
|
||||||
|
int update(AuthorDO author);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
List<Map<Object, Object>> tableSta(Date minDate);
|
||||||
|
}
|
35
novel-admin/src/main/java/com/java2nb/novel/dao/BookDao.java
Normal file
35
novel-admin/src/main/java/com/java2nb/novel/dao/BookDao.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:46
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BookDao {
|
||||||
|
|
||||||
|
BookDO get(Long id);
|
||||||
|
|
||||||
|
List<BookDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(BookDO book);
|
||||||
|
|
||||||
|
int update(BookDO book);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
List<Map<Object, Object>> tableSta(Date minDate);
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CategoryDao {
|
||||||
|
|
||||||
|
CategoryDO get(Integer id);
|
||||||
|
|
||||||
|
List<CategoryDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(CategoryDO category);
|
||||||
|
|
||||||
|
int update(CategoryDO category);
|
||||||
|
|
||||||
|
int remove(Integer id);
|
||||||
|
|
||||||
|
int batchRemove(Integer[] ids);
|
||||||
|
}
|
32
novel-admin/src/main/java/com/java2nb/novel/dao/NewsDao.java
Normal file
32
novel-admin/src/main/java/com/java2nb/novel/dao/NewsDao.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface NewsDao {
|
||||||
|
|
||||||
|
NewsDO get(Long id);
|
||||||
|
|
||||||
|
List<NewsDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(NewsDO news);
|
||||||
|
|
||||||
|
int update(NewsDO news);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
35
novel-admin/src/main/java/com/java2nb/novel/dao/PayDao.java
Normal file
35
novel-admin/src/main/java/com/java2nb/novel/dao/PayDao.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.PayDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:57
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface PayDao {
|
||||||
|
|
||||||
|
PayDO get(Long id);
|
||||||
|
|
||||||
|
List<PayDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(PayDO pay);
|
||||||
|
|
||||||
|
int update(PayDO pay);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
List<Map<Object, Object>> tableSta(Date minDate);
|
||||||
|
}
|
35
novel-admin/src/main/java/com/java2nb/novel/dao/UserDao.java
Normal file
35
novel-admin/src/main/java/com/java2nb/novel/dao/UserDao.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.java2nb.novel.dao;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:08
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserDao {
|
||||||
|
|
||||||
|
UserDO get(Long id);
|
||||||
|
|
||||||
|
List<UserDO> list(Map<String,Object> map);
|
||||||
|
|
||||||
|
int count(Map<String,Object> map);
|
||||||
|
|
||||||
|
int save(UserDO user);
|
||||||
|
|
||||||
|
int update(UserDO user);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
List<Map<Object, Object>> tableSta(Date minDate);
|
||||||
|
}
|
@ -0,0 +1,121 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作家邀请码表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-05-13 11:29:15
|
||||||
|
*/
|
||||||
|
public class AuthorCodeDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//邀请码
|
||||||
|
private String inviteCode;
|
||||||
|
//有效时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date validityTime;
|
||||||
|
//是否使用过,0:未使用,1:使用过
|
||||||
|
private Integer isUse;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//创建人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:邀请码
|
||||||
|
*/
|
||||||
|
public void setInviteCode(String inviteCode) {
|
||||||
|
this.inviteCode = inviteCode;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:邀请码
|
||||||
|
*/
|
||||||
|
public String getInviteCode() {
|
||||||
|
return inviteCode;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:有效时间
|
||||||
|
*/
|
||||||
|
public void setValidityTime(Date validityTime) {
|
||||||
|
this.validityTime = validityTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:有效时间
|
||||||
|
*/
|
||||||
|
public Date getValidityTime() {
|
||||||
|
return validityTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:是否使用过,0:未使用,1:使用过
|
||||||
|
*/
|
||||||
|
public void setIsUse(Integer isUse) {
|
||||||
|
this.isUse = isUse;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:是否使用过,0:未使用,1:使用过
|
||||||
|
*/
|
||||||
|
public Integer getIsUse() {
|
||||||
|
return isUse;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
176
novel-admin/src/main/java/com/java2nb/novel/domain/AuthorDO.java
Normal file
176
novel-admin/src/main/java/com/java2nb/novel/domain/AuthorDO.java
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-05-13 11:16:51
|
||||||
|
*/
|
||||||
|
public class AuthorDO 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 userId;
|
||||||
|
//邀请码
|
||||||
|
private String inviteCode;
|
||||||
|
//笔名
|
||||||
|
private String penName;
|
||||||
|
//手机号码
|
||||||
|
private String telPhone;
|
||||||
|
//QQ或微信账号
|
||||||
|
private String chatAccount;
|
||||||
|
//电子邮箱
|
||||||
|
private String email;
|
||||||
|
//作品方向,0:男频,1:女频
|
||||||
|
private Integer workDirection;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//0:正常,1:封禁
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:用户ID
|
||||||
|
*/
|
||||||
|
public void setUserId(Long userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:用户ID
|
||||||
|
*/
|
||||||
|
public Long getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:邀请码
|
||||||
|
*/
|
||||||
|
public void setInviteCode(String inviteCode) {
|
||||||
|
this.inviteCode = inviteCode;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:邀请码
|
||||||
|
*/
|
||||||
|
public String getInviteCode() {
|
||||||
|
return inviteCode;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:笔名
|
||||||
|
*/
|
||||||
|
public void setPenName(String penName) {
|
||||||
|
this.penName = penName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:笔名
|
||||||
|
*/
|
||||||
|
public String getPenName() {
|
||||||
|
return penName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:手机号码
|
||||||
|
*/
|
||||||
|
public void setTelPhone(String telPhone) {
|
||||||
|
this.telPhone = telPhone;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:手机号码
|
||||||
|
*/
|
||||||
|
public String getTelPhone() {
|
||||||
|
return telPhone;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:QQ或微信账号
|
||||||
|
*/
|
||||||
|
public void setChatAccount(String chatAccount) {
|
||||||
|
this.chatAccount = chatAccount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:QQ或微信账号
|
||||||
|
*/
|
||||||
|
public String getChatAccount() {
|
||||||
|
return chatAccount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:电子邮箱
|
||||||
|
*/
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:电子邮箱
|
||||||
|
*/
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:作品方向,0:男频,1:女频
|
||||||
|
*/
|
||||||
|
public void setWorkDirection(Integer workDirection) {
|
||||||
|
this.workDirection = workDirection;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:作品方向,0:男频,1:女频
|
||||||
|
*/
|
||||||
|
public Integer getWorkDirection() {
|
||||||
|
return workDirection;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:0:正常,1:封禁
|
||||||
|
*/
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:0:正常,1:封禁
|
||||||
|
*/
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
493
novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java
Normal file
493
novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java
Normal file
@ -0,0 +1,493 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:46
|
||||||
|
*/
|
||||||
|
public class BookDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//作品方向,0:男频,1:女频'
|
||||||
|
private Integer workDirection;
|
||||||
|
//分类ID
|
||||||
|
private Integer catId;
|
||||||
|
//分类名
|
||||||
|
private String catName;
|
||||||
|
//子分类ID
|
||||||
|
private Integer catChildId;
|
||||||
|
//子分类名
|
||||||
|
private String catChildName;
|
||||||
|
//小说封面
|
||||||
|
private String picUrl;
|
||||||
|
//小说名
|
||||||
|
private String bookName;
|
||||||
|
//男主角姓名
|
||||||
|
private String heroName;
|
||||||
|
//女主角姓名
|
||||||
|
private String ladyName;
|
||||||
|
//作品风格,0:甜宠,1:虐恋,2:其他
|
||||||
|
private Integer bookStyle;
|
||||||
|
//作品标签
|
||||||
|
private String bookLabel;
|
||||||
|
//作者id
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long authorId;
|
||||||
|
//作者名
|
||||||
|
private String authorName;
|
||||||
|
//书籍描述
|
||||||
|
private String bookDesc;
|
||||||
|
//评分,预留字段
|
||||||
|
private Float score;
|
||||||
|
//书籍状态,0:连载中,1:已完结
|
||||||
|
private Integer bookStatus;
|
||||||
|
//点击量
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long visitCount;
|
||||||
|
//总字数
|
||||||
|
private Integer wordCount;
|
||||||
|
//评论数
|
||||||
|
private Integer commentCount;
|
||||||
|
//昨日订阅数
|
||||||
|
private Integer yesterdayBuy;
|
||||||
|
//最新目录ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long lastIndexId;
|
||||||
|
//最新目录名
|
||||||
|
private String lastIndexName;
|
||||||
|
//最新目录更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date lastIndexUpdateTime;
|
||||||
|
//是否收费,1:收费,0:免费
|
||||||
|
private Integer isVip;
|
||||||
|
//状态,0:入库,1:上架
|
||||||
|
private Integer status;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//爬虫源站ID
|
||||||
|
private Integer crawlSourceId;
|
||||||
|
//抓取的源站小说ID
|
||||||
|
private String crawlBookId;
|
||||||
|
//最后一次的抓取时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date crawlLastTime;
|
||||||
|
//是否已停止更新,0:未停止,1:已停止
|
||||||
|
private Integer crawlIsStop;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:作品方向,0:男频,1:女频'
|
||||||
|
*/
|
||||||
|
public void setWorkDirection(Integer workDirection) {
|
||||||
|
this.workDirection = workDirection;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:作品方向,0:男频,1:女频'
|
||||||
|
*/
|
||||||
|
public Integer getWorkDirection() {
|
||||||
|
return workDirection;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:分类ID
|
||||||
|
*/
|
||||||
|
public void setCatId(Integer catId) {
|
||||||
|
this.catId = catId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:分类ID
|
||||||
|
*/
|
||||||
|
public Integer getCatId() {
|
||||||
|
return catId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:分类名
|
||||||
|
*/
|
||||||
|
public void setCatName(String catName) {
|
||||||
|
this.catName = catName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:分类名
|
||||||
|
*/
|
||||||
|
public String getCatName() {
|
||||||
|
return catName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:子分类ID
|
||||||
|
*/
|
||||||
|
public void setCatChildId(Integer catChildId) {
|
||||||
|
this.catChildId = catChildId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:子分类ID
|
||||||
|
*/
|
||||||
|
public Integer getCatChildId() {
|
||||||
|
return catChildId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:子分类名
|
||||||
|
*/
|
||||||
|
public void setCatChildName(String catChildName) {
|
||||||
|
this.catChildName = catChildName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:子分类名
|
||||||
|
*/
|
||||||
|
public String getCatChildName() {
|
||||||
|
return catChildName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:小说封面
|
||||||
|
*/
|
||||||
|
public void setPicUrl(String picUrl) {
|
||||||
|
this.picUrl = picUrl;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:小说封面
|
||||||
|
*/
|
||||||
|
public String getPicUrl() {
|
||||||
|
return picUrl;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:小说名
|
||||||
|
*/
|
||||||
|
public void setBookName(String bookName) {
|
||||||
|
this.bookName = bookName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:小说名
|
||||||
|
*/
|
||||||
|
public String getBookName() {
|
||||||
|
return bookName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:男主角姓名
|
||||||
|
*/
|
||||||
|
public void setHeroName(String heroName) {
|
||||||
|
this.heroName = heroName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:男主角姓名
|
||||||
|
*/
|
||||||
|
public String getHeroName() {
|
||||||
|
return heroName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:女主角姓名
|
||||||
|
*/
|
||||||
|
public void setLadyName(String ladyName) {
|
||||||
|
this.ladyName = ladyName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:女主角姓名
|
||||||
|
*/
|
||||||
|
public String getLadyName() {
|
||||||
|
return ladyName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:作品风格,0:甜宠,1:虐恋,2:其他
|
||||||
|
*/
|
||||||
|
public void setBookStyle(Integer bookStyle) {
|
||||||
|
this.bookStyle = bookStyle;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:作品风格,0:甜宠,1:虐恋,2:其他
|
||||||
|
*/
|
||||||
|
public Integer getBookStyle() {
|
||||||
|
return bookStyle;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:作品标签
|
||||||
|
*/
|
||||||
|
public void setBookLabel(String bookLabel) {
|
||||||
|
this.bookLabel = bookLabel;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:作品标签
|
||||||
|
*/
|
||||||
|
public String getBookLabel() {
|
||||||
|
return bookLabel;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:作者id
|
||||||
|
*/
|
||||||
|
public void setAuthorId(Long authorId) {
|
||||||
|
this.authorId = authorId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:作者id
|
||||||
|
*/
|
||||||
|
public Long getAuthorId() {
|
||||||
|
return authorId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:作者名
|
||||||
|
*/
|
||||||
|
public void setAuthorName(String authorName) {
|
||||||
|
this.authorName = authorName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:作者名
|
||||||
|
*/
|
||||||
|
public String getAuthorName() {
|
||||||
|
return authorName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:书籍描述
|
||||||
|
*/
|
||||||
|
public void setBookDesc(String bookDesc) {
|
||||||
|
this.bookDesc = bookDesc;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:书籍描述
|
||||||
|
*/
|
||||||
|
public String getBookDesc() {
|
||||||
|
return bookDesc;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:评分,预留字段
|
||||||
|
*/
|
||||||
|
public void setScore(Float score) {
|
||||||
|
this.score = score;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:评分,预留字段
|
||||||
|
*/
|
||||||
|
public Float getScore() {
|
||||||
|
return score;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:书籍状态,0:连载中,1:已完结
|
||||||
|
*/
|
||||||
|
public void setBookStatus(Integer bookStatus) {
|
||||||
|
this.bookStatus = bookStatus;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:书籍状态,0:连载中,1:已完结
|
||||||
|
*/
|
||||||
|
public Integer getBookStatus() {
|
||||||
|
return bookStatus;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:点击量
|
||||||
|
*/
|
||||||
|
public void setVisitCount(Long visitCount) {
|
||||||
|
this.visitCount = visitCount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:点击量
|
||||||
|
*/
|
||||||
|
public Long getVisitCount() {
|
||||||
|
return visitCount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:总字数
|
||||||
|
*/
|
||||||
|
public void setWordCount(Integer wordCount) {
|
||||||
|
this.wordCount = wordCount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:总字数
|
||||||
|
*/
|
||||||
|
public Integer getWordCount() {
|
||||||
|
return wordCount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:评论数
|
||||||
|
*/
|
||||||
|
public void setCommentCount(Integer commentCount) {
|
||||||
|
this.commentCount = commentCount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:评论数
|
||||||
|
*/
|
||||||
|
public Integer getCommentCount() {
|
||||||
|
return commentCount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:昨日订阅数
|
||||||
|
*/
|
||||||
|
public void setYesterdayBuy(Integer yesterdayBuy) {
|
||||||
|
this.yesterdayBuy = yesterdayBuy;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:昨日订阅数
|
||||||
|
*/
|
||||||
|
public Integer getYesterdayBuy() {
|
||||||
|
return yesterdayBuy;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:最新目录ID
|
||||||
|
*/
|
||||||
|
public void setLastIndexId(Long lastIndexId) {
|
||||||
|
this.lastIndexId = lastIndexId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:最新目录ID
|
||||||
|
*/
|
||||||
|
public Long getLastIndexId() {
|
||||||
|
return lastIndexId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:最新目录名
|
||||||
|
*/
|
||||||
|
public void setLastIndexName(String lastIndexName) {
|
||||||
|
this.lastIndexName = lastIndexName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:最新目录名
|
||||||
|
*/
|
||||||
|
public String getLastIndexName() {
|
||||||
|
return lastIndexName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:最新目录更新时间
|
||||||
|
*/
|
||||||
|
public void setLastIndexUpdateTime(Date lastIndexUpdateTime) {
|
||||||
|
this.lastIndexUpdateTime = lastIndexUpdateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:最新目录更新时间
|
||||||
|
*/
|
||||||
|
public Date getLastIndexUpdateTime() {
|
||||||
|
return lastIndexUpdateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:是否收费,1:收费,0:免费
|
||||||
|
*/
|
||||||
|
public void setIsVip(Integer isVip) {
|
||||||
|
this.isVip = isVip;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:是否收费,1:收费,0:免费
|
||||||
|
*/
|
||||||
|
public Integer getIsVip() {
|
||||||
|
return isVip;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:状态,0:入库,1:上架
|
||||||
|
*/
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:状态,0:入库,1:上架
|
||||||
|
*/
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:爬虫源站ID
|
||||||
|
*/
|
||||||
|
public void setCrawlSourceId(Integer crawlSourceId) {
|
||||||
|
this.crawlSourceId = crawlSourceId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:爬虫源站ID
|
||||||
|
*/
|
||||||
|
public Integer getCrawlSourceId() {
|
||||||
|
return crawlSourceId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:抓取的源站小说ID
|
||||||
|
*/
|
||||||
|
public void setCrawlBookId(String crawlBookId) {
|
||||||
|
this.crawlBookId = crawlBookId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:抓取的源站小说ID
|
||||||
|
*/
|
||||||
|
public String getCrawlBookId() {
|
||||||
|
return crawlBookId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:最后一次的抓取时间
|
||||||
|
*/
|
||||||
|
public void setCrawlLastTime(Date crawlLastTime) {
|
||||||
|
this.crawlLastTime = crawlLastTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:最后一次的抓取时间
|
||||||
|
*/
|
||||||
|
public Date getCrawlLastTime() {
|
||||||
|
return crawlLastTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:是否已停止更新,0:未停止,1:已停止
|
||||||
|
*/
|
||||||
|
public void setCrawlIsStop(Integer crawlIsStop) {
|
||||||
|
this.crawlIsStop = crawlIsStop;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:是否已停止更新,0:未停止,1:已停止
|
||||||
|
*/
|
||||||
|
public Integer getCrawlIsStop() {
|
||||||
|
return crawlIsStop;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,135 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
public class CategoryDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
private Integer id;
|
||||||
|
//分类名
|
||||||
|
private String name;
|
||||||
|
//排序
|
||||||
|
private Integer sort;
|
||||||
|
//
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
//
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long updateUserId;
|
||||||
|
//
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:分类名
|
||||||
|
*/
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:分类名
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:排序
|
||||||
|
*/
|
||||||
|
public void setSort(Integer sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:排序
|
||||||
|
*/
|
||||||
|
public Integer getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setUpdateUserId(Long updateUserId) {
|
||||||
|
this.updateUserId = updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Long getUpdateUserId() {
|
||||||
|
return updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
}
|
180
novel-admin/src/main/java/com/java2nb/novel/domain/NewsDO.java
Normal file
180
novel-admin/src/main/java/com/java2nb/novel/domain/NewsDO.java
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
public class NewsDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//类别ID
|
||||||
|
private Integer catId;
|
||||||
|
//分类名
|
||||||
|
private String catName;
|
||||||
|
//来源
|
||||||
|
private String sourceName;
|
||||||
|
//标题
|
||||||
|
private String title;
|
||||||
|
//内容
|
||||||
|
private String content;
|
||||||
|
//发布时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//发布人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long createUserId;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
//更新人ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long updateUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:类别ID
|
||||||
|
*/
|
||||||
|
public void setCatId(Integer catId) {
|
||||||
|
this.catId = catId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:类别ID
|
||||||
|
*/
|
||||||
|
public Integer getCatId() {
|
||||||
|
return catId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:分类名
|
||||||
|
*/
|
||||||
|
public void setCatName(String catName) {
|
||||||
|
this.catName = catName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:分类名
|
||||||
|
*/
|
||||||
|
public String getCatName() {
|
||||||
|
return catName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:来源
|
||||||
|
*/
|
||||||
|
public void setSourceName(String sourceName) {
|
||||||
|
this.sourceName = sourceName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:来源
|
||||||
|
*/
|
||||||
|
public String getSourceName() {
|
||||||
|
return sourceName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:标题
|
||||||
|
*/
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:标题
|
||||||
|
*/
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:内容
|
||||||
|
*/
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:内容
|
||||||
|
*/
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:发布时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:发布时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:发布人ID
|
||||||
|
*/
|
||||||
|
public void setCreateUserId(Long createUserId) {
|
||||||
|
this.createUserId = createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:发布人ID
|
||||||
|
*/
|
||||||
|
public Long getCreateUserId() {
|
||||||
|
return createUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新人ID
|
||||||
|
*/
|
||||||
|
public void setUpdateUserId(Long updateUserId) {
|
||||||
|
this.updateUserId = updateUserId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新人ID
|
||||||
|
*/
|
||||||
|
public Long getUpdateUserId() {
|
||||||
|
return updateUserId;
|
||||||
|
}
|
||||||
|
}
|
166
novel-admin/src/main/java/com/java2nb/novel/domain/PayDO.java
Normal file
166
novel-admin/src/main/java/com/java2nb/novel/domain/PayDO.java
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:57
|
||||||
|
*/
|
||||||
|
public class PayDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//保留
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long outTradeNo;
|
||||||
|
//订单号
|
||||||
|
private String tradeNo;
|
||||||
|
//保留
|
||||||
|
private Integer payChannel;
|
||||||
|
//交易香蕉币
|
||||||
|
private Integer totalAmount;
|
||||||
|
//支付用户ID
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long userId;
|
||||||
|
//支付状态:0:支付失败,1:支付成功,2:待支付
|
||||||
|
private Integer payStatus;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:保留
|
||||||
|
*/
|
||||||
|
public void setOutTradeNo(Long outTradeNo) {
|
||||||
|
this.outTradeNo = outTradeNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:保留
|
||||||
|
*/
|
||||||
|
public Long getOutTradeNo() {
|
||||||
|
return outTradeNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:订单号
|
||||||
|
*/
|
||||||
|
public void setTradeNo(String tradeNo) {
|
||||||
|
this.tradeNo = tradeNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:订单号
|
||||||
|
*/
|
||||||
|
public String getTradeNo() {
|
||||||
|
return tradeNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:保留
|
||||||
|
*/
|
||||||
|
public void setPayChannel(Integer payChannel) {
|
||||||
|
this.payChannel = payChannel;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:保留
|
||||||
|
*/
|
||||||
|
public Integer getPayChannel() {
|
||||||
|
return payChannel;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:交易香蕉币
|
||||||
|
*/
|
||||||
|
public void setTotalAmount(Integer totalAmount) {
|
||||||
|
this.totalAmount = totalAmount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:交易香蕉币
|
||||||
|
*/
|
||||||
|
public Integer getTotalAmount() {
|
||||||
|
return totalAmount;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:支付用户ID
|
||||||
|
*/
|
||||||
|
public void setUserId(Long userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:支付用户ID
|
||||||
|
*/
|
||||||
|
public Long getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:支付状态:0:支付失败,1:支付成功,2:待支付
|
||||||
|
*/
|
||||||
|
public void setPayStatus(Integer payStatus) {
|
||||||
|
this.payStatus = payStatus;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:支付状态:0:支付失败,1:支付成功,2:待支付
|
||||||
|
*/
|
||||||
|
public Integer getPayStatus() {
|
||||||
|
return payStatus;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
}
|
177
novel-admin/src/main/java/com/java2nb/novel/domain/UserDO.java
Normal file
177
novel-admin/src/main/java/com/java2nb/novel/domain/UserDO.java
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
package com.java2nb.novel.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:08
|
||||||
|
*/
|
||||||
|
public class UserDO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
//主键
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long id;
|
||||||
|
//登录名
|
||||||
|
private String username;
|
||||||
|
//登录密码
|
||||||
|
private String password;
|
||||||
|
//昵称
|
||||||
|
private String nickName;
|
||||||
|
//用户头像
|
||||||
|
private String userPhoto;
|
||||||
|
//用户性别,0:男,1:女
|
||||||
|
private Integer userSex;
|
||||||
|
//账户余额
|
||||||
|
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||||
|
//所以通过序列化成字符串来解决
|
||||||
|
@JsonSerialize(using = LongToStringSerializer.class)
|
||||||
|
private Long accountBalance;
|
||||||
|
//用户状态,0:正常
|
||||||
|
private Integer status;
|
||||||
|
//创建时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
//更新时间
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置:主键
|
||||||
|
*/
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:主键
|
||||||
|
*/
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:登录名
|
||||||
|
*/
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:登录名
|
||||||
|
*/
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:登录密码
|
||||||
|
*/
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:登录密码
|
||||||
|
*/
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:昵称
|
||||||
|
*/
|
||||||
|
public void setNickName(String nickName) {
|
||||||
|
this.nickName = nickName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:昵称
|
||||||
|
*/
|
||||||
|
public String getNickName() {
|
||||||
|
return nickName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:用户头像
|
||||||
|
*/
|
||||||
|
public void setUserPhoto(String userPhoto) {
|
||||||
|
this.userPhoto = userPhoto;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:用户头像
|
||||||
|
*/
|
||||||
|
public String getUserPhoto() {
|
||||||
|
return userPhoto;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:用户性别,0:男,1:女
|
||||||
|
*/
|
||||||
|
public void setUserSex(Integer userSex) {
|
||||||
|
this.userSex = userSex;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:用户性别,0:男,1:女
|
||||||
|
*/
|
||||||
|
public Integer getUserSex() {
|
||||||
|
return userSex;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:账户余额
|
||||||
|
*/
|
||||||
|
public void setAccountBalance(Long accountBalance) {
|
||||||
|
this.accountBalance = accountBalance;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:账户余额
|
||||||
|
*/
|
||||||
|
public Long getAccountBalance() {
|
||||||
|
return accountBalance;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:用户状态,0:正常
|
||||||
|
*/
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:用户状态,0:正常
|
||||||
|
*/
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:创建时间
|
||||||
|
*/
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:创建时间
|
||||||
|
*/
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 设置:更新时间
|
||||||
|
*/
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取:更新时间
|
||||||
|
*/
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.AuthorCodeDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作家邀请码表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-05-13 11:29:15
|
||||||
|
*/
|
||||||
|
public interface AuthorCodeService {
|
||||||
|
|
||||||
|
AuthorCodeDO get(Long id);
|
||||||
|
|
||||||
|
List<AuthorCodeDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(AuthorCodeDO authorCode);
|
||||||
|
|
||||||
|
int update(AuthorCodeDO authorCode);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.AuthorDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作者表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-05-13 11:16:51
|
||||||
|
*/
|
||||||
|
public interface AuthorService {
|
||||||
|
|
||||||
|
AuthorDO get(Long id);
|
||||||
|
|
||||||
|
List<AuthorDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(AuthorDO author);
|
||||||
|
|
||||||
|
int update(AuthorDO author);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
Map<Object, Object> tableSta(Date minDate);
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小说表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:46
|
||||||
|
*/
|
||||||
|
public interface BookService {
|
||||||
|
|
||||||
|
BookDO get(Long id);
|
||||||
|
|
||||||
|
List<BookDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(BookDO book);
|
||||||
|
|
||||||
|
int update(BookDO book);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
Map<Object, Object> tableSta(Date minDate);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻类别表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:03:41
|
||||||
|
*/
|
||||||
|
public interface CategoryService {
|
||||||
|
|
||||||
|
CategoryDO get(Integer id);
|
||||||
|
|
||||||
|
List<CategoryDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(CategoryDO category);
|
||||||
|
|
||||||
|
int update(CategoryDO category);
|
||||||
|
|
||||||
|
int remove(Integer id);
|
||||||
|
|
||||||
|
int batchRemove(Integer[] ids);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新闻表
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 10:05:51
|
||||||
|
*/
|
||||||
|
public interface NewsService {
|
||||||
|
|
||||||
|
NewsDO get(Long id);
|
||||||
|
|
||||||
|
List<NewsDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(NewsDO news);
|
||||||
|
|
||||||
|
int update(NewsDO news);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.PayDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:57
|
||||||
|
*/
|
||||||
|
public interface PayService {
|
||||||
|
|
||||||
|
PayDO get(Long id);
|
||||||
|
|
||||||
|
List<PayDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(PayDO pay);
|
||||||
|
|
||||||
|
int update(PayDO pay);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
Map<Object, Object> tableSta(Date minDate);
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.java2nb.novel.service;
|
||||||
|
|
||||||
|
import com.java2nb.novel.domain.UserDO;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author xiongxy
|
||||||
|
* @email 1179705413@qq.com
|
||||||
|
* @date 2020-12-01 03:49:08
|
||||||
|
*/
|
||||||
|
public interface UserService {
|
||||||
|
|
||||||
|
UserDO get(Long id);
|
||||||
|
|
||||||
|
List<UserDO> list(Map<String, Object> map);
|
||||||
|
|
||||||
|
int count(Map<String, Object> map);
|
||||||
|
|
||||||
|
int save(UserDO user);
|
||||||
|
|
||||||
|
int update(UserDO user);
|
||||||
|
|
||||||
|
int remove(Long id);
|
||||||
|
|
||||||
|
int batchRemove(Long[] ids);
|
||||||
|
|
||||||
|
Map<Object, Object> tableSta(Date minDate);
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import com.java2nb.common.utils.ShiroUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.AuthorCodeDao;
|
||||||
|
import com.java2nb.novel.domain.AuthorCodeDO;
|
||||||
|
import com.java2nb.novel.service.AuthorCodeService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AuthorCodeServiceImpl implements AuthorCodeService {
|
||||||
|
@Autowired
|
||||||
|
private AuthorCodeDao authorCodeDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AuthorCodeDO get(Long id){
|
||||||
|
return authorCodeDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AuthorCodeDO> list(Map<String, Object> map){
|
||||||
|
return authorCodeDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return authorCodeDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(AuthorCodeDO authorCode){
|
||||||
|
authorCode.setIsUse(0);
|
||||||
|
authorCode.setCreateTime(new Date());
|
||||||
|
authorCode.setCreateUserId(ShiroUtils.getUserId());
|
||||||
|
return authorCodeDao.save(authorCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(AuthorCodeDO authorCode){
|
||||||
|
return authorCodeDao.update(authorCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return authorCodeDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return authorCodeDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.AuthorDao;
|
||||||
|
import com.java2nb.novel.domain.AuthorDO;
|
||||||
|
import com.java2nb.novel.service.AuthorService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AuthorServiceImpl implements AuthorService {
|
||||||
|
@Autowired
|
||||||
|
private AuthorDao authorDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AuthorDO get(Long id){
|
||||||
|
return authorDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AuthorDO> list(Map<String, Object> map){
|
||||||
|
return authorDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return authorDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(AuthorDO author){
|
||||||
|
return authorDao.save(author);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(AuthorDO author){
|
||||||
|
return authorDao.update(author);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return authorDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return authorDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Object, Object> tableSta(Date minDate) {
|
||||||
|
List<Map<Object, Object>> maps = authorDao.tableSta(minDate);
|
||||||
|
|
||||||
|
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("authorCount")));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.BookDao;
|
||||||
|
import com.java2nb.novel.domain.BookDO;
|
||||||
|
import com.java2nb.novel.service.BookService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BookServiceImpl implements BookService {
|
||||||
|
@Autowired
|
||||||
|
private BookDao bookDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BookDO get(Long id){
|
||||||
|
return bookDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BookDO> list(Map<String, Object> map){
|
||||||
|
return bookDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return bookDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(BookDO book){
|
||||||
|
return bookDao.save(book);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(BookDO book){
|
||||||
|
return bookDao.update(book);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return bookDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return bookDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Object, Object> tableSta(Date minDate) {
|
||||||
|
List<Map<Object, Object>> maps = bookDao.tableSta(minDate);
|
||||||
|
|
||||||
|
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("bookCount")));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.CategoryDao;
|
||||||
|
import com.java2nb.novel.domain.CategoryDO;
|
||||||
|
import com.java2nb.novel.service.CategoryService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CategoryServiceImpl implements CategoryService {
|
||||||
|
@Autowired
|
||||||
|
private CategoryDao categoryDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CategoryDO get(Integer id){
|
||||||
|
return categoryDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CategoryDO> list(Map<String, Object> map){
|
||||||
|
return categoryDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return categoryDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(CategoryDO category){
|
||||||
|
category.setCreateTime(new Date());
|
||||||
|
return categoryDao.save(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(CategoryDO category){
|
||||||
|
category.setUpdateTime(new Date());
|
||||||
|
return categoryDao.update(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Integer id){
|
||||||
|
return categoryDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Integer[] ids){
|
||||||
|
return categoryDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.NewsDao;
|
||||||
|
import com.java2nb.novel.domain.NewsDO;
|
||||||
|
import com.java2nb.novel.service.NewsService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class NewsServiceImpl implements NewsService {
|
||||||
|
@Autowired
|
||||||
|
private NewsDao newsDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NewsDO get(Long id){
|
||||||
|
return newsDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<NewsDO> list(Map<String, Object> map){
|
||||||
|
return newsDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return newsDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(NewsDO news){
|
||||||
|
news.setCreateTime(new Date());
|
||||||
|
return newsDao.save(news);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(NewsDO news){
|
||||||
|
news.setUpdateTime(new Date());
|
||||||
|
return newsDao.update(news);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return newsDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return newsDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.PayDao;
|
||||||
|
import com.java2nb.novel.domain.PayDO;
|
||||||
|
import com.java2nb.novel.service.PayService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PayServiceImpl implements PayService {
|
||||||
|
@Autowired
|
||||||
|
private PayDao payDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PayDO get(Long id){
|
||||||
|
return payDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PayDO> list(Map<String, Object> map){
|
||||||
|
return payDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return payDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(PayDO pay){
|
||||||
|
return payDao.save(pay);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(PayDO pay){
|
||||||
|
return payDao.update(pay);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return payDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return payDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Object, Object> tableSta(Date minDate) {
|
||||||
|
List<Map<Object, Object>> maps = payDao.tableSta(minDate);
|
||||||
|
|
||||||
|
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("orderCount")));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.java2nb.novel.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.java2nb.novel.dao.UserDao;
|
||||||
|
import com.java2nb.novel.domain.UserDO;
|
||||||
|
import com.java2nb.novel.service.UserService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UserServiceImpl implements UserService {
|
||||||
|
@Autowired
|
||||||
|
private UserDao userDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDO get(Long id){
|
||||||
|
return userDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserDO> list(Map<String, Object> map){
|
||||||
|
return userDao.list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int count(Map<String, Object> map){
|
||||||
|
return userDao.count(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int save(UserDO user){
|
||||||
|
return userDao.save(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(UserDO user){
|
||||||
|
return userDao.update(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int remove(Long id){
|
||||||
|
return userDao.remove(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchRemove(Long[] ids){
|
||||||
|
return userDao.batchRemove(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Object, Object> tableSta(Date minDate) {
|
||||||
|
|
||||||
|
List<Map<Object, Object>> maps = userDao.tableSta(minDate);
|
||||||
|
|
||||||
|
return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("userCount")));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -10,7 +10,7 @@ import com.java2nb.system.domain.DeptDO;
|
|||||||
import com.java2nb.system.domain.RoleDO;
|
import com.java2nb.system.domain.RoleDO;
|
||||||
import com.java2nb.system.domain.UserDO;
|
import com.java2nb.system.domain.UserDO;
|
||||||
import com.java2nb.system.service.RoleService;
|
import com.java2nb.system.service.RoleService;
|
||||||
import com.java2nb.system.service.UserService;
|
import com.java2nb.system.service.SysUserService;
|
||||||
import com.java2nb.system.vo.UserVO;
|
import com.java2nb.system.vo.UserVO;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@ -27,10 +27,10 @@ import java.util.Map;
|
|||||||
|
|
||||||
@RequestMapping("/sys/user")
|
@RequestMapping("/sys/user")
|
||||||
@Controller
|
@Controller
|
||||||
public class UserController extends BaseController {
|
public class SysUserController extends BaseController {
|
||||||
private String prefix="system/user" ;
|
private String prefix="system/user" ;
|
||||||
@Autowired
|
@Autowired
|
||||||
UserService userService;
|
SysUserService userService;
|
||||||
@Autowired
|
@Autowired
|
||||||
RoleService roleService;
|
RoleService roleService;
|
||||||
@Autowired
|
@Autowired
|
@ -15,7 +15,7 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
* @date 2019-10-03 09:45:11
|
* @date 2019-10-03 09:45:11
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface UserDao {
|
public interface SysUserDao {
|
||||||
|
|
||||||
UserDO get(Long userId);
|
UserDO get(Long userId);
|
||||||
|
|
@ -13,7 +13,7 @@ import com.java2nb.system.domain.UserDO;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public interface UserService {
|
public interface SysUserService {
|
||||||
UserDO get(Long id);
|
UserDO get(Long id);
|
||||||
|
|
||||||
List<UserDO> list(Map<String, Object> map);
|
List<UserDO> list(Map<String, Object> map);
|
@ -8,8 +8,6 @@ import java.util.Objects;
|
|||||||
import com.java2nb.system.dao.*;
|
import com.java2nb.system.dao.*;
|
||||||
import com.java2nb.system.domain.RoleDataPermDO;
|
import com.java2nb.system.domain.RoleDataPermDO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -30,7 +28,7 @@ public class RoleServiceImpl implements RoleService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
RoleMenuDao roleMenuMapper;
|
RoleMenuDao roleMenuMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
UserDao userMapper;
|
SysUserDao userMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
UserRoleDao userRoleMapper;
|
UserRoleDao userRoleMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -19,21 +19,21 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import com.java2nb.common.domain.Tree;
|
import com.java2nb.common.domain.Tree;
|
||||||
import com.java2nb.system.dao.DeptDao;
|
import com.java2nb.system.dao.DeptDao;
|
||||||
import com.java2nb.system.dao.UserDao;
|
import com.java2nb.system.dao.SysUserDao;
|
||||||
import com.java2nb.system.dao.UserRoleDao;
|
import com.java2nb.system.dao.UserRoleDao;
|
||||||
import com.java2nb.system.domain.DeptDO;
|
import com.java2nb.system.domain.DeptDO;
|
||||||
import com.java2nb.system.domain.UserDO;
|
import com.java2nb.system.domain.UserDO;
|
||||||
import com.java2nb.system.domain.UserRoleDO;
|
import com.java2nb.system.domain.UserRoleDO;
|
||||||
import com.java2nb.system.service.UserService;
|
import com.java2nb.system.service.SysUserService;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Service
|
@Service
|
||||||
public class UserServiceImpl implements UserService {
|
public class SysUserServiceImpl implements SysUserService {
|
||||||
@Autowired
|
@Autowired
|
||||||
UserDao userMapper;
|
SysUserDao userMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
UserRoleDao userRoleMapper;
|
UserRoleDao userRoleMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -44,7 +44,7 @@ public class UserServiceImpl implements UserService {
|
|||||||
private JnConfig jnConfig;
|
private JnConfig jnConfig;
|
||||||
@Autowired
|
@Autowired
|
||||||
DeptService deptService;
|
DeptService deptService;
|
||||||
private static final Logger logger = LoggerFactory.getLogger(UserService.class);
|
private static final Logger logger = LoggerFactory.getLogger(SysUserService.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
// @Cacheable(value = "user",key = "#id")
|
// @Cacheable(value = "user",key = "#id")
|
@ -6,7 +6,6 @@ import com.java2nb.common.config.ApplicationContextRegister;
|
|||||||
import com.java2nb.system.dao.DataPermDao;
|
import com.java2nb.system.dao.DataPermDao;
|
||||||
import com.java2nb.system.dao.DeptDao;
|
import com.java2nb.system.dao.DeptDao;
|
||||||
import com.java2nb.system.domain.DataPermDO;
|
import com.java2nb.system.domain.DataPermDO;
|
||||||
import com.java2nb.system.domain.UserToken;
|
|
||||||
import org.apache.shiro.authc.AuthenticationException;
|
import org.apache.shiro.authc.AuthenticationException;
|
||||||
import org.apache.shiro.authc.AuthenticationInfo;
|
import org.apache.shiro.authc.AuthenticationInfo;
|
||||||
import org.apache.shiro.authc.AuthenticationToken;
|
import org.apache.shiro.authc.AuthenticationToken;
|
||||||
@ -18,10 +17,9 @@ import org.apache.shiro.authz.AuthorizationInfo;
|
|||||||
import org.apache.shiro.authz.SimpleAuthorizationInfo;
|
import org.apache.shiro.authz.SimpleAuthorizationInfo;
|
||||||
import org.apache.shiro.realm.AuthorizingRealm;
|
import org.apache.shiro.realm.AuthorizingRealm;
|
||||||
import org.apache.shiro.subject.PrincipalCollection;
|
import org.apache.shiro.subject.PrincipalCollection;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
|
|
||||||
import com.java2nb.common.utils.ShiroUtils;
|
import com.java2nb.common.utils.ShiroUtils;
|
||||||
import com.java2nb.system.dao.UserDao;
|
import com.java2nb.system.dao.SysUserDao;
|
||||||
import com.java2nb.system.domain.UserDO;
|
import com.java2nb.system.domain.UserDO;
|
||||||
import com.java2nb.system.service.MenuService;
|
import com.java2nb.system.service.MenuService;
|
||||||
|
|
||||||
@ -48,7 +46,7 @@ public class UserRealm extends AuthorizingRealm {
|
|||||||
map.put("username", username);
|
map.put("username", username);
|
||||||
String password = new String((char[]) token.getCredentials());
|
String password = new String((char[]) token.getCredentials());
|
||||||
|
|
||||||
UserDao userMapper = ApplicationContextRegister.getBean(UserDao.class);
|
SysUserDao userMapper = ApplicationContextRegister.getBean(SysUserDao.class);
|
||||||
// 查询用户信息
|
// 查询用户信息
|
||||||
UserDO user = userMapper.list(map).get(0);
|
UserDO user = userMapper.list(map).get(0);
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.jdbc.Driver
|
driverClassName: com.mysql.jdbc.Driver
|
||||||
url: jdbc:mysql://128.0.0.1:3306/novel_biz?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/novel_plus?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: test123456
|
password: test123456
|
||||||
#password:
|
#password:
|
||||||
|
@ -3,7 +3,7 @@ server:
|
|||||||
# tomcat:
|
# tomcat:
|
||||||
# max-threads: 1000
|
# max-threads: 1000
|
||||||
# min-spare-threads: 30
|
# min-spare-threads: 30
|
||||||
port: 8082
|
port: 80
|
||||||
# uri-encoding: utf-8
|
# uri-encoding: utf-8
|
||||||
#security:
|
#security:
|
||||||
# basic:
|
# basic:
|
||||||
|
@ -0,0 +1,108 @@
|
|||||||
|
<?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.AuthorCodeDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.AuthorCodeDO">
|
||||||
|
select `id`,`invite_code`,`validity_time`,`is_use`,`create_time`,`create_user_id` from author_code where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.AuthorCodeDO">
|
||||||
|
select `id`,`invite_code`,`validity_time`,`is_use`,`create_time`,`create_user_id` from author_code
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="inviteCode != null and inviteCode != ''"> and invite_code = #{inviteCode} </if>
|
||||||
|
<if test="validityTime != null and validityTime != ''"> and validity_time = #{validityTime} </if>
|
||||||
|
<if test="isUse != null and isUse != ''"> and is_use = #{isUse} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by create_time desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from author_code
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="inviteCode != null and inviteCode != ''"> and invite_code = #{inviteCode} </if>
|
||||||
|
<if test="validityTime != null and validityTime != ''"> and validity_time = #{validityTime} </if>
|
||||||
|
<if test="isUse != null and isUse != ''"> and is_use = #{isUse} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.AuthorCodeDO" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into author_code
|
||||||
|
(
|
||||||
|
`invite_code`,
|
||||||
|
`validity_time`,
|
||||||
|
`is_use`,
|
||||||
|
`create_time`,
|
||||||
|
`create_user_id`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{inviteCode},
|
||||||
|
#{validityTime},
|
||||||
|
#{isUse},
|
||||||
|
#{createTime},
|
||||||
|
#{createUserId}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.AuthorCodeDO" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into author_code
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="inviteCode != null"> `invite_code`, </if>
|
||||||
|
<if test="validityTime != null"> `validity_time`, </if>
|
||||||
|
<if test="isUse != null"> `is_use`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="createUserId != null"> `create_user_id` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="inviteCode != null"> #{inviteCode}, </if>
|
||||||
|
<if test="validityTime != null"> #{validityTime}, </if>
|
||||||
|
<if test="isUse != null"> #{isUse}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="createUserId != null"> #{createUserId} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.AuthorCodeDO">
|
||||||
|
update author_code
|
||||||
|
<set>
|
||||||
|
<if test="inviteCode != null">`invite_code` = #{inviteCode}, </if>
|
||||||
|
<if test="validityTime != null">`validity_time` = #{validityTime}, </if>
|
||||||
|
<if test="isUse != null">`is_use` = #{isUse}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="createUserId != null">`create_user_id` = #{createUserId}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from author_code where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from author_code where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
150
novel-admin/src/main/resources/mybatis/novel/AuthorMapper.xml
Normal file
150
novel-admin/src/main/resources/mybatis/novel/AuthorMapper.xml
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
<?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.AuthorDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.AuthorDO">
|
||||||
|
select `id`,`user_id`,`invite_code`,`pen_name`,`tel_phone`,`chat_account`,`email`,`work_direction`,`create_time`,`status` from author where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.AuthorDO">
|
||||||
|
select `id`,`user_id`,`invite_code`,`pen_name`,`tel_phone`,`chat_account`,`email`,`work_direction`,`create_time`,`status` from author
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="userId != null and userId != ''"> and user_id = #{userId} </if>
|
||||||
|
<if test="inviteCode != null and inviteCode != ''"> and invite_code = #{inviteCode} </if>
|
||||||
|
<if test="penName != null and penName != ''"> and pen_name = #{penName} </if>
|
||||||
|
<if test="telPhone != null and telPhone != ''"> and tel_phone = #{telPhone} </if>
|
||||||
|
<if test="chatAccount != null and chatAccount != ''"> and chat_account = #{chatAccount} </if>
|
||||||
|
<if test="email != null and email != ''"> and email = #{email} </if>
|
||||||
|
<if test="workDirection != null and workDirection != ''"> and work_direction = #{workDirection} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status} </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 author
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="userId != null and userId != ''"> and user_id = #{userId} </if>
|
||||||
|
<if test="inviteCode != null and inviteCode != ''"> and invite_code = #{inviteCode} </if>
|
||||||
|
<if test="penName != null and penName != ''"> and pen_name = #{penName} </if>
|
||||||
|
<if test="telPhone != null and telPhone != ''"> and tel_phone = #{telPhone} </if>
|
||||||
|
<if test="chatAccount != null and chatAccount != ''"> and chat_account = #{chatAccount} </if>
|
||||||
|
<if test="email != null and email != ''"> and email = #{email} </if>
|
||||||
|
<if test="workDirection != null and workDirection != ''"> and work_direction = #{workDirection} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.AuthorDO" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into author
|
||||||
|
(
|
||||||
|
`user_id`,
|
||||||
|
`invite_code`,
|
||||||
|
`pen_name`,
|
||||||
|
`tel_phone`,
|
||||||
|
`chat_account`,
|
||||||
|
`email`,
|
||||||
|
`work_direction`,
|
||||||
|
`create_time`,
|
||||||
|
`status`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{userId},
|
||||||
|
#{inviteCode},
|
||||||
|
#{penName},
|
||||||
|
#{telPhone},
|
||||||
|
#{chatAccount},
|
||||||
|
#{email},
|
||||||
|
#{workDirection},
|
||||||
|
#{createTime},
|
||||||
|
#{status}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.AuthorDO" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into author
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="userId != null"> `user_id`, </if>
|
||||||
|
<if test="inviteCode != null"> `invite_code`, </if>
|
||||||
|
<if test="penName != null"> `pen_name`, </if>
|
||||||
|
<if test="telPhone != null"> `tel_phone`, </if>
|
||||||
|
<if test="chatAccount != null"> `chat_account`, </if>
|
||||||
|
<if test="email != null"> `email`, </if>
|
||||||
|
<if test="workDirection != null"> `work_direction`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="status != null"> `status` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="userId != null"> #{userId}, </if>
|
||||||
|
<if test="inviteCode != null"> #{inviteCode}, </if>
|
||||||
|
<if test="penName != null"> #{penName}, </if>
|
||||||
|
<if test="telPhone != null"> #{telPhone}, </if>
|
||||||
|
<if test="chatAccount != null"> #{chatAccount}, </if>
|
||||||
|
<if test="email != null"> #{email}, </if>
|
||||||
|
<if test="workDirection != null"> #{workDirection}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="status != null"> #{status} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.AuthorDO">
|
||||||
|
update author
|
||||||
|
<set>
|
||||||
|
<if test="userId != null">`user_id` = #{userId}, </if>
|
||||||
|
<if test="inviteCode != null">`invite_code` = #{inviteCode}, </if>
|
||||||
|
<if test="penName != null">`pen_name` = #{penName}, </if>
|
||||||
|
<if test="telPhone != null">`tel_phone` = #{telPhone}, </if>
|
||||||
|
<if test="chatAccount != null">`chat_account` = #{chatAccount}, </if>
|
||||||
|
<if test="email != null">`email` = #{email}, </if>
|
||||||
|
<if test="workDirection != null">`work_direction` = #{workDirection}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="status != null">`status` = #{status}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from author where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from author where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="tableSta" resultType="map">
|
||||||
|
SELECT
|
||||||
|
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
||||||
|
COUNT( 1 ) authorCount
|
||||||
|
FROM
|
||||||
|
AUTHOR
|
||||||
|
WHERE
|
||||||
|
create_time >= #{minDate}
|
||||||
|
GROUP BY
|
||||||
|
DATE_FORMAT( create_time, "%Y-%m-%d" )
|
||||||
|
ORDER BY
|
||||||
|
staDate
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
306
novel-admin/src/main/resources/mybatis/novel/BookMapper.xml
Normal file
306
novel-admin/src/main/resources/mybatis/novel/BookMapper.xml
Normal file
@ -0,0 +1,306 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.BookDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.BookDO">
|
||||||
|
select `id`,`work_direction`,`cat_id`,`cat_name`,`cat_child_id`,`cat_child_name`,`pic_url`,`book_name`,`hero_name`,`lady_name`,`book_style`,`book_label`,`author_id`,`author_name`,`book_desc`,`score`,`book_status`,`visit_count`,`word_count`,`comment_count`,`yesterday_buy`,`last_index_id`,`last_index_name`,`last_index_update_time`,`is_vip`,`status`,`update_time`,`create_time`,`crawl_source_id`,`crawl_book_id`,`crawl_last_time`,`crawl_is_stop` from book where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.BookDO">
|
||||||
|
select `id`,`work_direction`,`cat_id`,`cat_name`,`cat_child_id`,`cat_child_name`,`pic_url`,`book_name`,`hero_name`,`lady_name`,`book_style`,`book_label`,`author_id`,`author_name`,`book_desc`,`score`,`book_status`,`visit_count`,`word_count`,`comment_count`,`yesterday_buy`,`last_index_id`,`last_index_name`,`last_index_update_time`,`is_vip`,`status`,`update_time`,`create_time`,`crawl_source_id`,`crawl_book_id`,`crawl_last_time`,`crawl_is_stop` from book
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="workDirection != null and workDirection != ''"> and work_direction = #{workDirection} </if>
|
||||||
|
<if test="catId != null and catId != ''"> and cat_id = #{catId} </if>
|
||||||
|
<if test="catName != null and catName != ''"> and cat_name = #{catName} </if>
|
||||||
|
<if test="catChildId != null and catChildId != ''"> and cat_child_id = #{catChildId} </if>
|
||||||
|
<if test="catChildName != null and catChildName != ''"> and cat_child_name = #{catChildName} </if>
|
||||||
|
<if test="picUrl != null and picUrl != ''"> and pic_url = #{picUrl} </if>
|
||||||
|
<if test="bookName != null and bookName != ''"> and book_name = #{bookName} </if>
|
||||||
|
<if test="heroName != null and heroName != ''"> and hero_name = #{heroName} </if>
|
||||||
|
<if test="ladyName != null and ladyName != ''"> and lady_name = #{ladyName} </if>
|
||||||
|
<if test="bookStyle != null and bookStyle != ''"> and book_style = #{bookStyle} </if>
|
||||||
|
<if test="bookLabel != null and bookLabel != ''"> and book_label = #{bookLabel} </if>
|
||||||
|
<if test="authorId != null and authorId != ''"> and author_id = #{authorId} </if>
|
||||||
|
<if test="authorName != null and authorName != ''"> and author_name = #{authorName} </if>
|
||||||
|
<if test="bookDesc != null and bookDesc != ''"> and book_desc = #{bookDesc} </if>
|
||||||
|
<if test="score != null and score != ''"> and score = #{score} </if>
|
||||||
|
<if test="bookStatus != null and bookStatus != ''"> and book_status = #{bookStatus} </if>
|
||||||
|
<if test="visitCount != null and visitCount != ''"> and visit_count = #{visitCount} </if>
|
||||||
|
<if test="wordCount != null and wordCount != ''"> and word_count = #{wordCount} </if>
|
||||||
|
<if test="commentCount != null and commentCount != ''"> and comment_count = #{commentCount} </if>
|
||||||
|
<if test="yesterdayBuy != null and yesterdayBuy != ''"> and yesterday_buy = #{yesterdayBuy} </if>
|
||||||
|
<if test="lastIndexId != null and lastIndexId != ''"> and last_index_id = #{lastIndexId} </if>
|
||||||
|
<if test="lastIndexName != null and lastIndexName != ''"> and last_index_name = #{lastIndexName} </if>
|
||||||
|
<if test="lastIndexUpdateTime != null and lastIndexUpdateTime != ''"> and last_index_update_time = #{lastIndexUpdateTime} </if>
|
||||||
|
<if test="isVip != null and isVip != ''"> and is_vip = #{isVip} </if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="crawlSourceId != null and crawlSourceId != ''"> and crawl_source_id = #{crawlSourceId} </if>
|
||||||
|
<if test="crawlBookId != null and crawlBookId != ''"> and crawl_book_id = #{crawlBookId} </if>
|
||||||
|
<if test="crawlLastTime != null and crawlLastTime != ''"> and crawl_last_time = #{crawlLastTime} </if>
|
||||||
|
<if test="crawlIsStop != null and crawlIsStop != ''"> and crawl_is_stop = #{crawlIsStop} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from book
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="workDirection != null and workDirection != ''"> and work_direction = #{workDirection} </if>
|
||||||
|
<if test="catId != null and catId != ''"> and cat_id = #{catId} </if>
|
||||||
|
<if test="catName != null and catName != ''"> and cat_name = #{catName} </if>
|
||||||
|
<if test="catChildId != null and catChildId != ''"> and cat_child_id = #{catChildId} </if>
|
||||||
|
<if test="catChildName != null and catChildName != ''"> and cat_child_name = #{catChildName} </if>
|
||||||
|
<if test="picUrl != null and picUrl != ''"> and pic_url = #{picUrl} </if>
|
||||||
|
<if test="bookName != null and bookName != ''"> and book_name = #{bookName} </if>
|
||||||
|
<if test="heroName != null and heroName != ''"> and hero_name = #{heroName} </if>
|
||||||
|
<if test="ladyName != null and ladyName != ''"> and lady_name = #{ladyName} </if>
|
||||||
|
<if test="bookStyle != null and bookStyle != ''"> and book_style = #{bookStyle} </if>
|
||||||
|
<if test="bookLabel != null and bookLabel != ''"> and book_label = #{bookLabel} </if>
|
||||||
|
<if test="authorId != null and authorId != ''"> and author_id = #{authorId} </if>
|
||||||
|
<if test="authorName != null and authorName != ''"> and author_name = #{authorName} </if>
|
||||||
|
<if test="bookDesc != null and bookDesc != ''"> and book_desc = #{bookDesc} </if>
|
||||||
|
<if test="score != null and score != ''"> and score = #{score} </if>
|
||||||
|
<if test="bookStatus != null and bookStatus != ''"> and book_status = #{bookStatus} </if>
|
||||||
|
<if test="visitCount != null and visitCount != ''"> and visit_count = #{visitCount} </if>
|
||||||
|
<if test="wordCount != null and wordCount != ''"> and word_count = #{wordCount} </if>
|
||||||
|
<if test="commentCount != null and commentCount != ''"> and comment_count = #{commentCount} </if>
|
||||||
|
<if test="yesterdayBuy != null and yesterdayBuy != ''"> and yesterday_buy = #{yesterdayBuy} </if>
|
||||||
|
<if test="lastIndexId != null and lastIndexId != ''"> and last_index_id = #{lastIndexId} </if>
|
||||||
|
<if test="lastIndexName != null and lastIndexName != ''"> and last_index_name = #{lastIndexName} </if>
|
||||||
|
<if test="lastIndexUpdateTime != null and lastIndexUpdateTime != ''"> and last_index_update_time = #{lastIndexUpdateTime} </if>
|
||||||
|
<if test="isVip != null and isVip != ''"> and is_vip = #{isVip} </if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="crawlSourceId != null and crawlSourceId != ''"> and crawl_source_id = #{crawlSourceId} </if>
|
||||||
|
<if test="crawlBookId != null and crawlBookId != ''"> and crawl_book_id = #{crawlBookId} </if>
|
||||||
|
<if test="crawlLastTime != null and crawlLastTime != ''"> and crawl_last_time = #{crawlLastTime} </if>
|
||||||
|
<if test="crawlIsStop != null and crawlIsStop != ''"> and crawl_is_stop = #{crawlIsStop} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.BookDO">
|
||||||
|
insert into book
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`work_direction`,
|
||||||
|
`cat_id`,
|
||||||
|
`cat_name`,
|
||||||
|
`cat_child_id`,
|
||||||
|
`cat_child_name`,
|
||||||
|
`pic_url`,
|
||||||
|
`book_name`,
|
||||||
|
`hero_name`,
|
||||||
|
`lady_name`,
|
||||||
|
`book_style`,
|
||||||
|
`book_label`,
|
||||||
|
`author_id`,
|
||||||
|
`author_name`,
|
||||||
|
`book_desc`,
|
||||||
|
`score`,
|
||||||
|
`book_status`,
|
||||||
|
`visit_count`,
|
||||||
|
`word_count`,
|
||||||
|
`comment_count`,
|
||||||
|
`yesterday_buy`,
|
||||||
|
`last_index_id`,
|
||||||
|
`last_index_name`,
|
||||||
|
`last_index_update_time`,
|
||||||
|
`is_vip`,
|
||||||
|
`status`,
|
||||||
|
`update_time`,
|
||||||
|
`create_time`,
|
||||||
|
`crawl_source_id`,
|
||||||
|
`crawl_book_id`,
|
||||||
|
`crawl_last_time`,
|
||||||
|
`crawl_is_stop`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{workDirection},
|
||||||
|
#{catId},
|
||||||
|
#{catName},
|
||||||
|
#{catChildId},
|
||||||
|
#{catChildName},
|
||||||
|
#{picUrl},
|
||||||
|
#{bookName},
|
||||||
|
#{heroName},
|
||||||
|
#{ladyName},
|
||||||
|
#{bookStyle},
|
||||||
|
#{bookLabel},
|
||||||
|
#{authorId},
|
||||||
|
#{authorName},
|
||||||
|
#{bookDesc},
|
||||||
|
#{score},
|
||||||
|
#{bookStatus},
|
||||||
|
#{visitCount},
|
||||||
|
#{wordCount},
|
||||||
|
#{commentCount},
|
||||||
|
#{yesterdayBuy},
|
||||||
|
#{lastIndexId},
|
||||||
|
#{lastIndexName},
|
||||||
|
#{lastIndexUpdateTime},
|
||||||
|
#{isVip},
|
||||||
|
#{status},
|
||||||
|
#{updateTime},
|
||||||
|
#{createTime},
|
||||||
|
#{crawlSourceId},
|
||||||
|
#{crawlBookId},
|
||||||
|
#{crawlLastTime},
|
||||||
|
#{crawlIsStop}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookDO">
|
||||||
|
insert into book
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="workDirection != null"> `work_direction`, </if>
|
||||||
|
<if test="catId != null"> `cat_id`, </if>
|
||||||
|
<if test="catName != null"> `cat_name`, </if>
|
||||||
|
<if test="catChildId != null"> `cat_child_id`, </if>
|
||||||
|
<if test="catChildName != null"> `cat_child_name`, </if>
|
||||||
|
<if test="picUrl != null"> `pic_url`, </if>
|
||||||
|
<if test="bookName != null"> `book_name`, </if>
|
||||||
|
<if test="heroName != null"> `hero_name`, </if>
|
||||||
|
<if test="ladyName != null"> `lady_name`, </if>
|
||||||
|
<if test="bookStyle != null"> `book_style`, </if>
|
||||||
|
<if test="bookLabel != null"> `book_label`, </if>
|
||||||
|
<if test="authorId != null"> `author_id`, </if>
|
||||||
|
<if test="authorName != null"> `author_name`, </if>
|
||||||
|
<if test="bookDesc != null"> `book_desc`, </if>
|
||||||
|
<if test="score != null"> `score`, </if>
|
||||||
|
<if test="bookStatus != null"> `book_status`, </if>
|
||||||
|
<if test="visitCount != null"> `visit_count`, </if>
|
||||||
|
<if test="wordCount != null"> `word_count`, </if>
|
||||||
|
<if test="commentCount != null"> `comment_count`, </if>
|
||||||
|
<if test="yesterdayBuy != null"> `yesterday_buy`, </if>
|
||||||
|
<if test="lastIndexId != null"> `last_index_id`, </if>
|
||||||
|
<if test="lastIndexName != null"> `last_index_name`, </if>
|
||||||
|
<if test="lastIndexUpdateTime != null"> `last_index_update_time`, </if>
|
||||||
|
<if test="isVip != null"> `is_vip`, </if>
|
||||||
|
<if test="status != null"> `status`, </if>
|
||||||
|
<if test="updateTime != null"> `update_time`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="crawlSourceId != null"> `crawl_source_id`, </if>
|
||||||
|
<if test="crawlBookId != null"> `crawl_book_id`, </if>
|
||||||
|
<if test="crawlLastTime != null"> `crawl_last_time`, </if>
|
||||||
|
<if test="crawlIsStop != null"> `crawl_is_stop` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="workDirection != null"> #{workDirection}, </if>
|
||||||
|
<if test="catId != null"> #{catId}, </if>
|
||||||
|
<if test="catName != null"> #{catName}, </if>
|
||||||
|
<if test="catChildId != null"> #{catChildId}, </if>
|
||||||
|
<if test="catChildName != null"> #{catChildName}, </if>
|
||||||
|
<if test="picUrl != null"> #{picUrl}, </if>
|
||||||
|
<if test="bookName != null"> #{bookName}, </if>
|
||||||
|
<if test="heroName != null"> #{heroName}, </if>
|
||||||
|
<if test="ladyName != null"> #{ladyName}, </if>
|
||||||
|
<if test="bookStyle != null"> #{bookStyle}, </if>
|
||||||
|
<if test="bookLabel != null"> #{bookLabel}, </if>
|
||||||
|
<if test="authorId != null"> #{authorId}, </if>
|
||||||
|
<if test="authorName != null"> #{authorName}, </if>
|
||||||
|
<if test="bookDesc != null"> #{bookDesc}, </if>
|
||||||
|
<if test="score != null"> #{score}, </if>
|
||||||
|
<if test="bookStatus != null"> #{bookStatus}, </if>
|
||||||
|
<if test="visitCount != null"> #{visitCount}, </if>
|
||||||
|
<if test="wordCount != null"> #{wordCount}, </if>
|
||||||
|
<if test="commentCount != null"> #{commentCount}, </if>
|
||||||
|
<if test="yesterdayBuy != null"> #{yesterdayBuy}, </if>
|
||||||
|
<if test="lastIndexId != null"> #{lastIndexId}, </if>
|
||||||
|
<if test="lastIndexName != null"> #{lastIndexName}, </if>
|
||||||
|
<if test="lastIndexUpdateTime != null"> #{lastIndexUpdateTime}, </if>
|
||||||
|
<if test="isVip != null"> #{isVip}, </if>
|
||||||
|
<if test="status != null"> #{status}, </if>
|
||||||
|
<if test="updateTime != null"> #{updateTime}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="crawlSourceId != null"> #{crawlSourceId}, </if>
|
||||||
|
<if test="crawlBookId != null"> #{crawlBookId}, </if>
|
||||||
|
<if test="crawlLastTime != null"> #{crawlLastTime}, </if>
|
||||||
|
<if test="crawlIsStop != null"> #{crawlIsStop} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.BookDO">
|
||||||
|
update book
|
||||||
|
<set>
|
||||||
|
<if test="workDirection != null">`work_direction` = #{workDirection}, </if>
|
||||||
|
<if test="catId != null">`cat_id` = #{catId}, </if>
|
||||||
|
<if test="catName != null">`cat_name` = #{catName}, </if>
|
||||||
|
<if test="catChildId != null">`cat_child_id` = #{catChildId}, </if>
|
||||||
|
<if test="catChildName != null">`cat_child_name` = #{catChildName}, </if>
|
||||||
|
<if test="picUrl != null">`pic_url` = #{picUrl}, </if>
|
||||||
|
<if test="bookName != null">`book_name` = #{bookName}, </if>
|
||||||
|
<if test="heroName != null">`hero_name` = #{heroName}, </if>
|
||||||
|
<if test="ladyName != null">`lady_name` = #{ladyName}, </if>
|
||||||
|
<if test="bookStyle != null">`book_style` = #{bookStyle}, </if>
|
||||||
|
<if test="bookLabel != null">`book_label` = #{bookLabel}, </if>
|
||||||
|
<if test="authorId != null">`author_id` = #{authorId}, </if>
|
||||||
|
<if test="authorName != null">`author_name` = #{authorName}, </if>
|
||||||
|
<if test="bookDesc != null">`book_desc` = #{bookDesc}, </if>
|
||||||
|
<if test="score != null">`score` = #{score}, </if>
|
||||||
|
<if test="bookStatus != null">`book_status` = #{bookStatus}, </if>
|
||||||
|
<if test="visitCount != null">`visit_count` = #{visitCount}, </if>
|
||||||
|
<if test="wordCount != null">`word_count` = #{wordCount}, </if>
|
||||||
|
<if test="commentCount != null">`comment_count` = #{commentCount}, </if>
|
||||||
|
<if test="yesterdayBuy != null">`yesterday_buy` = #{yesterdayBuy}, </if>
|
||||||
|
<if test="lastIndexId != null">`last_index_id` = #{lastIndexId}, </if>
|
||||||
|
<if test="lastIndexName != null">`last_index_name` = #{lastIndexName}, </if>
|
||||||
|
<if test="lastIndexUpdateTime != null">`last_index_update_time` = #{lastIndexUpdateTime}, </if>
|
||||||
|
<if test="isVip != null">`is_vip` = #{isVip}, </if>
|
||||||
|
<if test="status != null">`status` = #{status}, </if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="crawlSourceId != null">`crawl_source_id` = #{crawlSourceId}, </if>
|
||||||
|
<if test="crawlBookId != null">`crawl_book_id` = #{crawlBookId}, </if>
|
||||||
|
<if test="crawlLastTime != null">`crawl_last_time` = #{crawlLastTime}, </if>
|
||||||
|
<if test="crawlIsStop != null">`crawl_is_stop` = #{crawlIsStop}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from book where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from book where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="tableSta" resultType="map">
|
||||||
|
SELECT
|
||||||
|
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
||||||
|
COUNT( 1 ) bookCount
|
||||||
|
FROM
|
||||||
|
BOOK
|
||||||
|
WHERE
|
||||||
|
create_time >= #{minDate}
|
||||||
|
GROUP BY
|
||||||
|
DATE_FORMAT( create_time, "%Y-%m-%d" )
|
||||||
|
ORDER BY
|
||||||
|
staDate
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
117
novel-admin/src/main/resources/mybatis/novel/CategoryMapper.xml
Normal file
117
novel-admin/src/main/resources/mybatis/novel/CategoryMapper.xml
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.CategoryDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.CategoryDO">
|
||||||
|
select `id`,`name`,`sort`,`create_user_id`,`create_time`,`update_user_id`,`update_time` from news_category where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.CategoryDO">
|
||||||
|
select `id`,`name`,`sort`,`create_user_id`,`create_time`,`update_user_id`,`update_time` from news_category
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||||
|
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from news_category
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="name != null and name != ''"> and name = #{name} </if>
|
||||||
|
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.CategoryDO">
|
||||||
|
insert into news_category
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`name`,
|
||||||
|
`sort`,
|
||||||
|
`create_user_id`,
|
||||||
|
`create_time`,
|
||||||
|
`update_user_id`,
|
||||||
|
`update_time`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{name},
|
||||||
|
#{sort},
|
||||||
|
#{createUserId},
|
||||||
|
#{createTime},
|
||||||
|
#{updateUserId},
|
||||||
|
#{updateTime}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.CategoryDO">
|
||||||
|
insert into news_category
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="name != null"> `name`, </if>
|
||||||
|
<if test="sort != null"> `sort`, </if>
|
||||||
|
<if test="createUserId != null"> `create_user_id`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="updateUserId != null"> `update_user_id`, </if>
|
||||||
|
<if test="updateTime != null"> `update_time` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="name != null"> #{name}, </if>
|
||||||
|
<if test="sort != null"> #{sort}, </if>
|
||||||
|
<if test="createUserId != null"> #{createUserId}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="updateUserId != null"> #{updateUserId}, </if>
|
||||||
|
<if test="updateTime != null"> #{updateTime} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.CategoryDO">
|
||||||
|
update news_category
|
||||||
|
<set>
|
||||||
|
<if test="name != null">`name` = #{name}, </if>
|
||||||
|
<if test="sort != null">`sort` = #{sort}, </if>
|
||||||
|
<if test="createUserId != null">`create_user_id` = #{createUserId}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="updateUserId != null">`update_user_id` = #{updateUserId}, </if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from news_category where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from news_category where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
138
novel-admin/src/main/resources/mybatis/novel/NewsMapper.xml
Normal file
138
novel-admin/src/main/resources/mybatis/novel/NewsMapper.xml
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.java2nb.novel.dao.NewsDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.NewsDO">
|
||||||
|
select `id`,`cat_id`,`cat_name`,`source_name`,`title`,`content`,`create_time`,`create_user_id`,`update_time`,`update_user_id` from news where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.NewsDO">
|
||||||
|
select `id`,`cat_id`,`cat_name`,`source_name`,`title`,`content`,`create_time`,`create_user_id`,`update_time`,`update_user_id` from news
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="catId != null and catId != ''"> and cat_id = #{catId} </if>
|
||||||
|
<if test="catName != null and catName != ''"> and cat_name = #{catName} </if>
|
||||||
|
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
|
||||||
|
<if test="title != null and title != ''"> and title like concat('%',#{title},'%') </if>
|
||||||
|
<if test="content != null and content != ''"> and content = #{content} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from news
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="catId != null and catId != ''"> and cat_id = #{catId} </if>
|
||||||
|
<if test="catName != null and catName != ''"> and cat_name = #{catName} </if>
|
||||||
|
<if test="sourceName != null and sourceName != ''"> and source_name = #{sourceName} </if>
|
||||||
|
<if test="title != null and title != ''"> and title = #{title} </if>
|
||||||
|
<if test="content != null and content != ''"> and content = #{content} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.NewsDO">
|
||||||
|
insert into news
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`cat_id`,
|
||||||
|
`cat_name`,
|
||||||
|
`source_name`,
|
||||||
|
`title`,
|
||||||
|
`content`,
|
||||||
|
`create_time`,
|
||||||
|
`create_user_id`,
|
||||||
|
`update_time`,
|
||||||
|
`update_user_id`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{catId},
|
||||||
|
#{catName},
|
||||||
|
#{sourceName},
|
||||||
|
#{title},
|
||||||
|
#{content},
|
||||||
|
#{createTime},
|
||||||
|
#{createUserId},
|
||||||
|
#{updateTime},
|
||||||
|
#{updateUserId}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.NewsDO">
|
||||||
|
insert into news
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="catId != null"> `cat_id`, </if>
|
||||||
|
<if test="catName != null"> `cat_name`, </if>
|
||||||
|
<if test="sourceName != null"> `source_name`, </if>
|
||||||
|
<if test="title != null"> `title`, </if>
|
||||||
|
<if test="content != null"> `content`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="createUserId != null"> `create_user_id`, </if>
|
||||||
|
<if test="updateTime != null"> `update_time`, </if>
|
||||||
|
<if test="updateUserId != null"> `update_user_id` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="catId != null"> #{catId}, </if>
|
||||||
|
<if test="catName != null"> #{catName}, </if>
|
||||||
|
<if test="sourceName != null"> #{sourceName}, </if>
|
||||||
|
<if test="title != null"> #{title}, </if>
|
||||||
|
<if test="content != null"> #{content}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="createUserId != null"> #{createUserId}, </if>
|
||||||
|
<if test="updateTime != null"> #{updateTime}, </if>
|
||||||
|
<if test="updateUserId != null"> #{updateUserId} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.NewsDO">
|
||||||
|
update news
|
||||||
|
<set>
|
||||||
|
<if test="catId != null">`cat_id` = #{catId}, </if>
|
||||||
|
<if test="catName != null">`cat_name` = #{catName}, </if>
|
||||||
|
<if test="sourceName != null">`source_name` = #{sourceName}, </if>
|
||||||
|
<if test="title != null">`title` = #{title}, </if>
|
||||||
|
<if test="content != null">`content` = #{content}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="createUserId != null">`create_user_id` = #{createUserId}, </if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}, </if>
|
||||||
|
<if test="updateUserId != null">`update_user_id` = #{updateUserId}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from news where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from news where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
145
novel-admin/src/main/resources/mybatis/novel/PayMapper.xml
Normal file
145
novel-admin/src/main/resources/mybatis/novel/PayMapper.xml
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
<?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.PayDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.PayDO">
|
||||||
|
select `id`,`out_trade_no`,`trade_no`,`pay_channel`,`total_amount`,`user_id`,`pay_status`,`create_time`,`update_time` from order_pay where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.PayDO">
|
||||||
|
select `id`,`out_trade_no`,`trade_no`,`pay_channel`,`total_amount`,`user_id`,`pay_status`,`create_time`,`update_time` from order_pay
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="outTradeNo != null and outTradeNo != ''"> and out_trade_no = #{outTradeNo} </if>
|
||||||
|
<if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo} </if>
|
||||||
|
<if test="payChannel != null and payChannel != ''"> and pay_channel = #{payChannel} </if>
|
||||||
|
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
|
||||||
|
<if test="userId != null and userId != ''"> and user_id = #{userId} </if>
|
||||||
|
<if test="payStatus != null and payStatus != ''"> and pay_status = #{payStatus} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from order_pay
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||||
|
<if test="outTradeNo != null and outTradeNo != ''"> and out_trade_no = #{outTradeNo} </if>
|
||||||
|
<if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo} </if>
|
||||||
|
<if test="payChannel != null and payChannel != ''"> and pay_channel = #{payChannel} </if>
|
||||||
|
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
|
||||||
|
<if test="userId != null and userId != ''"> and user_id = #{userId} </if>
|
||||||
|
<if test="payStatus != null and payStatus != ''"> and pay_status = #{payStatus} </if>
|
||||||
|
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||||
|
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.PayDO">
|
||||||
|
insert into order_pay
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`out_trade_no`,
|
||||||
|
`trade_no`,
|
||||||
|
`pay_channel`,
|
||||||
|
`total_amount`,
|
||||||
|
`user_id`,
|
||||||
|
`pay_status`,
|
||||||
|
`create_time`,
|
||||||
|
`update_time`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{outTradeNo},
|
||||||
|
#{tradeNo},
|
||||||
|
#{payChannel},
|
||||||
|
#{totalAmount},
|
||||||
|
#{userId},
|
||||||
|
#{payStatus},
|
||||||
|
#{createTime},
|
||||||
|
#{updateTime}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.PayDO">
|
||||||
|
insert into order_pay
|
||||||
|
(
|
||||||
|
<if test="id != null"> `id`, </if>
|
||||||
|
<if test="outTradeNo != null"> `out_trade_no`, </if>
|
||||||
|
<if test="tradeNo != null"> `trade_no`, </if>
|
||||||
|
<if test="payChannel != null"> `pay_channel`, </if>
|
||||||
|
<if test="totalAmount != null"> `total_amount`, </if>
|
||||||
|
<if test="userId != null"> `user_id`, </if>
|
||||||
|
<if test="payStatus != null"> `pay_status`, </if>
|
||||||
|
<if test="createTime != null"> `create_time`, </if>
|
||||||
|
<if test="updateTime != null"> `update_time` </if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null"> #{id}, </if>
|
||||||
|
<if test="outTradeNo != null"> #{outTradeNo}, </if>
|
||||||
|
<if test="tradeNo != null"> #{tradeNo}, </if>
|
||||||
|
<if test="payChannel != null"> #{payChannel}, </if>
|
||||||
|
<if test="totalAmount != null"> #{totalAmount}, </if>
|
||||||
|
<if test="userId != null"> #{userId}, </if>
|
||||||
|
<if test="payStatus != null"> #{payStatus}, </if>
|
||||||
|
<if test="createTime != null"> #{createTime}, </if>
|
||||||
|
<if test="updateTime != null"> #{updateTime} </if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.PayDO">
|
||||||
|
update order_pay
|
||||||
|
<set>
|
||||||
|
<if test="outTradeNo != null">`out_trade_no` = #{outTradeNo}, </if>
|
||||||
|
<if test="tradeNo != null">`trade_no` = #{tradeNo}, </if>
|
||||||
|
<if test="payChannel != null">`pay_channel` = #{payChannel}, </if>
|
||||||
|
<if test="totalAmount != null">`total_amount` = #{totalAmount}, </if>
|
||||||
|
<if test="userId != null">`user_id` = #{userId}, </if>
|
||||||
|
<if test="payStatus != null">`pay_status` = #{payStatus}, </if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from order_pay where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from order_pay where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="tableSta" resultType="map">
|
||||||
|
SELECT
|
||||||
|
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
||||||
|
COUNT( 1 ) orderCount
|
||||||
|
FROM
|
||||||
|
order_pay
|
||||||
|
WHERE
|
||||||
|
create_time >= #{minDate}
|
||||||
|
GROUP BY
|
||||||
|
DATE_FORMAT( create_time, "%Y-%m-%d" )
|
||||||
|
ORDER BY
|
||||||
|
staDate
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
154
novel-admin/src/main/resources/mybatis/novel/UserMapper.xml
Normal file
154
novel-admin/src/main/resources/mybatis/novel/UserMapper.xml
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
<?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.UserDao">
|
||||||
|
|
||||||
|
<select id="get" resultType="com.java2nb.novel.domain.UserDO">
|
||||||
|
select `id`,`username`,`password`,`nick_name`,`user_photo`,`user_sex`,`account_balance`,`status`,`create_time`,`update_time` from user where id = #{value}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.java2nb.novel.domain.UserDO">
|
||||||
|
select
|
||||||
|
`id`,`username`,`password`,`nick_name`,`user_photo`,`user_sex`,`account_balance`,`status`,`create_time`,`update_time`
|
||||||
|
from user
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
|
<if test="username != null and username != ''">and username = #{username}</if>
|
||||||
|
<if test="password != null and password != ''">and password = #{password}</if>
|
||||||
|
<if test="nickName != null and nickName != ''">and nick_name = #{nickName}</if>
|
||||||
|
<if test="userPhoto != null and userPhoto != ''">and user_photo = #{userPhoto}</if>
|
||||||
|
<if test="userSex != null and userSex != ''">and user_sex = #{userSex}</if>
|
||||||
|
<if test="accountBalance != null and accountBalance != ''">and account_balance = #{accountBalance}</if>
|
||||||
|
<if test="status != null and status != ''">and status = #{status}</if>
|
||||||
|
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if>
|
||||||
|
</where>
|
||||||
|
<choose>
|
||||||
|
<when test="sort != null and sort.trim() != ''">
|
||||||
|
order by ${sort} ${order}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
order by id desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
<if test="offset != null and limit != null">
|
||||||
|
limit #{offset}, #{limit}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="count" resultType="int">
|
||||||
|
select count(*) from user
|
||||||
|
<where>
|
||||||
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
|
<if test="username != null and username != ''">and username = #{username}</if>
|
||||||
|
<if test="password != null and password != ''">and password = #{password}</if>
|
||||||
|
<if test="nickName != null and nickName != ''">and nick_name = #{nickName}</if>
|
||||||
|
<if test="userPhoto != null and userPhoto != ''">and user_photo = #{userPhoto}</if>
|
||||||
|
<if test="userSex != null and userSex != ''">and user_sex = #{userSex}</if>
|
||||||
|
<if test="accountBalance != null and accountBalance != ''">and account_balance = #{accountBalance}</if>
|
||||||
|
<if test="status != null and status != ''">and status = #{status}</if>
|
||||||
|
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</if>
|
||||||
|
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="save" parameterType="com.java2nb.novel.domain.UserDO">
|
||||||
|
insert into user
|
||||||
|
(
|
||||||
|
`id`,
|
||||||
|
`username`,
|
||||||
|
`password`,
|
||||||
|
`nick_name`,
|
||||||
|
`user_photo`,
|
||||||
|
`user_sex`,
|
||||||
|
`account_balance`,
|
||||||
|
`status`,
|
||||||
|
`create_time`,
|
||||||
|
`update_time`
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
#{id},
|
||||||
|
#{username},
|
||||||
|
#{password},
|
||||||
|
#{nickName},
|
||||||
|
#{userPhoto},
|
||||||
|
#{userSex},
|
||||||
|
#{accountBalance},
|
||||||
|
#{status},
|
||||||
|
#{createTime},
|
||||||
|
#{updateTime}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.UserDO">
|
||||||
|
insert into user
|
||||||
|
(
|
||||||
|
<if test="id != null">`id`,</if>
|
||||||
|
<if test="username != null">`username`,</if>
|
||||||
|
<if test="password != null">`password`,</if>
|
||||||
|
<if test="nickName != null">`nick_name`,</if>
|
||||||
|
<if test="userPhoto != null">`user_photo`,</if>
|
||||||
|
<if test="userSex != null">`user_sex`,</if>
|
||||||
|
<if test="accountBalance != null">`account_balance`,</if>
|
||||||
|
<if test="status != null">`status`,</if>
|
||||||
|
<if test="createTime != null">`create_time`,</if>
|
||||||
|
<if test="updateTime != null">`update_time`</if>
|
||||||
|
)
|
||||||
|
values
|
||||||
|
(
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="username != null">#{username},</if>
|
||||||
|
<if test="password != null">#{password},</if>
|
||||||
|
<if test="nickName != null">#{nickName},</if>
|
||||||
|
<if test="userPhoto != null">#{userPhoto},</if>
|
||||||
|
<if test="userSex != null">#{userSex},</if>
|
||||||
|
<if test="accountBalance != null">#{accountBalance},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime}</if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.java2nb.novel.domain.UserDO">
|
||||||
|
update user
|
||||||
|
<set>
|
||||||
|
<if test="username != null">`username` = #{username},</if>
|
||||||
|
<if test="password != null">`password` = #{password},</if>
|
||||||
|
<if test="nickName != null">`nick_name` = #{nickName},</if>
|
||||||
|
<if test="userPhoto != null">`user_photo` = #{userPhoto},</if>
|
||||||
|
<if test="userSex != null">`user_sex` = #{userSex},</if>
|
||||||
|
<if test="accountBalance != null">`account_balance` = #{accountBalance},</if>
|
||||||
|
<if test="status != null">`status` = #{status},</if>
|
||||||
|
<if test="createTime != null">`create_time` = #{createTime},</if>
|
||||||
|
<if test="updateTime != null">`update_time` = #{updateTime}</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="remove">
|
||||||
|
delete from user where id = #{value}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="batchRemove">
|
||||||
|
delete from user where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="tableSta" resultType="map">
|
||||||
|
SELECT
|
||||||
|
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
||||||
|
COUNT( 1 ) userCount
|
||||||
|
FROM
|
||||||
|
USER
|
||||||
|
WHERE
|
||||||
|
create_time >= #{minDate}
|
||||||
|
GROUP BY
|
||||||
|
DATE_FORMAT( create_time, "%Y-%m-%d" )
|
||||||
|
ORDER BY
|
||||||
|
staDate
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.java2nb.system.dao.UserDao">
|
<mapper namespace="com.java2nb.system.dao.SysUserDao">
|
||||||
|
|
||||||
<select id="get" resultType="com.java2nb.system.domain.UserDO">
|
<select id="get" resultType="com.java2nb.system.domain.UserDO">
|
||||||
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district` from sys_user where user_id = #{value}
|
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district` from sys_user where user_id = #{value}
|
||||||
|
@ -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/author/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,244 @@
|
|||||||
|
var prefix = "/novel/author"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'inviteCode',
|
||||||
|
title: '邀请码'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'penName',
|
||||||
|
title: '笔名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'telPhone',
|
||||||
|
title: '手机号码'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'chatAccount',
|
||||||
|
title: 'QQ或微信账号'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'email',
|
||||||
|
title: '电子邮箱'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'workDirection',
|
||||||
|
title: '作品方向',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return formatDict("work_direction", value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '入驻时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: '状态',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return value == 1 ? '封禁' : '正常';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
if(row.status==1) {
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="恢复正常" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\',0)"><i >恢复正常</i></a> ';
|
||||||
|
}else{
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="封禁" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\',1)"><i >封禁</i></a> ';
|
||||||
|
}
|
||||||
|
return 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,status) {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/author/update",
|
||||||
|
data: {'id':id,'status':status},// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
reLoad();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/author/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,115 @@
|
|||||||
|
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/authorCode/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: {
|
||||||
|
inviteCode: {
|
||||||
|
required: true
|
||||||
|
}, validityTime: {
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
|
messages: {
|
||||||
|
inviteCode: {
|
||||||
|
required: icon + "请选择邀请码"
|
||||||
|
}, validityTime: {
|
||||||
|
required: icon + "请选择有效时间"
|
||||||
|
}, }
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,212 @@
|
|||||||
|
var prefix = "/novel/authorCode"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'inviteCode',
|
||||||
|
title: '邀请码'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'validityTime',
|
||||||
|
title: '有效时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'isUse',
|
||||||
|
title: '是否使用过',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return value == 1 ? '使用过' : '未使用';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/* {
|
||||||
|
field: 'createUserId',
|
||||||
|
title: '创建人ID'
|
||||||
|
},*/
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
/* var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';*/
|
||||||
|
/* var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';*/
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,115 @@
|
|||||||
|
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/authorCode/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: {
|
||||||
|
inviteCode:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, validityTime:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
|
messages: {
|
||||||
|
inviteCode:
|
||||||
|
{
|
||||||
|
required: icon + "请选择邀请码"
|
||||||
|
}, validityTime:
|
||||||
|
{
|
||||||
|
required: icon + "请选择有效时间"
|
||||||
|
}, }
|
||||||
|
})
|
||||||
|
}
|
107
novel-admin/src/main/resources/static/js/appjs/novel/book/add.js
Normal file
107
novel-admin/src/main/resources/static/js/appjs/novel/book/add.js
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function save() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/book/save",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,363 @@
|
|||||||
|
var prefix = "/novel/book"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '主键'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'workDirection',
|
||||||
|
title: '作品方向,0:男频,1:女频'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'catId',
|
||||||
|
title: '分类ID'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'catName',
|
||||||
|
title: '分类名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'catChildId',
|
||||||
|
title: '子分类ID'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'catChildName',
|
||||||
|
title: '子分类名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'picUrl',
|
||||||
|
title: '小说封面'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'bookName',
|
||||||
|
title: '小说名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'heroName',
|
||||||
|
title: '男主角姓名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'ladyName',
|
||||||
|
title: '女主角姓名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'bookStyle',
|
||||||
|
title: '作品风格,0:甜宠,1:虐恋,2:其他'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'bookLabel',
|
||||||
|
title: '作品标签'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'authorId',
|
||||||
|
title: '作者id'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'authorName',
|
||||||
|
title: '作者名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'bookDesc',
|
||||||
|
title: '书籍描述'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'score',
|
||||||
|
title: '评分,预留字段'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'bookStatus',
|
||||||
|
title: '书籍状态,0:连载中,1:已完结'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'visitCount',
|
||||||
|
title: '点击量'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'wordCount',
|
||||||
|
title: '总字数'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'commentCount',
|
||||||
|
title: '评论数'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'yesterdayBuy',
|
||||||
|
title: '昨日订阅数'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'lastIndexId',
|
||||||
|
title: '最新目录ID'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'lastIndexName',
|
||||||
|
title: '最新目录名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'lastIndexUpdateTime',
|
||||||
|
title: '最新目录更新时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'isVip',
|
||||||
|
title: '是否收费,1:收费,0:免费'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: '状态,0:入库,1:上架'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'updateTime',
|
||||||
|
title: '更新时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'crawlSourceId',
|
||||||
|
title: '爬虫源站ID'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'crawlBookId',
|
||||||
|
title: '抓取的源站小说ID'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'crawlLastTime',
|
||||||
|
title: '最后一次的抓取时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'crawlIsStop',
|
||||||
|
title: '是否已停止更新,0:未停止,1:已停止'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return d + e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/book/update",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,111 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function save() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/category/save",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
name: {
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
|
messages: {
|
||||||
|
name: {
|
||||||
|
required: icon + "请选择分类名"
|
||||||
|
}, }
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,193 @@
|
|||||||
|
var prefix = "/novel/category"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'name',
|
||||||
|
title: '分类名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'sort',
|
||||||
|
title: '排序'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,109 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/category/update",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
name:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
|
messages: {
|
||||||
|
name:
|
||||||
|
{
|
||||||
|
required: icon + "请选择分类名"
|
||||||
|
}, }
|
||||||
|
})
|
||||||
|
}
|
123
novel-admin/src/main/resources/static/js/appjs/novel/news/add.js
Normal file
123
novel-admin/src/main/resources/static/js/appjs/novel/news/add.js
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function save() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/news/save",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
catId: {
|
||||||
|
required: true
|
||||||
|
}, catName: {
|
||||||
|
required: true
|
||||||
|
}, title: {
|
||||||
|
required: true
|
||||||
|
}, content: {
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
|
messages: {
|
||||||
|
catId: {
|
||||||
|
required: icon + "请选择类别ID"
|
||||||
|
}, catName: {
|
||||||
|
required: icon + "请选择分类名"
|
||||||
|
}, title: {
|
||||||
|
required: icon + "请选择标题"
|
||||||
|
}, content: {
|
||||||
|
required: icon + "请选择内容"
|
||||||
|
}, }
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,127 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
editor.txt.html($("#" + relName).val());
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function update() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/news/update",
|
||||||
|
data: $('#signupForm').serialize(),// 你的formid
|
||||||
|
async: false,
|
||||||
|
error: function (request) {
|
||||||
|
parent.layer.alert("Connection error");
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.code == 0) {
|
||||||
|
parent.layer.msg("操作成功");
|
||||||
|
parent.reLoad();
|
||||||
|
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
|
||||||
|
parent.layer.close(index);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(data.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
function validateRule() {
|
||||||
|
var icon = "<i class='fa fa-times-circle'></i> ";
|
||||||
|
$("#signupForm").validate({
|
||||||
|
ignore: "",
|
||||||
|
rules: {
|
||||||
|
catId:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, catName:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, title:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, content:
|
||||||
|
{
|
||||||
|
required: true
|
||||||
|
}, },
|
||||||
|
messages: {
|
||||||
|
catId:
|
||||||
|
{
|
||||||
|
required: icon + "请选择类别ID"
|
||||||
|
}, catName:
|
||||||
|
{
|
||||||
|
required: icon + "请选择分类名"
|
||||||
|
}, title:
|
||||||
|
{
|
||||||
|
required: icon + "请选择标题"
|
||||||
|
}, content:
|
||||||
|
{
|
||||||
|
required: icon + "请选择内容"
|
||||||
|
}, }
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,206 @@
|
|||||||
|
var prefix = "/novel/news"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'catName',
|
||||||
|
title: '分类名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'sourceName',
|
||||||
|
title: '来源'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'title',
|
||||||
|
title: '标题'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '发布时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
107
novel-admin/src/main/resources/static/js/appjs/novel/pay/add.js
Normal file
107
novel-admin/src/main/resources/static/js/appjs/novel/pay/add.js
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function save() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/pay/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: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
103
novel-admin/src/main/resources/static/js/appjs/novel/pay/edit.js
Normal file
103
novel-admin/src/main/resources/static/js/appjs/novel/pay/edit.js
Normal file
@ -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/pay/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: {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
225
novel-admin/src/main/resources/static/js/appjs/novel/pay/pay.js
Normal file
225
novel-admin/src/main/resources/static/js/appjs/novel/pay/pay.js
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
var prefix = "/novel/pay"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '主键'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'outTradeNo',
|
||||||
|
title: '保留'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'tradeNo',
|
||||||
|
title: '订单号'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'payChannel',
|
||||||
|
title: '保留'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'totalAmount',
|
||||||
|
title: '交易香蕉币'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'userId',
|
||||||
|
title: '支付用户ID'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'payStatus',
|
||||||
|
title: '支付状态:0:支付失败,1:支付成功,2:待支付'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'updateTime',
|
||||||
|
title: '更新时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return d + e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
107
novel-admin/src/main/resources/static/js/appjs/novel/user/add.js
Normal file
107
novel-admin/src/main/resources/static/js/appjs/novel/user/add.js
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
var E = window.wangEditor;
|
||||||
|
$("[id^='contentEditor']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(13);
|
||||||
|
var editor = new E('#contentEditor' + relName);
|
||||||
|
// 自定义菜单配置
|
||||||
|
editor.customConfig.menus = [
|
||||||
|
'head', // 标题
|
||||||
|
'bold', // 粗体
|
||||||
|
'fontSize', // 字号
|
||||||
|
'fontName', // 字体
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikeThrough', // 删除线
|
||||||
|
'foreColor', // 文字颜色
|
||||||
|
//'backColor', // 背景颜色
|
||||||
|
//'link', // 插入链接
|
||||||
|
'list', // 列表
|
||||||
|
'justify', // 对齐方式
|
||||||
|
'quote', // 引用
|
||||||
|
'emoticon', // 表情
|
||||||
|
'image', // 插入图片
|
||||||
|
//'table', // 表格
|
||||||
|
//'video', // 插入视频
|
||||||
|
//'code', // 插入代码
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo' // 重复
|
||||||
|
];
|
||||||
|
editor.customConfig.onchange = function (html) {
|
||||||
|
// html 即变化之后的内容
|
||||||
|
$("#" + relName).val(html);
|
||||||
|
}
|
||||||
|
editor.customConfig.uploadImgShowBase64 = true;
|
||||||
|
editor.create();
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$("[id^='picImage']").each(function (index, ele) {
|
||||||
|
var relName = $(ele).attr("id").substring(8);
|
||||||
|
layui.use('upload', function () {
|
||||||
|
var upload = layui.upload;
|
||||||
|
//执行实例
|
||||||
|
var uploadInst = upload.render({
|
||||||
|
elem: '#picImage' + relName, //绑定元素
|
||||||
|
url: '/common/sysFile/upload', //上传接口
|
||||||
|
size: 1000,
|
||||||
|
accept: 'file',
|
||||||
|
done: function (r) {
|
||||||
|
$("#picImage" + relName).attr("src", r.fileName);
|
||||||
|
$("#" + relName).val(r.fileName);
|
||||||
|
},
|
||||||
|
error: function (r) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$().ready(function () {
|
||||||
|
validateRule();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.setDefaults({
|
||||||
|
submitHandler: function () {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function save() {
|
||||||
|
$.ajax({
|
||||||
|
cache: true,
|
||||||
|
type: "POST",
|
||||||
|
url: "/novel/user/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/user/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,231 @@
|
|||||||
|
var prefix = "/novel/user"
|
||||||
|
$(function () {
|
||||||
|
load();
|
||||||
|
});
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
$('#exampleTable')
|
||||||
|
.bootstrapTable(
|
||||||
|
{
|
||||||
|
method: 'get', // 服务器数据的请求方式 get or post
|
||||||
|
url: prefix + "/list", // 服务器数据的加载地址
|
||||||
|
// showRefresh : true,
|
||||||
|
// showToggle : true,
|
||||||
|
// showColumns : true,
|
||||||
|
iconSize: 'outline',
|
||||||
|
toolbar: '#exampleToolbar',
|
||||||
|
striped: true, // 设置为true会有隔行变色效果
|
||||||
|
dataType: "json", // 服务器返回的数据类型
|
||||||
|
pagination: true, // 设置为true会在底部显示分页条
|
||||||
|
// queryParamsType : "limit",
|
||||||
|
// //设置为limit则会发送符合RESTFull格式的参数
|
||||||
|
singleSelect: false, // 设置为true将禁止多选
|
||||||
|
// contentType : "application/x-www-form-urlencoded",
|
||||||
|
// //发送到服务器的数据编码类型
|
||||||
|
pageSize: 10, // 如果设置了分页,每页数据条数
|
||||||
|
pageNumber: 1, // 如果设置了分布,首页页码
|
||||||
|
//search : true, // 是否显示搜索框
|
||||||
|
showColumns: false, // 是否显示内容下拉框(选择显示的列)
|
||||||
|
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
|
||||||
|
queryParams: function (params) {
|
||||||
|
//说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对
|
||||||
|
var queryParams = getFormJson("searchForm");
|
||||||
|
queryParams.limit = params.limit;
|
||||||
|
queryParams.offset = params.offset;
|
||||||
|
return queryParams;
|
||||||
|
},
|
||||||
|
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
|
||||||
|
// queryParamsType = 'limit' ,返回参数必须包含
|
||||||
|
// limit, offset, search, sort, order 否则, 需要包含:
|
||||||
|
// pageSize, pageNumber, searchText, sortName,
|
||||||
|
// sortOrder.
|
||||||
|
// 返回false将会终止请求
|
||||||
|
responseHandler: function (rs) {
|
||||||
|
|
||||||
|
if (rs.code == 0) {
|
||||||
|
return rs.data;
|
||||||
|
} else {
|
||||||
|
parent.layer.alert(rs.msg)
|
||||||
|
return {total: 0, rows: []};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
formatter: function () {
|
||||||
|
return arguments[2] + 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '主键'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'username',
|
||||||
|
title: '登录名'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'password',
|
||||||
|
title: '登录密码'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'nickName',
|
||||||
|
title: '昵称'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'userPhoto',
|
||||||
|
title: '用户头像'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'userSex',
|
||||||
|
title: '用户性别,0:男,1:女'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'accountBalance',
|
||||||
|
title: '账户余额'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: '用户状态,0:正常'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'updateTime',
|
||||||
|
title: '更新时间'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
field: 'id',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-file"></i></a> ';
|
||||||
|
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-edit"></i></a> ';
|
||||||
|
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
|
||||||
|
+ row.id
|
||||||
|
+ '\')"><i class="fa fa-remove"></i></a> ';
|
||||||
|
return d + e + r;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function reLoad() {
|
||||||
|
$('#exampleTable').bootstrapTable('refresh');
|
||||||
|
}
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '增加',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/add' // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function detail(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '详情',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/detail/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function edit(id) {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '编辑',
|
||||||
|
maxmin: true,
|
||||||
|
shadeClose: false, // 点击遮罩关闭层
|
||||||
|
area: ['800px', '520px'],
|
||||||
|
content: prefix + '/edit/' + id // iframe的url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function remove(id) {
|
||||||
|
layer.confirm('确定要删除选中的记录?', {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
}, function () {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/remove",
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
'id': id
|
||||||
|
},
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetPwd(id) {
|
||||||
|
}
|
||||||
|
function batchRemove() {
|
||||||
|
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||||
|
if (rows.length == 0) {
|
||||||
|
layer.msg("请选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
|
||||||
|
btn: ['确定', '取消']
|
||||||
|
// 按钮
|
||||||
|
}, function () {
|
||||||
|
var ids = new Array();
|
||||||
|
// 遍历所有选择的行数据,取每条数据对应的ID
|
||||||
|
$.each(rows, function (i, row) {
|
||||||
|
ids[i] = row['id'];
|
||||||
|
});
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
data: {
|
||||||
|
"ids": ids
|
||||||
|
},
|
||||||
|
url: prefix + '/batchRemove',
|
||||||
|
success: function (r) {
|
||||||
|
if (r.code == 0) {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
reLoad();
|
||||||
|
} else {
|
||||||
|
layer.msg(r.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, function () {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
@ -125,17 +125,17 @@ $(document).ready(function(){
|
|||||||
rules:{
|
rules:{
|
||||||
pwdOld:{
|
pwdOld:{
|
||||||
required:true,
|
required:true,
|
||||||
minlength:6
|
minlength:5
|
||||||
},
|
},
|
||||||
pwdNew:{
|
pwdNew:{
|
||||||
required:true,
|
required:true,
|
||||||
minlength:6,
|
minlength:5,
|
||||||
isdiff:true,
|
isdiff:true,
|
||||||
//issame:true,
|
//issame:true,
|
||||||
},
|
},
|
||||||
confirm_password:{
|
confirm_password:{
|
||||||
required:true,
|
required:true,
|
||||||
minlength:6,
|
minlength:5,
|
||||||
issame:true,
|
issame:true,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,17 +143,17 @@ $(document).ready(function(){
|
|||||||
messages:{
|
messages:{
|
||||||
pwdOld : {
|
pwdOld : {
|
||||||
required:'必填',
|
required:'必填',
|
||||||
minlength:$.validator.format('密码长度要大于6')
|
minlength:$.validator.format('密码长度要大于5')
|
||||||
},
|
},
|
||||||
pwdNew:{
|
pwdNew:{
|
||||||
required:'必填',
|
required:'必填',
|
||||||
minlength:$.validator.format('密码长度要大于6'),
|
minlength:$.validator.format('密码长度要大于5'),
|
||||||
isdiff:'原密码与新密码不能重复',
|
isdiff:'原密码与新密码不能重复',
|
||||||
|
|
||||||
},
|
},
|
||||||
confirm_password:{
|
confirm_password:{
|
||||||
required:'必填',
|
required:'必填',
|
||||||
minlength:$.validator.format('密码长度要大于6'),
|
minlength:$.validator.format('密码长度要大于5'),
|
||||||
issame:'新密码要与确认新密码一致',
|
issame:'新密码要与确认新密码一致',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user