mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-01 07:16:39 +00:00
Compare commits
160 Commits
release_v2
...
3.6.1
Author | SHA1 | Date | |
---|---|---|---|
6fc2df9b5a | |||
c45b81fbbf | |||
40a999f353 | |||
547bf00f46 | |||
d6849bc5a2 | |||
dc654086f3 | |||
303cc2051f | |||
fe90345f0b | |||
7ac4b62840 | |||
029cce959b | |||
7395cf63e5 | |||
906e7762c9 | |||
465e03a17b | |||
2a69a28a0c | |||
c1eb7b8954 | |||
16e381f384 | |||
094ac95428 | |||
96662fcb17 | |||
fecf03b3f5 | |||
e7f702ece0 | |||
b2c67c4f15 | |||
6a385877ac | |||
7cde6ebf61 | |||
78969f9fd1 | |||
b2eb6686e9 | |||
c537f6fb20 | |||
16e4c98a45 | |||
776083076c | |||
2bf945fe0e | |||
ede7aca66d | |||
396452b46e | |||
fc2ea40c6a | |||
bfe4d938fd | |||
7f4728191a | |||
80b393fdda | |||
e7897c988a | |||
750c8dee02 | |||
cbfd0b049f | |||
7f0331e095 | |||
3520200a87 | |||
4939bcf418 | |||
1cffbae495 | |||
b99b6ae4f2 | |||
2e2a58c84b | |||
4fe36a8f4f | |||
b5df86d5c7 | |||
9b3ba1d8c1 | |||
c4db754d23 | |||
8d3ce53dba | |||
d32d9d8410 | |||
05ae012e05 | |||
b60a0c9b40 | |||
3efaf8ce5f | |||
ebc4210774 | |||
655ec90906 | |||
f28dd867ef | |||
8e6842a495 | |||
928cb2417f | |||
625694ba1e | |||
d6c0337c09 | |||
689efc0807 | |||
4540c3781e | |||
9d2c453bb0 | |||
9de47ce697 | |||
c79974ff77 | |||
fb0098aef8 | |||
e83494cb17 | |||
419d7a971b | |||
83eda2a44d | |||
3182029bdd | |||
19d4a9960d | |||
2603150b33 | |||
f5e440390b | |||
91e525ec8e | |||
83afb9e6e2 | |||
19d4c6b778 | |||
d22200b8c7 | |||
43fe1150fd | |||
65b65f874f | |||
3b6bc859a5 | |||
cfc55a6c92 | |||
0a80c5662d | |||
02fd0d7e25 | |||
521142a792 | |||
c567e37423 | |||
b5e0814eb4 | |||
ca6c2aec96 | |||
34859c839b | |||
039f9d9cf8 | |||
224829dd1f | |||
1a5122209a | |||
48aff7cf37 | |||
e673f9be9d | |||
20469bd669 | |||
755300db3c | |||
a790f8042d | |||
d0db2021a6 | |||
c403fc7496 | |||
e4927d7ac6 | |||
a00a2141f2 | |||
7cc7d8b541 | |||
e4822979e2 | |||
ab741ec6bf | |||
057c0646cd | |||
57a9cd09ef | |||
1a49e2a340 | |||
f8411c2337 | |||
343a741c21 | |||
f1a5fb4813 | |||
0428356bd4 | |||
c01097cd5f | |||
7e650a0a04 | |||
45c59ecc37 | |||
5e3962fef4 | |||
7f5035e369 | |||
44aad39847 | |||
6ad51908d5 | |||
f03ab953d0 | |||
5cc9dfa1bc | |||
2fbda60617 | |||
39c19ac004 | |||
7494fe431a | |||
c9f1500976 | |||
f61c252e71 | |||
6fd183c2ae | |||
c3daaecaaa | |||
1b6cc8ccd5 | |||
0a10504461 | |||
1046a7ffc1 | |||
612555dbe6 | |||
d5768e4011 | |||
5982eb623f | |||
85ad5fa3b2 | |||
bdc81f7676 | |||
f31c86f362 | |||
45d8902429 | |||
ff9696bb7e | |||
cacebcaa33 | |||
355cb80458 | |||
a8c74d061c | |||
a713b66c1b | |||
e9d915c1fe | |||
cd3520971d | |||
dc4c9138ee | |||
f830600c3e | |||
154210719f | |||
11e744e6a8 | |||
944ef912e2 | |||
2ce51d5fc0 | |||
2f4b671d84 | |||
6ffd8d90d7 | |||
1e2b6f4103 | |||
24c7175872 | |||
a6b009cc84 | |||
04afa759a7 | |||
1be39a0f13 | |||
2fd0349a80 | |||
79fd85ab9b | |||
0b22bbb111 | |||
7f4d315f25 |
25
.gitignore
vendored
25
.gitignore
vendored
@ -1,18 +1,7 @@
|
||||
/.idea
|
||||
/cachedata
|
||||
/logs
|
||||
/novel-common/target
|
||||
/novel-front/target
|
||||
/novel-front/*.iml
|
||||
/novel-common/*.iml
|
||||
/novel-mobile/target
|
||||
/novel-mobile/*.iml
|
||||
/novel-front/novel-front.iml
|
||||
/novel-crawl/novel-crawl.iml
|
||||
/novel-crawl/target
|
||||
/novel-admin/target
|
||||
/*.iml
|
||||
/novel-admin/*.iml
|
||||
.DS_Store
|
||||
/novel-admin/cachedata
|
||||
/novel-admin/logs
|
||||
**/logs
|
||||
**/.idea
|
||||
**/cachedata
|
||||
**/target
|
||||
**/*.iml
|
||||
**/.DS_Store
|
||||
|
||||
|
@ -1,135 +0,0 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
@ -1,177 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
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);
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
<?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>
|
@ -1,113 +0,0 @@
|
||||
<!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>
|
@ -1,115 +0,0 @@
|
||||
<!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>
|
264
README.md
264
README.md
@ -1,95 +1,76 @@
|
||||
[]( https://cloud.tencent.com/act/cps/redirect?redirect=1052&cps_key=736e609d66e0ac4e57813316cec6fd0b&from=console )
|
||||
[]( https://curl.qcloud.com/kgMaOjoq )
|
||||
|
||||
# 小说精品屋-plus
|
||||
[](https://github.com/201206030/novel-plus)
|
||||
[](https://github.com/201206030/novel-plus)
|
||||
[](https://gitee.com/novel_dev_team/novel-plus)
|
||||
[](https://gitee.com/novel_dev_team/novel-plus)
|
||||
|
||||
#### 新项目:小说精品屋-微服务版
|
||||
#### 官网
|
||||
|
||||
基于小说精品屋-plus构建的Spring Cloud 微服务小说门户平台。
|
||||
https://201206030.github.io
|
||||
|
||||
Gitee仓库地址: https://gitee.com/xiongxyang/novel-cloud
|
||||
#### 学习版
|
||||
|
||||
GitHub仓库地址: https://github.com/201206030/novel-cloud
|
||||
[基于 Spring Boot 3 + Vue 3 开发的前后端分离学习型小说项目。](https://github.com/201206030/novel)
|
||||
|
||||
#### 示例网站
|
||||
#### 微服务版
|
||||
|
||||
[网站1,点击前往](http://www.bqmfxs.cn)
|
||||
[Github](https://github.com/201206030/novel-cloud) | [码云](https://gitee.com/novel_dev_team/novel-cloud)
|
||||
|
||||
[网站2,点击前往](http://iyuedu.space)
|
||||
#### 演示地址
|
||||
|
||||
[网站3,点击前往](http://suxiange.com)
|
||||
|
||||
[网站4,点击前往](http://ruoshu.com)
|
||||
|
||||
[网站5,点击前往](https://www.jingjiao.net)
|
||||
|
||||
[网站6,点击前往](http://www.shucheng.in)
|
||||
|
||||
#### 前言
|
||||
|
||||
小说精品屋-plus致力于打造一个完整的商用小说门户平台,使用前建议先阅读此文档。
|
||||
[点击前往](http://47.106.243.172:8888/)
|
||||
|
||||
#### 项目介绍
|
||||
|
||||
小说精品屋-plus是在[小说精品屋](https://github.com/201206030/fiction_house)的基础上,去除了漫画和弹幕模块,专注于小说,是一个多端(PC、移动)阅读、功能完善的小说原创/爬虫网站项目,既包含了作家专区供原创作者上传小说,又提供了爬虫工具通过规则多线程全自动采集任意小说网站数据(已兼容99%的小说网站),新书自动入库,老书自动更新。
|
||||
|
||||
小说精品屋-plus重新进行了数据库设计、代码重构和功能增强,提升了程序整体的可读性和性能,增加了很多商用特性。主要升级如下:
|
||||
|
||||
- [x] 数据库重新设计,结构调整。
|
||||
- [x] 服务端代码重构,MyBatis3升级为MyBatis3DynamicSql。
|
||||
- [x] 移动站与PC站站点分离,浏览器自动识别跳转。
|
||||
- [x] PC站UI更新。
|
||||
- [x] 新闻模块。
|
||||
- [x] 排行榜。
|
||||
- [x] 小说评论模块。
|
||||
- [x] 阅读主题模块。
|
||||
- [x] 作家专区。
|
||||
- [x] 充值。
|
||||
- [x] 订阅。
|
||||
- [x] 后台管理系统。
|
||||
- [x] 爬虫管理系统。
|
||||
novel-plus 是一个多端(PC、WAP)阅读,功能完善的原创文学 CMS
|
||||
系统。由前台门户系统、作家后台管理系统、平台后台管理系统和爬虫管理系统等多个子系统构成,包括小说推荐、作品检索、小说排行、小说阅读、小说评论、会员中心、作家专区等功能,支持自定义多模版、可拓展的多种小说内容存储方式(内置数据库分表存储和
|
||||
TXT 文本存储)、阅读主题切换、多爬虫源自动采集和更新数据、会员充值、订阅模式、新闻发布和实时统计报表。
|
||||
|
||||
#### 项目结构
|
||||
|
||||
```
|
||||
novel-plus -- 父工程
|
||||
├── novel-common -- 通用模块
|
||||
├── novel-front -- 前台门户系统
|
||||
├── novel-crawl -- 爬虫管理系统
|
||||
└── novel-admin -- 后台管理系统
|
||||
├── novel-front -- 前台门户&作家后台管理子系统(可拆分)
|
||||
├── novel-crawl -- 爬虫管理子系统
|
||||
├── novel-admin -- 平台后台管理子系统
|
||||
└── templates -- 前端模版
|
||||
```
|
||||
|
||||
#### 技术选型
|
||||
|
||||
| 技术 | 说明
|
||||
| -------------------- | ---------------------------
|
||||
| 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
|
||||
|
||||
| 技术 | 说明
|
||||
|---------------------| ---------------------------
|
||||
| Spring Boot | Spring 应用快速开发脚手架
|
||||
| MyBatis | 持久层 ORM 框架
|
||||
| MyBatis Dynamic SQL | Mybatis 动态 sql
|
||||
| PageHelper | MyBatis 分页插件
|
||||
| MyBatisGenerator | 持久层代码生成插件
|
||||
| Sharding-Jdbc | 代码层分库分表中间件
|
||||
| JJWT | JWT 登录支持
|
||||
| SpringSecurity | 安全框架
|
||||
| Shiro | 安全框架
|
||||
| Ehcache | Java 进程内缓存框架(默认缓存)
|
||||
| Redis | 分布式缓存(缓存替换方案,默认关闭,一行配置开启)
|
||||
| Elasticsearch | 搜索引擎(搜索增强方案,默认关闭,一行配置开启)
|
||||
| RabbitMQ | 消息队列(流量削峰,默认关闭,一行配置开启)
|
||||
| Aliyun OSS | 阿里云对象存储服务(图片存储方式之一,一行配置即可切换)
|
||||
| FastDFS | 开源轻量级分布式文件系统(图片存储方式之一,一行配置即可切换)
|
||||
| Redisson | 实现分布式锁
|
||||
| Lombok | 简化对象封装工具
|
||||
| Docker | 应用容器引擎
|
||||
| MySQL | 数据库服务
|
||||
| Thymeleaf | 模板引擎
|
||||
| Layui | 前端 UI 框架
|
||||
|
||||
#### PC站截图
|
||||
#### 橙色主题模版截图
|
||||
|
||||
##### PC站截图
|
||||
|
||||
1. 首页
|
||||
|
||||

|
||||

|
||||
|
||||
2. 分类索引页
|
||||
|
||||
@ -97,7 +78,7 @@ novel-plus -- 父工程
|
||||
|
||||
3. 搜索页
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
@ -139,78 +120,154 @@ novel-plus -- 父工程
|
||||
|
||||

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

|
||||
<img src="https://s3.ax1x.com/2020/12/27/r5447n.jpg" alt="index" width="300" />
|
||||
|
||||
2. 小说详情页
|
||||
2. 小说列表页
|
||||
|
||||

|
||||
<img src="https://s3.ax1x.com/2020/12/27/r55xKg.jpg" alt="微信图片_20190904181558" width="300" />
|
||||
|
||||
3. 目录页
|
||||
3. 小说详情页
|
||||
|
||||

|
||||
<img src="https://s3.ax1x.com/2020/12/28/roZWOf.jpg" alt="QQ图片20191018161901" width="300" />
|
||||
|
||||
4. 小说阅读页
|
||||
|
||||

|
||||
<img src="https://s3.ax1x.com/2020/12/27/r55Stx.jpg" alt="QQ图片20191018161901" width="300" />
|
||||
|
||||
#### 爬虫管理系统截图
|
||||
##### 爬虫管理系统截图
|
||||
|
||||

|
||||
|
||||

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

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
#### 安装步骤
|
||||
#### 深色主题模版截图
|
||||
|
||||
##### 数据库安装:
|
||||
##### PC站截图
|
||||
|
||||
1. 安装MySQL软件。
|
||||
2. 修改MySQL`max_allowed_packet `配置(建议100M)。
|
||||
3. 新建数据库,设置编码为utf8mb4。
|
||||
4. 执行sql/novel_plus.sql脚本文件。
|
||||
1. 首页
|
||||
|
||||
##### 爬虫管理系统安装:
|
||||

|
||||
|
||||
1. 修改novel-common模块下application-dev.yml文件中的数据库的配置。
|
||||
2. 修改novel-crawl模块下application.yml文件中的管理员账号密码。
|
||||
3. 启动程序,打开浏览器,默认8081端口访问。
|
||||
4. 选择已有或新增爬虫源(支持自定义爬虫规则),点击`开启`按钮,开始爬取小说数据。
|
||||
##### 手机站截图
|
||||
|
||||
##### 前台小说门户安装:
|
||||
1. 首页
|
||||
|
||||
1. 修改novel-common模块下application-dev.yml文件中的数据库的配置。
|
||||
2. 启动程序,打开浏览器,默认8080端口访问。
|
||||

|
||||
|
||||
**喜欢此项目的可以给我的GitHub和Gitee加个Star支持一下 。**
|
||||
4. 小说详情页
|
||||
|
||||
#### 其他安装教程
|
||||

|
||||
|
||||
包安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4272630)
|
||||
5. 目录页
|
||||
|
||||
宝塔安装教程(非官方):[点击前往](https://www.daniao.org/9166.html)
|
||||

|
||||
|
||||
docker安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4271989)
|
||||
5. 小说阅读页
|
||||
|
||||

|
||||
|
||||
#### 蓝色主题模版截图(更新中)
|
||||
|
||||

|
||||
|
||||
#### 源码安装教程
|
||||
|
||||
- JDK 安装
|
||||
|
||||
建议[安装 JDK 8](https://docs.oracle.com/javase/8/docs/technotes/guides/install/linux_jdk.html)
|
||||
|
||||
- MySQL 安装:
|
||||
|
||||
1. [安装 MySQL 服务](https://dev.mysql.com/doc/refman/8.0/en/linux-installation.html)
|
||||
2. 修改 MySQL`max_allowed_packet `配置(建议 100 M)
|
||||
3. 新建数据库,设置编码为 utf8mb4
|
||||
4. 执行 doc/sql/novel_plus.sql 脚本文件
|
||||
|
||||
- Maven 安装
|
||||
|
||||
[安装 Apache Maven](https://maven.apache.org/install.html)
|
||||
|
||||
- 源码打包
|
||||
|
||||
novel-plus 根目录下执行打包命令`mvn clean package -Dmaven.test.skip`
|
||||
|
||||
- 爬虫安装
|
||||
|
||||
1. 上传 novel-crawl/target/build/novel-crawl.zip 压缩包到 Linux 服务器的 novel-crawl 目录
|
||||
2. 使用`unzip novel-crawl.zip`命令解压 novel-crawl.zip
|
||||
3. 修改 `config/application-common-prod.yml` 文件中的数据库配置
|
||||
4. 修改 `config/application-common-prod.yml` 文件中的管理员账号密码
|
||||
5. novel-crawl 目录下使用`bin/novel-crawl.sh start`命令启动爬虫程序
|
||||
6. 打开浏览器,默认`8083`端口访问
|
||||
7. 选择已有或新增爬虫源(支持自定义爬虫规则),点击`开启`按钮,开始采集小说数据
|
||||
8. novel-crawl 目录下使用`bin/novel-crawl.sh stop`命令停止爬虫程序
|
||||
9. novel-crawl 目录下使用`bin/novel-crawl.sh restart`命令重启爬虫程序
|
||||
10. novel-crawl 目录下使用`bin/novel-crawl.sh status`命令查看爬虫程序的运行状态
|
||||
|
||||
- 前台安装
|
||||
|
||||
1. 上传 novel-front/target/build/novel-front.zip 压缩包到 Linux 服务器的 novel-front 目录
|
||||
2. 使用`unzip novel-front.zip`命令解压 novel-front.zip
|
||||
3. 修改 `config/application-common-prod.yml` 文件中的数据库配置
|
||||
4. 修改 `config/application-website.yml` 配置文件中的网站信息
|
||||
5. novel-front 目录下使用`bin/novel-front.sh start`命令启动前台程序
|
||||
6. 打开浏览器,默认`8085`端口访问
|
||||
7. novel-front 目录下使用`bin/novel-front.sh stop`命令停止前台程序
|
||||
8. novel-front 目录下使用`bin/novel-front.sh restart`命令重启前台程序
|
||||
9. novel-front 目录下使用`bin/novel-front.sh status`命令查看前台程序的运行状态
|
||||
|
||||
- 后台安装
|
||||
|
||||
1. 上传 novel-admin/target/build/novel-admin.zip 压缩包到 Linux 服务器的 novel-admin 目录
|
||||
2. 使用`unzip novel-admin.zip`命令解压 novel-admin.zip
|
||||
3. 修改 `config/application-prod.yml` 文件中的数据库配置
|
||||
4. novel-admin 目录下使用`bin/novel-admin.sh start`命令启动后台程序
|
||||
5. 打开浏览器,默认`8088`端口访问
|
||||
6. novel-admin 目录下使用`bin/novel-admin.sh stop`命令停止后台程序
|
||||
7. novel-admin 目录下使用`bin/novel-admin.sh restart`命令重启后台程序
|
||||
8. novel-admin 目录下使用`bin/novel-admin.sh status`命令查看后台程序的运行状态
|
||||
|
||||
**注:部分环境(如新版 Mac OS 系统)获取不到主机 IP,需要手动修改 hosts 文件,增加 IP-主机名(通过 hostname 命令查看主机名)的映射。**
|
||||
|
||||
#### 代码仓库
|
||||
|
||||
Gitee仓库地址: https://gitee.com/xiongxyang/novel-plus
|
||||
Github 仓库地址: https://github.com/201206030/novel-plus
|
||||
|
||||
GitHub仓库地址: https://github.com/201206030/novel-plus
|
||||
Gitee 仓库地址: https://gitee.com/novel_dev_team/novel-plus
|
||||
|
||||
#### QQ交流群
|
||||
#### QQ 交流群
|
||||
|
||||

|
||||
[点击前往官网查看](https://xiongxyang.gitee.io/service.htm)
|
||||
|
||||
#### 微信交流群
|
||||
|
||||
微信群二维码会过期,所以每周在公众号更新一次,请关注公众号“**IT进阶**”回复关键词“**微信群**”获取。
|
||||
|
||||
问问题的三要素
|
||||
|
||||
1. 说明背景,使用了哪个模块,要做什么?
|
||||
|
||||
2. 怎么输入或操作的得到了什么结果? 截图,日志
|
||||
|
||||
3. 哪里不明白或有什么疑问 ?
|
||||
|
||||
#### 微信公众号(发布最新更新资讯、最新前端模版、最新爬虫规则、技术文档等)
|
||||
|
||||

|
||||
|
||||
#### 赞赏支持
|
||||
|
||||
@ -218,17 +275,14 @@ docker安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4271989)
|
||||
|
||||
- 服务器的费用也是一笔开销
|
||||
- 为用户提供更好的开发环境
|
||||
- 一杯咖啡
|
||||
- 一杯咖啡
|
||||
|
||||

|
||||
|
||||
### 免责声明
|
||||
#### 免责声明
|
||||
|
||||
本项目提供的爬虫工具仅用于采集项目初期的测试数据,请勿用于商业盈利。
|
||||
用户使用本系统从事任何违法违规的事情,一切后果由用户自行承担,作者不承担任何责任。
|
||||
本项目提供的爬虫工具仅用于采集项目初期的测试数据,请勿用于商业盈利。 用户使用本系统从事任何违法违规的事情,一切后果由用户自行承担,作者不承担任何责任。
|
||||
|
||||
#### 备注
|
||||
|
||||
精品小说屋所有相关项目均已在开源中国公开,感兴趣的可进入[开源中国](https://www.oschina.net/p/fiction_house)按关键字`精品小说屋`搜索。
|
||||
|
||||
[](https://www.aliyun.com/minisite/goods?userCode=uf4nasee )
|
||||
|
116
doc/api/api.md
Normal file
116
doc/api/api.md
Normal file
@ -0,0 +1,116 @@
|
||||
|
||||
<h1 class="curproject-name"> 小说精品屋-plus </h1>
|
||||
小说精品屋-plus接口
|
||||
|
||||
|
||||
# 作家模块
|
||||
|
||||
## 小说章节分页列表查询接口
|
||||
<a id=小说章节分页列表查询接口> </a>
|
||||
### 基本信息
|
||||
|
||||
**Path:** /book/queryIndexList
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**接口描述:**
|
||||
<p>作家后台章节管理页面需要请求该接口获取小说章节分页列表信息</p>
|
||||
|
||||
|
||||
### 请求参数
|
||||
**Query**
|
||||
|
||||
| 参数名称 | 是否必须 | 示例 | 备注 |
|
||||
| ------------ | ------------ | ------------ | ------------ |
|
||||
| bookId | 是 | 1334337530296893441 | 小说ID |
|
||||
| curr | 否 | 1 | 查询页码,默认1 |
|
||||
| limit | 否 | 5 | 分页大小,默认5 |
|
||||
|
||||
### 返回数据
|
||||
|
||||
<table>
|
||||
<thead class="ant-table-thead">
|
||||
<tr>
|
||||
<th key=name>名称</th><th key=type>类型</th><th key=required>是否必须</th><th key=default>默认值</th><th key=desc>备注</th><th key=sub>其他信息</th>
|
||||
</tr>
|
||||
</thead><tbody className="ant-table-tbody"><tr key=0-0><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> code</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应状态吗,200表示成功</span></td><td key=5></td></tr><tr key=0-1><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> msg</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应信息</span></td><td key=5></td></tr><tr key=0-2><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> data</span></td><td key=1><span>object</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应数据</span></td><td key=5></td></tr><tr key=0-2-0><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> total</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">总数量</span></td><td key=5></td></tr><tr key=0-2-1><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> list</span></td><td key=1><span>object []</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">章节数据集合</span></td><td key=5><p key=3><span style="font-weight: '700'">item 类型: </span><span>object</span></p></td></tr><tr key=0-2-1-0><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> id</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">章节ID</span></td><td key=5></td></tr><tr key=0-2-1-1><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> bookId</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">小说ID</span></td><td key=5></td></tr><tr key=0-2-1-2><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> indexName</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">章节名</span></td><td key=5></td></tr><tr key=0-2-1-3><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> isVip</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">是否收费,1:收费,0:免费</span></td><td key=5></td></tr><tr key=0-2-1-4><td key=0><span style="padding-left: 40px"><span style="color: #8c8a8a">├─</span> updateTime</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">更新时间</span></td><td key=5></td></tr><tr key=0-2-2><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> pageNum</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">页码</span></td><td key=5></td></tr><tr key=0-2-3><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> pageSize</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">分页大小</span></td><td key=5></td></tr><tr key=0-2-4><td key=0><span style="padding-left: 20px"><span style="color: #8c8a8a">├─</span> size</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">当前页数量</span></td><td key=5></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 小说章节删除接口
|
||||
<a id=小说章节删除接口> </a>
|
||||
### 基本信息
|
||||
|
||||
**Path:** /author/deleteIndex/{indexId}
|
||||
|
||||
**Method:** DELETE
|
||||
|
||||
**接口描述:**
|
||||
<p>作家后台章节管理页面点击删除按钮请求该接口删除小说章节内容</p>
|
||||
|
||||
|
||||
### 请求参数
|
||||
**Headers**
|
||||
|
||||
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
|
||||
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||
| Content-Type | application/x-www-form-urlencoded | 是 | | |
|
||||
| Authorization | | 是 | eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE2MDgzNDg0NzksInN1YiI6IntcImlkXCI6MTI1NTA2MDMyODMyMjAyNzUyMCxcInVzZXJuYW1lXCI6XCIxMzU2MDQyMTMyNFwiLFwibmlja05hbWVcIjpcIjEzNTYwNDIxMzI0XCJ9IiwiY3JlYXRlZCI6MTYwNzc0MzY3OTkxM30.0qhwis_zPb6t8wGNejMhDZ2iHCL9Tgh2UHd1gcQBCp8t6RW3ggSwtfo4l_RgMT_v8jOkLW91GzTVWlNnTE6LCA | 认证JWT,请求登录接口成功后返回 |
|
||||
**路径参数**
|
||||
|
||||
| 参数名称 | 示例 | 备注 |
|
||||
| ------------ | ------------ | ------------ |
|
||||
| indexId | 1337603246936645632 | 章节ID |
|
||||
|
||||
### 返回数据
|
||||
|
||||
<table>
|
||||
<thead class="ant-table-thead">
|
||||
<tr>
|
||||
<th key=name>名称</th><th key=type>类型</th><th key=required>是否必须</th><th key=default>默认值</th><th key=desc>备注</th><th key=sub>其他信息</th>
|
||||
</tr>
|
||||
</thead><tbody className="ant-table-tbody"><tr key=0-0><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> code</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应状态吗,200表示成功</span></td><td key=5></td></tr><tr key=0-1><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> msg</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应信息</span></td><td key=5></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## 小说章节发布接口
|
||||
<a id=小说章节发布接口> </a>
|
||||
### 基本信息
|
||||
|
||||
**Path:** /author/addBookContent
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**接口描述:**
|
||||
<p>作家后台章节发布页面点击提交按钮请求该接口新增小说章节内容</p>
|
||||
|
||||
|
||||
### 请求参数
|
||||
**Headers**
|
||||
|
||||
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
|
||||
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||
| Content-Type | application/x-www-form-urlencoded | 是 | | |
|
||||
| Authorization | | 是 | eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE2MDgzNDg0NzksInN1YiI6IntcImlkXCI6MTI1NTA2MDMyODMyMjAyNzUyMCxcInVzZXJuYW1lXCI6XCIxMzU2MDQyMTMyNFwiLFwibmlja05hbWVcIjpcIjEzNTYwNDIxMzI0XCJ9IiwiY3JlYXRlZCI6MTYwNzc0MzY3OTkxM30.0qhwis_zPb6t8wGNejMhDZ2iHCL9Tgh2UHd1gcQBCp8t6RW3ggSwtfo4l_RgMT_v8jOkLW91GzTVWlNnTE6LCA | 认证JWT,请求登录接口成功后返回 |
|
||||
**Body**
|
||||
|
||||
| 参数名称 | 参数类型 | 是否必须 | 示例 | 备注 |
|
||||
| ------------ | ------------ | ------------ | ------------ | ------------ |
|
||||
| bookId | text | 是 | 1334337530296893441 | 小说ID |
|
||||
| indexName | text | 是 | 第六章未婚妻(下) | 章节名 |
|
||||
| content | text | 是 | 开始之时,李七夜还是生疏无比,那怕他对于刀术的所有奥义了然于胸,但是,他出刀之时依然会颤抖,无法达到妙及巅毫的要求。 | 章节内容 |
|
||||
| isVip | text | 是 | 1 | 是否收费,1:收费,0:免费 |
|
||||
|
||||
|
||||
|
||||
### 返回数据
|
||||
|
||||
<table>
|
||||
<thead class="ant-table-thead">
|
||||
<tr>
|
||||
<th key=name>名称</th><th key=type>类型</th><th key=required>是否必须</th><th key=default>默认值</th><th key=desc>备注</th><th key=sub>其他信息</th>
|
||||
</tr>
|
||||
</thead><tbody className="ant-table-tbody"><tr key=0-0><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> code</span></td><td key=1><span>number</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应状态吗,200表示成功</span></td><td key=5></td></tr><tr key=0-1><td key=0><span style="padding-left: 0px"><span style="color: #8c8a8a"></span> msg</span></td><td key=1><span>string</span></td><td key=2>必须</td><td key=3></td><td key=4><span style="white-space: pre-wrap">响应信息</span></td><td key=5></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
32
doc/sql/20201201.sql
Normal file
32
doc/sql/20201201.sql
Normal file
@ -0,0 +1,32 @@
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (246, 241, '批量删除', NULL, 'novel:news:batchRemove', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (245, 241, '删除', NULL, 'novel:news:remove', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (244, 241, '修改', NULL, 'novel:news:edit', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (243, 241, '新增', NULL, 'novel:news:add', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (242, 241, '查看', NULL, 'novel:news:detail', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (241, 234, '新闻列表', 'novel/news', 'novel:news:news', 1, 'fa', 8, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (240, 235, '批量删除', NULL, 'novel:category:batchRemove', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (239, 235, '删除', NULL, 'novel:category:remove', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (238, 235, '修改', NULL, 'novel:category:edit', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (237, 235, '新增', NULL, 'novel:category:add', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (236, 235, '查看', NULL, 'novel:category:detail', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (235, 234, '类别管理', 'novel/category', 'novel:category:category', 1, 'fa', 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (234, 0, '新闻管理', '', '', 0, 'fa fa-newspaper-o', 8, NULL, NULL);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4889, 1, 246);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4890, 1, 245);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4891, 1, 244);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4892, 1, 243);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4893, 1, 242);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4899, 1, 241);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4894, 1, 240);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4895, 1, 239);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4896, 1, 238);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4897, 1, 237);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4898, 1, 236);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4900, 1, 235);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4888, 1, 234);
|
||||
|
||||
|
||||
delete from sys_menu where menu_id = 202;
|
1
doc/sql/20210726.sql
Normal file
1
doc/sql/20210726.sql
Normal file
@ -0,0 +1 @@
|
||||
alter table news add column `read_count` BIGINT NOT NULL DEFAULT '0' COMMENT '阅读量' after content;
|
3
doc/sql/20210913.sql
Normal file
3
doc/sql/20210913.sql
Normal file
@ -0,0 +1,3 @@
|
||||
alter table book_index add column storage_type varchar(10) NOT NULL DEFAULT 'db' COMMENT '存储方式' after book_price ;
|
||||
|
||||
|
@ -491,13 +491,6 @@ CREATE TABLE `sys_dept` (
|
||||
-- ----------------------------
|
||||
-- Records of sys_dept
|
||||
-- ----------------------------
|
||||
INSERT INTO `sys_dept` VALUES ('6', '0', '研发部', '1', '1');
|
||||
INSERT INTO `sys_dept` VALUES ('7', '6', '研發一部', '1', '1');
|
||||
INSERT INTO `sys_dept` VALUES ('8', '6', '研发二部', '2', '1');
|
||||
INSERT INTO `sys_dept` VALUES ('9', '0', '销售部', '2', '1');
|
||||
INSERT INTO `sys_dept` VALUES ('10', '9', '销售一部', '1', '1');
|
||||
INSERT INTO `sys_dept` VALUES ('11', '0', '产品部', '3', '1');
|
||||
INSERT INTO `sys_dept` VALUES ('12', '11', '产品一部', '1', '1');
|
||||
INSERT INTO `sys_dept` VALUES ('13', '0', '测试部', '5', '1');
|
||||
INSERT INTO `sys_dept` VALUES ('14', '13', '测试一部', '1', '1');
|
||||
INSERT INTO `sys_dept` VALUES ('15', '13', '测试二部', '2', '1');
|
||||
@ -894,52 +887,6 @@ CREATE TABLE `sys_log` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1412 DEFAULT CHARSET=utf8 COMMENT='系统日志';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_log
|
||||
-- ----------------------------
|
||||
INSERT INTO `sys_log` VALUES ('1369', '-1', '获取用户信息为空', '登录', '462', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:09:21');
|
||||
INSERT INTO `sys_log` VALUES ('1370', '-1', '获取用户信息为空', '登录', '19', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:09:26');
|
||||
INSERT INTO `sys_log` VALUES ('1371', '1', 'admin', '登录', '98', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:09:33');
|
||||
INSERT INTO `sys_log` VALUES ('1372', '1', 'admin', '请求访问主页', '372', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 11:09:33');
|
||||
INSERT INTO `sys_log` VALUES ('1373', '1', 'admin', '请求访问主页', '28', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 11:12:41');
|
||||
INSERT INTO `sys_log` VALUES ('1374', '1', 'admin', '编辑角色', '11', 'com.java2nb.system.controller.RoleController.edit()', null, '127.0.0.1', '2020-05-13 11:18:42');
|
||||
INSERT INTO `sys_log` VALUES ('1375', '1', 'admin', '添加菜单', '2', 'com.java2nb.system.controller.MenuController.add()', null, '127.0.0.1', '2020-05-13 11:19:55');
|
||||
INSERT INTO `sys_log` VALUES ('1376', '1', 'admin', '保存菜单', '225', 'com.java2nb.system.controller.MenuController.save()', null, '127.0.0.1', '2020-05-13 11:24:42');
|
||||
INSERT INTO `sys_log` VALUES ('1377', '1', 'admin', '编辑菜单', '15', 'com.java2nb.system.controller.MenuController.edit()', null, '127.0.0.1', '2020-05-13 11:24:54');
|
||||
INSERT INTO `sys_log` VALUES ('1378', '1', 'admin', '编辑菜单', '11', 'com.java2nb.system.controller.MenuController.edit()', null, '127.0.0.1', '2020-05-13 11:24:58');
|
||||
INSERT INTO `sys_log` VALUES ('1379', '1', 'admin', '更新菜单', '241', 'com.java2nb.system.controller.MenuController.update()', null, '127.0.0.1', '2020-05-13 11:25:12');
|
||||
INSERT INTO `sys_log` VALUES ('1380', '1', 'admin', '编辑菜单', '8', 'com.java2nb.system.controller.MenuController.edit()', null, '127.0.0.1', '2020-05-13 11:25:16');
|
||||
INSERT INTO `sys_log` VALUES ('1381', '1', 'admin', '更新菜单', '199', 'com.java2nb.system.controller.MenuController.update()', null, '127.0.0.1', '2020-05-13 11:25:26');
|
||||
INSERT INTO `sys_log` VALUES ('1382', '1', 'admin', '编辑角色', '13', 'com.java2nb.system.controller.RoleController.edit()', null, '127.0.0.1', '2020-05-13 11:26:11');
|
||||
INSERT INTO `sys_log` VALUES ('1383', '1', 'admin', '更新角色', '931', 'com.java2nb.system.controller.RoleController.update()', null, '127.0.0.1', '2020-05-13 11:26:36');
|
||||
INSERT INTO `sys_log` VALUES ('1384', '-1', '获取用户信息为空', '登录', '11', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:27:02');
|
||||
INSERT INTO `sys_log` VALUES ('1385', '1', 'admin', '登录', '19', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:27:08');
|
||||
INSERT INTO `sys_log` VALUES ('1386', '1', 'admin', '请求访问主页', '27', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 11:27:08');
|
||||
INSERT INTO `sys_log` VALUES ('1387', '1', 'admin', '登录', '272', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:27:56');
|
||||
INSERT INTO `sys_log` VALUES ('1388', '1', 'admin', '请求访问主页', '109', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 11:27:56');
|
||||
INSERT INTO `sys_log` VALUES ('1389', '1', 'admin', '编辑角色', '8', 'com.java2nb.system.controller.RoleController.edit()', null, '127.0.0.1', '2020-05-13 11:30:36');
|
||||
INSERT INTO `sys_log` VALUES ('1390', '1', 'admin', '更新角色', '567', 'com.java2nb.system.controller.RoleController.update()', null, '127.0.0.1', '2020-05-13 11:30:42');
|
||||
INSERT INTO `sys_log` VALUES ('1391', '-1', '获取用户信息为空', '登录', '246', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:31:38');
|
||||
INSERT INTO `sys_log` VALUES ('1392', '1', 'admin', '登录', '38', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:31:42');
|
||||
INSERT INTO `sys_log` VALUES ('1393', '1', 'admin', '请求访问主页', '110', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 11:31:43');
|
||||
INSERT INTO `sys_log` VALUES ('1394', '1', 'admin', 'error', null, 'http://127.0.0.1/test/order/list', 'org.springframework.jdbc.BadSqlGrammarException: \r\n### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Table \'novel_plus.fb_order\' doesn\'t exist\r\n### The error may exist in file [E:\\baseprojectparent\\novel-plus\\novel-admin\\target\\classes\\mybatis\\test\\OrderMapper.xml]\r\n### The error may involve defaultParameterMap\r\n### The error occurred while setting parameters\r\n### SQL: select `id`,`fb_merchant_code`,`merchant_order_sn`,`order_sn`,`platform_order_no`,`trade_no`,`order_state`,`fn_coupon`,`red_packet`,`total_fee`,`order_price`,`fee`,`body`,`attach`,`store_id`,`cashier_id`,`device_no`,`user_id`,`user_logon_id`,`pay_time`,`pay_channel`,`no_cash_coupon_fee`,`cash_coupon_fee`,`cash_fee`,`sign`,`options`,`create_time`,`push_time`,`push_ip`,`mcht_id`,`sn` from fb_order order by id desc limit ?, ?\r\n### Cause: java.sql.SQLSyntaxErrorException: Table \'novel_plus.fb_order\' doesn\'t exist\n; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Table \'novel_plus.fb_order\' doesn\'t exist', null, '2020-05-13 11:33:27');
|
||||
INSERT INTO `sys_log` VALUES ('1395', '1', 'admin', '登录', '276', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:39:20');
|
||||
INSERT INTO `sys_log` VALUES ('1396', '1', 'admin', '请求访问主页', '95', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 11:39:20');
|
||||
INSERT INTO `sys_log` VALUES ('1397', '1', 'admin', '登录', '285', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:47:00');
|
||||
INSERT INTO `sys_log` VALUES ('1398', '1', 'admin', '请求访问主页', '90', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 11:47:00');
|
||||
INSERT INTO `sys_log` VALUES ('1399', '1', 'admin', '登录', '251', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 11:48:28');
|
||||
INSERT INTO `sys_log` VALUES ('1400', '1', 'admin', '请求访问主页', '95', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 11:48:28');
|
||||
INSERT INTO `sys_log` VALUES ('1401', '1', 'admin', '登录', '302', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 14:09:33');
|
||||
INSERT INTO `sys_log` VALUES ('1402', '1', 'admin', '请求访问主页', '88', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 14:09:34');
|
||||
INSERT INTO `sys_log` VALUES ('1403', '1', 'admin', '请求更改用户密码', '3', 'com.java2nb.system.controller.UserController.resetPwd()', null, '127.0.0.1', '2020-05-13 14:11:49');
|
||||
INSERT INTO `sys_log` VALUES ('1404', '1', 'admin', 'admin提交更改用户密码', '140', 'com.java2nb.system.controller.UserController.adminResetPwd()', null, '127.0.0.1', '2020-05-13 14:11:50');
|
||||
INSERT INTO `sys_log` VALUES ('1405', '1', 'admin', '请求更改用户密码', '4', 'com.java2nb.system.controller.UserController.resetPwd()', null, '127.0.0.1', '2020-05-13 14:12:11');
|
||||
INSERT INTO `sys_log` VALUES ('1406', '1', 'admin', '登录', '275', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 14:14:26');
|
||||
INSERT INTO `sys_log` VALUES ('1407', '1', 'admin', '请求访问主页', '73', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 14:14:27');
|
||||
INSERT INTO `sys_log` VALUES ('1408', '1', 'admin', 'error', null, 'http://127.0.0.1/novel/author/update', 'org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors\nField error in object \'authorDO\' on field \'id\': rejected value [1,1]; codes [typeMismatch.authorDO.id,typeMismatch.id,typeMismatch.java.lang.Long,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [authorDO.id,id]; arguments []; default message [id]]; default message [Failed to convert property value of type \'java.lang.String\' to required type \'java.lang.Long\' for property \'id\'; nested exception is java.lang.NumberFormatException: For input string: \"1,1\"]', null, '2020-05-13 14:14:38');
|
||||
INSERT INTO `sys_log` VALUES ('1409', '1', 'admin', 'error', null, 'http://127.0.0.1/novel/author/update', 'org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors\nField error in object \'authorDO\' on field \'id\': rejected value [1,1]; codes [typeMismatch.authorDO.id,typeMismatch.id,typeMismatch.java.lang.Long,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [authorDO.id,id]; arguments []; default message [id]]; default message [Failed to convert property value of type \'java.lang.String\' to required type \'java.lang.Long\' for property \'id\'; nested exception is java.lang.NumberFormatException: For input string: \"1,1\"]', null, '2020-05-13 14:14:47');
|
||||
INSERT INTO `sys_log` VALUES ('1410', '1', 'admin', '登录', '261', 'com.java2nb.system.controller.LoginController.ajaxLogin()', null, '127.0.0.1', '2020-05-13 14:18:07');
|
||||
INSERT INTO `sys_log` VALUES ('1411', '1', 'admin', '请求访问主页', '83', 'com.java2nb.system.controller.LoginController.index()', null, '127.0.0.1', '2020-05-13 14:18:07');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_menu
|
||||
@ -1047,9 +994,6 @@ CREATE TABLE `sys_role` (
|
||||
-- Records of sys_role
|
||||
-- ----------------------------
|
||||
INSERT INTO `sys_role` VALUES ('1', '超级用户角色', 'admin', '拥有最高权限', '2', '2017-08-12 00:43:52', '2017-08-12 19:14:59');
|
||||
INSERT INTO `sys_role` VALUES ('59', '普通用户', null, '基本用户权限', null, null, null);
|
||||
INSERT INTO `sys_role` VALUES ('60', '测试', null, '<div>', null, null, null);
|
||||
INSERT INTO `sys_role` VALUES ('61', 'test', null, '测试', null, null, null);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_role_data_perm
|
||||
@ -1497,19 +1441,7 @@ CREATE TABLE `sys_user` (
|
||||
-- ----------------------------
|
||||
-- Records of sys_user
|
||||
-- ----------------------------
|
||||
INSERT INTO `sys_user` VALUES ('1', 'admin', '超级管理员', 'd633268afedf209e1e4ea0f5f43228a8', '6', 'admin@example.com', '17699999999', '1', '1', '2017-08-15 21:40:39', '2017-08-15 21:41:00', '96', '2017-12-14 00:00:00', '148', 'ccc', '122;121;', '北京市', '北京市市辖区', '东城区');
|
||||
INSERT INTO `sys_user` VALUES ('2', 'test', '临时用户', 'd0af8fa1272ef5a152d9e27763eea293', '6', 'test@bootdo.com', null, '1', '1', '2017-08-14 13:43:05', '2017-08-14 21:15:36', null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('36', 'ldh', '刘德华', 'bfd9394475754fbe45866eba97738c36', '7', 'ldh@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('123', 'zxy', '张学友', '35174ba93f5fe7267f1fb3c1bf903781', '6', 'zxy@bootdo', null, '0', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('124', 'wyf', '吴亦凡', 'e179e6f687bbd57b9d7efc4746c8090a', '6', 'wyf@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('130', 'lh', '鹿晗', '7924710cd673f68967cde70e188bb097', '9', 'lh@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('131', 'lhc', '令狐冲', 'd515538e17ecb570ba40344b5618f5d4', '6', 'lhc@bootdo.com', null, '0', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('132', 'lyf', '刘亦菲', '7fdb1d9008f45950c1620ba0864e5fbd', '13', 'lyf@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('134', 'lyh', '李彦宏', 'dc26092b3244d9d432863f2738180e19', '8', 'lyh@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('135', 'wjl', '王健林', '3967697dfced162cf6a34080259b83aa', '6', 'wjl@bootod.com', null, '1', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('136', 'gdg', '郭德纲', '3bb1bda86bc02bf6478cd91e42135d2f', '9', 'gdg@bootdo.com', null, '1', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('137', 'test2', 'test2', '649169898e69272c0e5bc899baf1e904', null, '1179705413@qq.com', null, '1', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('138', 'test3', 'test3', '79ba2d0b58d8a2e94f6b18744c8cd280', '16', '1179705413@qq.com', null, '1', null, null, null, null, null, null, null, null, null, null, null);
|
||||
INSERT INTO `sys_user` VALUES ('1', 'admin', '超级管理员', 'd633268afedf209e1e4ea0f5f43228a8', '14', 'admin@example.com', '17699999999', '1', '1', '2017-08-15 21:40:39', '2017-08-15 21:41:00', '96', '2017-12-14 00:00:00', '148', 'ccc', '122;121;', '北京市', '北京市市辖区', '东城区');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_user_role
|
||||
@ -1869,4 +1801,46 @@ CREATE TABLE `author_income` (
|
||||
|
||||
alter table book add column `yesterday_buy` int(11) DEFAULT '0' COMMENT '昨日订阅数' after comment_count;
|
||||
|
||||
alter table book_index add column `book_price` int(3) DEFAULT 0 COMMENT '章节费用(屋币)' after `is_vip`;
|
||||
alter table book_index add column `book_price` int(3) DEFAULT 0 COMMENT '章节费用(屋币)' after `is_vip`;
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (246, 241, '批量删除', NULL, 'novel:news:batchRemove', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (245, 241, '删除', NULL, 'novel:news:remove', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (244, 241, '修改', NULL, 'novel:news:edit', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (243, 241, '新增', NULL, 'novel:news:add', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (242, 241, '查看', NULL, 'novel:news:detail', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (241, 234, '新闻列表', 'novel/news', 'novel:news:news', 1, 'fa', 8, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (240, 235, '批量删除', NULL, 'novel:category:batchRemove', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (239, 235, '删除', NULL, 'novel:category:remove', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (238, 235, '修改', NULL, 'novel:category:edit', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (237, 235, '新增', NULL, 'novel:category:add', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (236, 235, '查看', NULL, 'novel:category:detail', 2, NULL, 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (235, 234, '类别管理', 'novel/category', 'novel:category:category', 1, 'fa', 6, NULL, NULL);
|
||||
INSERT INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`, `gmt_create`, `gmt_modified`) VALUES (234, 0, '新闻管理', '', '', 0, 'fa fa-newspaper-o', 8, NULL, NULL);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4889, 1, 246);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4890, 1, 245);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4891, 1, 244);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4892, 1, 243);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4893, 1, 242);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4899, 1, 241);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4894, 1, 240);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4895, 1, 239);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4896, 1, 238);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4897, 1, 237);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4898, 1, 236);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4900, 1, 235);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4888, 1, 234);
|
||||
|
||||
|
||||
delete from sys_menu where menu_id = 202;
|
||||
|
||||
INSERT INTO crawl_source(`id`, `source_name`, `crawl_rule`, `source_status`, `create_time`, `update_time`) VALUES (16, 'i笔趣阁', '{\"bookListUrl\":\"http://m.ibiquge.net/xclass/{catId}/{page}.html\",\"catIdRule\":{\"catId1\":\"1\",\"catId2\":\"2\",\"catId3\":\"3\",\"catId4\":\"4\",\"catId5\":\"6\",\"catId6\":\"5\",\"catId7\":\"7\"},\"bookIdPatten\":\"href=\\\"/(\\\\d+_\\\\d+)/\\\"\",\"pagePatten\":\"value=\\\"(\\\\d+)/\\\\d+\\\"\",\"totalPagePatten\":\"value=\\\"\\\\d+/(\\\\d+)\\\"\",\"bookDetailUrl\":\"http://m.ibiquge.net/{bookId}/\",\"bookNamePatten\":\"<span class=\\\"title\\\">([^/]+)</span>\",\"authorNamePatten\":\"<a href=\\\"/author/\\\\d+/\\\">([^/]+)</a>\",\"picUrlPatten\":\"<img src=\\\"([^>]+)\\\"\\\\s+onerror=\\\"this.src=\",\"picUrlPrefix\":\"http://m.ibiquge.net\",\"statusPatten\":\">状态:([^/]+)</li>\",\"bookStatusRule\":{\"连载\":0,\"完结\":1},\"visitCountPatten\":\">点击:(\\\\d+)</li>\",\"descStart\":\"<p class=\\\"review\\\">\",\"descEnd\":\"</p>\",\"bookIndexUrl\":\"http://www.ibiquge.net/{bookId}/\",\"bookIndexStart\":\"正文</dt>\",\"indexIdPatten\":\"<a\\\\s+style=\\\"\\\"\\\\s+href=\\\"/\\\\d+_\\\\d+/(\\\\d+)\\\\.html\\\">[^/]+</a>\",\"indexNamePatten\":\"<a\\\\s+style=\\\"\\\"\\\\s+href=\\\"/\\\\d+_\\\\d+/\\\\d+\\\\.html\\\">([^/]+)</a>\",\"bookContentUrl\":\"http://www.ibiquge.net/{bookId}/{indexId}.html\",\"contentStart\":\"</p>\",\"contentEnd\":\"<div align=\\\"center\\\">\"}', 0, '2021-02-04 21:31:23', '2021-02-04 21:31:23');
|
||||
|
||||
alter table news add column `read_count` BIGINT NOT NULL DEFAULT '0' COMMENT '阅读量' after content;
|
||||
|
||||
|
||||
alter table book_index add column storage_type varchar(10) NOT NULL DEFAULT 'db' COMMENT '存储方式' after book_price ;
|
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.java2nb</groupId>
|
||||
<artifactId>novel-admin</artifactId>
|
||||
<version>2.10.0</version>
|
||||
<version>3.6.1</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>novel-admin</name>
|
||||
@ -106,7 +106,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-spring</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<version>1.7.0</version>
|
||||
</dependency>
|
||||
<!-- shiro ehcache -->
|
||||
<dependency>
|
||||
@ -224,29 +224,73 @@
|
||||
<!--<scope>provided</scope>-->
|
||||
<!--</dependency>-->
|
||||
</dependencies>
|
||||
<!-- <build>
|
||||
<plugins>
|
||||
<!–<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<executable>true</executable>
|
||||
</configuration>
|
||||
</plugin>–>
|
||||
<!–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>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>-->
|
||||
<build>
|
||||
<plugins>
|
||||
<!--<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<executable>true</executable>
|
||||
</configuration>
|
||||
</plugin>-->
|
||||
<!--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>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<!-- 文件夹 -->
|
||||
<copy todir="${project.build.directory}/build/config" overwrite="true">
|
||||
<fileset dir="${basedir}/src/main/build/config">
|
||||
<include name="*.*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy file="${project.build.directory}/${project.artifactId}-${project.version}.jar"
|
||||
tofile="${project.build.directory}/build/${project.artifactId}.jar"/>
|
||||
|
||||
<fixcrlf srcdir="${basedir}/src/main/build/scripts" eol="unix"/>
|
||||
<copy todir="${project.build.directory}/build/bin">
|
||||
<fileset dir="${basedir}/src/main/build/scripts">
|
||||
<include name="*.sh"/>
|
||||
<include name="*.txt"/>
|
||||
<include name="*.bat"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<zip destfile='${project.build.directory}/build/${project.artifactId}.zip'>
|
||||
<zipfileset filemode="755" dir='${project.build.directory}/build/'/>
|
||||
</zip>
|
||||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<!--<distributionManagement>
|
||||
|
10
novel-admin/src/main/build/config/application-prod.yml
Normal file
10
novel-admin/src/main/build/config/application-prod.yml
Normal file
@ -0,0 +1,10 @@
|
||||
#端口号
|
||||
server:
|
||||
port: 8088
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/novel_plus?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
|
||||
|
94
novel-admin/src/main/build/scripts/novel-admin.sh
Normal file
94
novel-admin/src/main/build/scripts/novel-admin.sh
Normal file
@ -0,0 +1,94 @@
|
||||
#!/bin/sh
|
||||
APP_NAME=novel-admin
|
||||
JAR_NAME=$APP_NAME\.jar
|
||||
#PID 代表是PID文件
|
||||
PID=$APP_NAME\.pid
|
||||
|
||||
|
||||
#使用说明,用来提示输入参数
|
||||
usage() {
|
||||
echo "Usage: ./novel-admin.sh [start|stop|restart|status]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
#检查程序是否在运行
|
||||
is_exist(){
|
||||
pid=`ps -ef|grep $JAR_NAME|grep -v grep|awk '{print $2}' `
|
||||
#如果不存在返回1,存在返回0
|
||||
if [ -z "${pid}" ]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
#启动方法
|
||||
start(){
|
||||
is_exist
|
||||
if [ $? -eq "0" ]; then
|
||||
echo ">>> 小说精品屋后台正在运行 PID = ${pid} <<<"
|
||||
else
|
||||
echo ">>> 小说精品屋后台开始启动 <<<"
|
||||
nohup java -jar -Dspring.profiles.active=prod $JAR_NAME >/dev/null 2>&1 &
|
||||
sleep 20
|
||||
echo $! > $PID
|
||||
echo ">>> 小说精品屋后台启动完成 PID = $! <<<"
|
||||
status
|
||||
fi
|
||||
}
|
||||
|
||||
#停止方法
|
||||
stop(){
|
||||
#is_exist
|
||||
pidf=$(cat $PID)
|
||||
#echo "$pidf"
|
||||
echo ">>> 小说精品屋后台 PID = $pidf 开始停止 <<<"
|
||||
kill $pidf
|
||||
rm -rf $PID
|
||||
sleep 2
|
||||
is_exist
|
||||
if [ $? -eq "0" ]; then
|
||||
echo ">>> 小说精品屋后台 PID = $pid 开始强制停止 <<<"
|
||||
kill -9 $pid
|
||||
sleep 2
|
||||
status
|
||||
else
|
||||
status
|
||||
fi
|
||||
}
|
||||
|
||||
#输出运行状态
|
||||
status(){
|
||||
is_exist
|
||||
if [ $? -eq "0" ]; then
|
||||
echo ">>> 小说精品屋后台正在运行 PID = ${pid} <<<"
|
||||
else
|
||||
echo ">>> 小说精品屋后台没有运行 <<<"
|
||||
fi
|
||||
}
|
||||
|
||||
#重启
|
||||
restart(){
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
#根据输入参数,选择执行对应方法,不输入则执行使用说明
|
||||
case "$1" in
|
||||
"start")
|
||||
start
|
||||
;;
|
||||
"stop")
|
||||
stop
|
||||
;;
|
||||
"status")
|
||||
status
|
||||
;;
|
||||
"restart")
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
exit 0
|
@ -1,25 +1,37 @@
|
||||
package com.java2nb;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
//关闭SpringSecurity的功能
|
||||
@EnableAutoConfiguration(exclude = {
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
import java.net.InetAddress;
|
||||
|
||||
|
||||
@EnableTransactionManagement
|
||||
@ServletComponentScan
|
||||
@MapperScan("com.java2nb.*.dao")
|
||||
@SpringBootApplication
|
||||
@SpringBootApplication(exclude = {
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
@EnableCaching
|
||||
@Slf4j
|
||||
public class AdminApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AdminApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
|
||||
return args -> {
|
||||
log.info("项目启动啦,访问路径:{}", "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + ctx.getEnvironment().getProperty("server.port"));
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -75,7 +75,6 @@ public class ShiroConfig {
|
||||
filterChainDefinitionMap.put("/img/**", "anon");
|
||||
filterChainDefinitionMap.put("/docs/**", "anon");
|
||||
filterChainDefinitionMap.put("/layuimini/**", "anon");
|
||||
filterChainDefinitionMap.put("/druid/**", "anon");
|
||||
filterChainDefinitionMap.put("/upload/**", "anon");
|
||||
filterChainDefinitionMap.put("/files/**", "anon");
|
||||
filterChainDefinitionMap.put("/logout", "logout");
|
||||
|
@ -14,7 +14,7 @@ public class XssAndSqlHttpServletRequestWrapper extends HttpServletRequestWrappe
|
||||
/**
|
||||
* 假如有有html 代码是自己传来的 需要设定对应的name 不过滤
|
||||
*/
|
||||
private static final List<String> noFilterNames = Arrays.asList("attach","push_ip");
|
||||
private static final List<String> noFilterNames = Arrays.asList("attach","push_ip","content");
|
||||
|
||||
public XssAndSqlHttpServletRequestWrapper(HttpServletRequest request) {
|
||||
super(request);
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
@ -1,19 +1,17 @@
|
||||
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 com.java2nb.novel.service.AuthorService;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
import com.java2nb.novel.service.PayService;
|
||||
import com.java2nb.novel.service.UserService;
|
||||
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 org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
@ -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);
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package com.java2nb.system.dao;
|
||||
package com.java2nb.novel.dao;
|
||||
|
||||
import com.java2nb.system.domain.UserDO;
|
||||
import com.java2nb.novel.domain.NewsDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -8,23 +8,23 @@ import java.util.Map;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
* 新闻表
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2020-12-01 03:46:33
|
||||
* @date 2020-12-01 10:05:51
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserDao {
|
||||
public interface NewsDao {
|
||||
|
||||
UserDO get(Long id);
|
||||
NewsDO get(Long id);
|
||||
|
||||
List<UserDO> list(Map<String,Object> map);
|
||||
List<NewsDO> list(Map<String,Object> map);
|
||||
|
||||
int count(Map<String,Object> map);
|
||||
|
||||
int save(UserDO user);
|
||||
int save(NewsDO news);
|
||||
|
||||
int update(UserDO user);
|
||||
int update(NewsDO news);
|
||||
|
||||
int remove(Long id);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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,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);
|
||||
}
|
||||
|
||||
}
|
@ -1,135 +0,0 @@
|
||||
package com.java2nb.test.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.test.domain.OrderDO;
|
||||
import com.java2nb.test.service.OrderService;
|
||||
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 2019-11-25 11:57:16
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/test/order")
|
||||
public class OrderController {
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
@GetMapping()
|
||||
@RequiresPermissions("test:order:order")
|
||||
String Order() {
|
||||
return "test/order/order";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取付呗-订单信息表列表", notes = "获取付呗-订单信息表列表")
|
||||
@ResponseBody
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("test:order:order")
|
||||
public R list(@RequestParam Map<String, Object> params) {
|
||||
//查询列表数据
|
||||
Query query = new Query(params);
|
||||
List<OrderDO> orderList = orderService.list(query);
|
||||
int total = orderService.count(query);
|
||||
PageBean pageBean = new PageBean(orderList, total);
|
||||
return R.ok().put("data", pageBean);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增付呗-订单信息表页面", notes = "新增付呗-订单信息表页面")
|
||||
@GetMapping("/add")
|
||||
@RequiresPermissions("test:order:add")
|
||||
String add() {
|
||||
return "test/order/add";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改付呗-订单信息表页面", notes = "修改付呗-订单信息表页面")
|
||||
@GetMapping("/edit/{id}")
|
||||
@RequiresPermissions("test:order:edit")
|
||||
String edit(@PathVariable("id") Long id, Model model) {
|
||||
OrderDO order = orderService.get(id);
|
||||
model.addAttribute("order", order);
|
||||
return "test/order/edit";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查看付呗-订单信息表页面", notes = "查看付呗-订单信息表页面")
|
||||
@GetMapping("/detail/{id}")
|
||||
@RequiresPermissions("test:order:detail")
|
||||
String detail(@PathVariable("id") Long id, Model model) {
|
||||
OrderDO order = orderService.get(id);
|
||||
model.addAttribute("order", order);
|
||||
return "test/order/detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@ApiOperation(value = "新增付呗-订单信息表", notes = "新增付呗-订单信息表")
|
||||
@ResponseBody
|
||||
@PostMapping("/save")
|
||||
@RequiresPermissions("test:order:add")
|
||||
public R save( OrderDO order) {
|
||||
if (orderService.save(order) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@ApiOperation(value = "修改付呗-订单信息表", notes = "修改付呗-订单信息表")
|
||||
@ResponseBody
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("test:order:edit")
|
||||
public R update( OrderDO order) {
|
||||
orderService.update(order);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "删除付呗-订单信息表", notes = "删除付呗-订单信息表")
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("test:order:remove")
|
||||
public R remove( Long id) {
|
||||
if (orderService.remove(id) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除付呗-订单信息表", notes = "批量删除付呗-订单信息表")
|
||||
@PostMapping("/batchRemove")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("test:order:batchRemove")
|
||||
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||
orderService.batchRemove(ids);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package com.java2nb.test.dao;
|
||||
|
||||
import com.java2nb.test.domain.OrderDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 付呗-订单信息表
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2019-11-25 11:57:16
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderDao {
|
||||
|
||||
OrderDO get(Long id);
|
||||
|
||||
List<OrderDO> list(Map<String,Object> map);
|
||||
|
||||
int count(Map<String,Object> map);
|
||||
|
||||
int save(OrderDO order);
|
||||
|
||||
int update(OrderDO order);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
}
|
@ -1,475 +0,0 @@
|
||||
package com.java2nb.test.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 2019-11-25 11:57:16
|
||||
*/
|
||||
public class OrderDO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
//主键
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long id;
|
||||
//付呗商户号
|
||||
private String fbMerchantCode;
|
||||
//第三方商户的订单号
|
||||
private String merchantOrderSn;
|
||||
//付呗订单号
|
||||
private String orderSn;
|
||||
//平台方订单号
|
||||
private String platformOrderNo;
|
||||
//商户单号
|
||||
private String tradeNo;
|
||||
//订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消
|
||||
private Integer orderState;
|
||||
//蜂鸟优惠卷抵扣
|
||||
private Double fnCoupon;
|
||||
//红包抵扣
|
||||
private BigDecimal redPacket;
|
||||
//实收金额(元)
|
||||
private BigDecimal totalFee;
|
||||
//订单金额
|
||||
private BigDecimal orderPrice;
|
||||
//手续费(元)
|
||||
private BigDecimal fee;
|
||||
//对商品或交易的描述
|
||||
private String body;
|
||||
//附加数据
|
||||
private String attach;
|
||||
//付呗系统的门店id
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long storeId;
|
||||
//付呗系统的收银员id
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long cashierId;
|
||||
//设备终端号
|
||||
private String deviceNo;
|
||||
//微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”
|
||||
private String userId;
|
||||
//支付宝顾客的账号
|
||||
private String userLogonId;
|
||||
//交易成功的时间
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date payTime;
|
||||
//支付通道:1微信、2支付宝、3银联
|
||||
private Integer payChannel;
|
||||
//免充值代金券金额(元)
|
||||
private BigDecimal noCashCouponFee;
|
||||
//预充值代金券金额(元)
|
||||
private BigDecimal cashCouponFee;
|
||||
//顾客实际支付金额(元)
|
||||
private BigDecimal cashFee;
|
||||
//签名
|
||||
private String sign;
|
||||
//其它选项
|
||||
private String options;
|
||||
//创建时间
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
//推送时间
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTime;
|
||||
//推送IP
|
||||
private String pushIp;
|
||||
//商户id
|
||||
private BigDecimal mchtId;
|
||||
//QR编号
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 设置:主键
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
/**
|
||||
* 获取:主键
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* 设置:付呗商户号
|
||||
*/
|
||||
public void setFbMerchantCode(String fbMerchantCode) {
|
||||
this.fbMerchantCode = fbMerchantCode;
|
||||
}
|
||||
/**
|
||||
* 获取:付呗商户号
|
||||
*/
|
||||
public String getFbMerchantCode() {
|
||||
return fbMerchantCode;
|
||||
}
|
||||
/**
|
||||
* 设置:第三方商户的订单号
|
||||
*/
|
||||
public void setMerchantOrderSn(String merchantOrderSn) {
|
||||
this.merchantOrderSn = merchantOrderSn;
|
||||
}
|
||||
/**
|
||||
* 获取:第三方商户的订单号
|
||||
*/
|
||||
public String getMerchantOrderSn() {
|
||||
return merchantOrderSn;
|
||||
}
|
||||
/**
|
||||
* 设置:付呗订单号
|
||||
*/
|
||||
public void setOrderSn(String orderSn) {
|
||||
this.orderSn = orderSn;
|
||||
}
|
||||
/**
|
||||
* 获取:付呗订单号
|
||||
*/
|
||||
public String getOrderSn() {
|
||||
return orderSn;
|
||||
}
|
||||
/**
|
||||
* 设置:平台方订单号
|
||||
*/
|
||||
public void setPlatformOrderNo(String platformOrderNo) {
|
||||
this.platformOrderNo = platformOrderNo;
|
||||
}
|
||||
/**
|
||||
* 获取:平台方订单号
|
||||
*/
|
||||
public String getPlatformOrderNo() {
|
||||
return platformOrderNo;
|
||||
}
|
||||
/**
|
||||
* 设置:商户单号
|
||||
*/
|
||||
public void setTradeNo(String tradeNo) {
|
||||
this.tradeNo = tradeNo;
|
||||
}
|
||||
/**
|
||||
* 获取:商户单号
|
||||
*/
|
||||
public String getTradeNo() {
|
||||
return tradeNo;
|
||||
}
|
||||
/**
|
||||
* 设置:订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消
|
||||
*/
|
||||
public void setOrderState(Integer orderState) {
|
||||
this.orderState = orderState;
|
||||
}
|
||||
/**
|
||||
* 获取:订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消
|
||||
*/
|
||||
public Integer getOrderState() {
|
||||
return orderState;
|
||||
}
|
||||
/**
|
||||
* 设置:蜂鸟优惠卷抵扣
|
||||
*/
|
||||
public void setFnCoupon(Double fnCoupon) {
|
||||
this.fnCoupon = fnCoupon;
|
||||
}
|
||||
/**
|
||||
* 获取:蜂鸟优惠卷抵扣
|
||||
*/
|
||||
public Double getFnCoupon() {
|
||||
return fnCoupon;
|
||||
}
|
||||
/**
|
||||
* 设置:红包抵扣
|
||||
*/
|
||||
public void setRedPacket(BigDecimal redPacket) {
|
||||
this.redPacket = redPacket;
|
||||
}
|
||||
/**
|
||||
* 获取:红包抵扣
|
||||
*/
|
||||
public BigDecimal getRedPacket() {
|
||||
return redPacket;
|
||||
}
|
||||
/**
|
||||
* 设置:实收金额(元)
|
||||
*/
|
||||
public void setTotalFee(BigDecimal totalFee) {
|
||||
this.totalFee = totalFee;
|
||||
}
|
||||
/**
|
||||
* 获取:实收金额(元)
|
||||
*/
|
||||
public BigDecimal getTotalFee() {
|
||||
return totalFee;
|
||||
}
|
||||
/**
|
||||
* 设置:订单金额
|
||||
*/
|
||||
public void setOrderPrice(BigDecimal orderPrice) {
|
||||
this.orderPrice = orderPrice;
|
||||
}
|
||||
/**
|
||||
* 获取:订单金额
|
||||
*/
|
||||
public BigDecimal getOrderPrice() {
|
||||
return orderPrice;
|
||||
}
|
||||
/**
|
||||
* 设置:手续费(元)
|
||||
*/
|
||||
public void setFee(BigDecimal fee) {
|
||||
this.fee = fee;
|
||||
}
|
||||
/**
|
||||
* 获取:手续费(元)
|
||||
*/
|
||||
public BigDecimal getFee() {
|
||||
return fee;
|
||||
}
|
||||
/**
|
||||
* 设置:对商品或交易的描述
|
||||
*/
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
/**
|
||||
* 获取:对商品或交易的描述
|
||||
*/
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
/**
|
||||
* 设置:附加数据
|
||||
*/
|
||||
public void setAttach(String attach) {
|
||||
this.attach = attach;
|
||||
}
|
||||
/**
|
||||
* 获取:附加数据
|
||||
*/
|
||||
public String getAttach() {
|
||||
return attach;
|
||||
}
|
||||
/**
|
||||
* 设置:付呗系统的门店id
|
||||
*/
|
||||
public void setStoreId(Long storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
/**
|
||||
* 获取:付呗系统的门店id
|
||||
*/
|
||||
public Long getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
/**
|
||||
* 设置:付呗系统的收银员id
|
||||
*/
|
||||
public void setCashierId(Long cashierId) {
|
||||
this.cashierId = cashierId;
|
||||
}
|
||||
/**
|
||||
* 获取:付呗系统的收银员id
|
||||
*/
|
||||
public Long getCashierId() {
|
||||
return cashierId;
|
||||
}
|
||||
/**
|
||||
* 设置:设备终端号
|
||||
*/
|
||||
public void setDeviceNo(String deviceNo) {
|
||||
this.deviceNo = deviceNo;
|
||||
}
|
||||
/**
|
||||
* 获取:设备终端号
|
||||
*/
|
||||
public String getDeviceNo() {
|
||||
return deviceNo;
|
||||
}
|
||||
/**
|
||||
* 设置:微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”
|
||||
*/
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
/**
|
||||
* 获取:微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”
|
||||
*/
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
/**
|
||||
* 设置:支付宝顾客的账号
|
||||
*/
|
||||
public void setUserLogonId(String userLogonId) {
|
||||
this.userLogonId = userLogonId;
|
||||
}
|
||||
/**
|
||||
* 获取:支付宝顾客的账号
|
||||
*/
|
||||
public String getUserLogonId() {
|
||||
return userLogonId;
|
||||
}
|
||||
/**
|
||||
* 设置:交易成功的时间
|
||||
*/
|
||||
public void setPayTime(Date payTime) {
|
||||
this.payTime = payTime;
|
||||
}
|
||||
/**
|
||||
* 获取:交易成功的时间
|
||||
*/
|
||||
public Date getPayTime() {
|
||||
return payTime;
|
||||
}
|
||||
/**
|
||||
* 设置:支付通道:1微信、2支付宝、3银联
|
||||
*/
|
||||
public void setPayChannel(Integer payChannel) {
|
||||
this.payChannel = payChannel;
|
||||
}
|
||||
/**
|
||||
* 获取:支付通道:1微信、2支付宝、3银联
|
||||
*/
|
||||
public Integer getPayChannel() {
|
||||
return payChannel;
|
||||
}
|
||||
/**
|
||||
* 设置:免充值代金券金额(元)
|
||||
*/
|
||||
public void setNoCashCouponFee(BigDecimal noCashCouponFee) {
|
||||
this.noCashCouponFee = noCashCouponFee;
|
||||
}
|
||||
/**
|
||||
* 获取:免充值代金券金额(元)
|
||||
*/
|
||||
public BigDecimal getNoCashCouponFee() {
|
||||
return noCashCouponFee;
|
||||
}
|
||||
/**
|
||||
* 设置:预充值代金券金额(元)
|
||||
*/
|
||||
public void setCashCouponFee(BigDecimal cashCouponFee) {
|
||||
this.cashCouponFee = cashCouponFee;
|
||||
}
|
||||
/**
|
||||
* 获取:预充值代金券金额(元)
|
||||
*/
|
||||
public BigDecimal getCashCouponFee() {
|
||||
return cashCouponFee;
|
||||
}
|
||||
/**
|
||||
* 设置:顾客实际支付金额(元)
|
||||
*/
|
||||
public void setCashFee(BigDecimal cashFee) {
|
||||
this.cashFee = cashFee;
|
||||
}
|
||||
/**
|
||||
* 获取:顾客实际支付金额(元)
|
||||
*/
|
||||
public BigDecimal getCashFee() {
|
||||
return cashFee;
|
||||
}
|
||||
/**
|
||||
* 设置:签名
|
||||
*/
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
/**
|
||||
* 获取:签名
|
||||
*/
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
/**
|
||||
* 设置:其它选项
|
||||
*/
|
||||
public void setOptions(String options) {
|
||||
this.options = options;
|
||||
}
|
||||
/**
|
||||
* 获取:其它选项
|
||||
*/
|
||||
public String getOptions() {
|
||||
return options;
|
||||
}
|
||||
/**
|
||||
* 设置:创建时间
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
/**
|
||||
* 获取:创建时间
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
/**
|
||||
* 设置:推送时间
|
||||
*/
|
||||
public void setPushTime(Date pushTime) {
|
||||
this.pushTime = pushTime;
|
||||
}
|
||||
/**
|
||||
* 获取:推送时间
|
||||
*/
|
||||
public Date getPushTime() {
|
||||
return pushTime;
|
||||
}
|
||||
/**
|
||||
* 设置:推送IP
|
||||
*/
|
||||
public void setPushIp(String pushIp) {
|
||||
this.pushIp = pushIp;
|
||||
}
|
||||
/**
|
||||
* 获取:推送IP
|
||||
*/
|
||||
public String getPushIp() {
|
||||
return pushIp;
|
||||
}
|
||||
/**
|
||||
* 设置:商户id
|
||||
*/
|
||||
public void setMchtId(BigDecimal mchtId) {
|
||||
this.mchtId = mchtId;
|
||||
}
|
||||
/**
|
||||
* 获取:商户id
|
||||
*/
|
||||
public BigDecimal getMchtId() {
|
||||
return mchtId;
|
||||
}
|
||||
/**
|
||||
* 设置:QR编号
|
||||
*/
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
/**
|
||||
* 获取:QR编号
|
||||
*/
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package com.java2nb.test.service;
|
||||
|
||||
import com.java2nb.test.domain.OrderDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 付呗-订单信息表
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2019-11-25 11:57:16
|
||||
*/
|
||||
public interface OrderService {
|
||||
|
||||
OrderDO get(Long id);
|
||||
|
||||
List<OrderDO> list(Map<String, Object> map);
|
||||
|
||||
int count(Map<String, Object> map);
|
||||
|
||||
int save(OrderDO order);
|
||||
|
||||
int update(OrderDO order);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
package com.java2nb.test.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.test.dao.OrderDao;
|
||||
import com.java2nb.test.domain.OrderDO;
|
||||
import com.java2nb.test.service.OrderService;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class OrderServiceImpl implements OrderService {
|
||||
@Autowired
|
||||
private OrderDao orderDao;
|
||||
|
||||
@Override
|
||||
public OrderDO get(Long id){
|
||||
return orderDao.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderDO> list(Map<String, Object> map){
|
||||
return orderDao.list(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int count(Map<String, Object> map){
|
||||
return orderDao.count(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(OrderDO order){
|
||||
return orderDao.save(order);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(OrderDO order){
|
||||
return orderDao.update(order);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remove(Long id){
|
||||
return orderDao.remove(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchRemove(Long[] ids){
|
||||
return orderDao.batchRemove(ids);
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
java2nb:
|
||||
uploadPath: c:/var/java2nb/uploaded_files/
|
||||
uploadPath: /var/pic/
|
||||
username: admin
|
||||
password: 111111
|
||||
logging:
|
||||
@ -9,8 +9,8 @@ logging:
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/novel_plus?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: test123456
|
||||
#password:
|
||||
|
@ -1,16 +1,19 @@
|
||||
java2nb:
|
||||
uploadPath: /var/java2nb/uploaded_files/
|
||||
uploadPath: /var/pic/
|
||||
username: admin
|
||||
password: 111111
|
||||
logging:
|
||||
level:
|
||||
root: error
|
||||
com.java2nb: info
|
||||
com.java2nb: error
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/java2nb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: java2nb
|
||||
password: java2nb1019
|
||||
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: test123456
|
||||
#password:
|
||||
initialSize: 1
|
||||
minIdle: 3
|
||||
maxActive: 20
|
||||
@ -34,18 +37,18 @@ spring:
|
||||
# 合并多个DruidDataSource的监控数据
|
||||
#useGlobalDataSourceStat: true
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password:
|
||||
# 连接超时时间(毫秒)
|
||||
timeout: 10000
|
||||
jedis:
|
||||
pool:
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 10
|
||||
# 连接池最大连接数(使用负值表示没有限制)
|
||||
max-active: 100
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: test
|
||||
# 连接超时时间(毫秒)
|
||||
timeout: 10000
|
||||
jedis:
|
||||
pool:
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 10
|
||||
# 连接池最大连接数(使用负值表示没有限制)
|
||||
max-active: 100
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1
|
@ -36,3 +36,7 @@ mybatis:
|
||||
typeAliasesPackage: com.java2nb.**.domain
|
||||
#[弃用]配置缓存和session存储方式,默认ehcache,可选redis,[弃用]调整至 spring cache type【shiro.用户,权限,session,spring.cache通用】
|
||||
#[弃用]cacheType: ehcache
|
||||
|
||||
|
||||
logging:
|
||||
config: classpath:logback-boot.xml
|
||||
|
@ -1,6 +1,15 @@
|
||||
__ ________ ___.
|
||||
|__|____ ___ _______ \_____ \ ____\_ |__
|
||||
| \__ \\ \/ /\__ \ / ____/ / \| __ \
|
||||
| |/ __ \\ / / __ \_/ \| | \ \_\ \
|
||||
/\__| (____ /\_/ (____ /\_______ \___| /___ /
|
||||
\______| \/ \/ \/ \/ \/
|
||||
${AnsiColor.CYAN}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
${AnsiColor.RED}
|
||||
|| / | / /
|
||||
|| / | / / ___ // ___ ___ _ __
|
||||
|| / /||/ / //___) ) // // ) ) // ) ) // ) ) ) )
|
||||
||/ / | / // // // // / / // / / / /
|
||||
| / | / ((____ // ((____ ((___/ / // / / / / 小说精品屋欢迎您!!!
|
||||
|
||||
-------Powered By XXY
|
||||
${AnsiColor.CYAN}
|
||||
--------------------------------------------------------------------------------
|
||||
${AnsiColor.BRIGHT_YELLOW}
|
||||
::: Spring-Boot ${spring-boot.formatted-version} :::
|
@ -24,7 +24,7 @@
|
||||
<!-- RollingFileAppender:滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 -->
|
||||
<!-- 以下的大概意思是:1.先按日期存日志,日期变了,将前一天的日志文件名重命名为XXX%日期%索引,新的日志仍然是demo.log -->
|
||||
<!-- 2.如果日期没有发生变化,但是当前日志的文件大小超过1KB时,对当前日志进行分割 重命名 -->
|
||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<File>logs/debug.log</File>
|
||||
<!-- rollingPolicy:当发生滚动时,决定 RollingFileAppender 的行为,涉及文件移动和重命名。 -->
|
||||
@ -52,11 +52,13 @@
|
||||
<!-- 控制台输出日志级别 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
<appender-ref ref="FILE" />
|
||||
</root>
|
||||
<!-- 指定项目中某个包,当有日志操作行为时的日志记录级别 -->
|
||||
<!-- com.maijinjie.springboot 为根包,也就是只要是发生在这个根包下面的所有日志操作行为的权限都是DEBUG -->
|
||||
<!-- 级别依次为【从高到低】:FATAL > ERROR > WARN > INFO > DEBUG > TRACE -->
|
||||
<logger name="com.java2nb" level="DEBUG">
|
||||
<appender-ref ref="debug" />
|
||||
<logger name="com.java2nb" level="DEBUG" additivity="false">
|
||||
<appender-ref ref="STDOUT" />
|
||||
<appender-ref ref="FILE" />
|
||||
</logger>
|
||||
</configuration>
|
@ -138,7 +138,7 @@
|
||||
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
||||
COUNT( 1 ) authorCount
|
||||
FROM
|
||||
AUTHOR
|
||||
author
|
||||
WHERE
|
||||
create_time >= #{minDate}
|
||||
GROUP BY
|
||||
|
@ -294,7 +294,7 @@
|
||||
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
||||
COUNT( 1 ) bookCount
|
||||
FROM
|
||||
BOOK
|
||||
book
|
||||
WHERE
|
||||
create_time >= #{minDate}
|
||||
GROUP BY
|
||||
|
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>
|
@ -142,7 +142,7 @@
|
||||
DATE_FORMAT( create_time, "%Y-%m-%d" ) AS staDate,
|
||||
COUNT( 1 ) userCount
|
||||
FROM
|
||||
USER
|
||||
user
|
||||
WHERE
|
||||
create_time >= #{minDate}
|
||||
GROUP BY
|
||||
|
@ -1,283 +0,0 @@
|
||||
<?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.test.dao.OrderDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.test.domain.OrderDO">
|
||||
select `id`,`fb_merchant_code`,`merchant_order_sn`,`order_sn`,`platform_order_no`,`trade_no`,`order_state`,`fn_coupon`,`red_packet`,`total_fee`,`order_price`,`fee`,`body`,`attach`,`store_id`,`cashier_id`,`device_no`,`user_id`,`user_logon_id`,`pay_time`,`pay_channel`,`no_cash_coupon_fee`,`cash_coupon_fee`,`cash_fee`,`sign`,`options`,`create_time`,`push_time`,`push_ip`,`mcht_id`,`sn` from fb_order where id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.java2nb.test.domain.OrderDO">
|
||||
select `id`,`fb_merchant_code`,`merchant_order_sn`,`order_sn`,`platform_order_no`,`trade_no`,`order_state`,`fn_coupon`,`red_packet`,`total_fee`,`order_price`,`fee`,`body`,`attach`,`store_id`,`cashier_id`,`device_no`,`user_id`,`user_logon_id`,`pay_time`,`pay_channel`,`no_cash_coupon_fee`,`cash_coupon_fee`,`cash_fee`,`sign`,`options`,`create_time`,`push_time`,`push_ip`,`mcht_id`,`sn` from fb_order
|
||||
<where>
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="fbMerchantCode != null and fbMerchantCode != ''"> and fb_merchant_code = #{fbMerchantCode} </if>
|
||||
<if test="merchantOrderSn != null and merchantOrderSn != ''"> and merchant_order_sn = #{merchantOrderSn} </if>
|
||||
<if test="orderSn != null and orderSn != ''"> and order_sn = #{orderSn} </if>
|
||||
<if test="platformOrderNo != null and platformOrderNo != ''"> and platform_order_no = #{platformOrderNo} </if>
|
||||
<if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo} </if>
|
||||
<if test="orderState != null and orderState != ''"> and order_state = #{orderState} </if>
|
||||
<if test="fnCoupon != null and fnCoupon != ''"> and fn_coupon = #{fnCoupon} </if>
|
||||
<if test="redPacket != null and redPacket != ''"> and red_packet = #{redPacket} </if>
|
||||
<if test="totalFee != null and totalFee != ''"> and total_fee = #{totalFee} </if>
|
||||
<if test="orderPrice != null and orderPrice != ''"> and order_price = #{orderPrice} </if>
|
||||
<if test="fee != null and fee != ''"> and fee = #{fee} </if>
|
||||
<if test="body != null and body != ''"> and body = #{body} </if>
|
||||
<if test="attach != null and attach != ''"> and attach = #{attach} </if>
|
||||
<if test="storeId != null and storeId != ''"> and store_id = #{storeId} </if>
|
||||
<if test="cashierId != null and cashierId != ''"> and cashier_id = #{cashierId} </if>
|
||||
<if test="deviceNo != null and deviceNo != ''"> and device_no = #{deviceNo} </if>
|
||||
<if test="userId != null and userId != ''"> and user_id = #{userId} </if>
|
||||
<if test="userLogonId != null and userLogonId != ''"> and user_logon_id = #{userLogonId} </if>
|
||||
<if test="payTime != null and payTime != ''"> and pay_time = #{payTime} </if>
|
||||
<if test="payChannel != null and payChannel != ''"> and pay_channel = #{payChannel} </if>
|
||||
<if test="noCashCouponFee != null and noCashCouponFee != ''"> and no_cash_coupon_fee = #{noCashCouponFee} </if>
|
||||
<if test="cashCouponFee != null and cashCouponFee != ''"> and cash_coupon_fee = #{cashCouponFee} </if>
|
||||
<if test="cashFee != null and cashFee != ''"> and cash_fee = #{cashFee} </if>
|
||||
<if test="sign != null and sign != ''"> and sign = #{sign} </if>
|
||||
<if test="options != null and options != ''"> and options = #{options} </if>
|
||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||
<if test="pushTime != null and pushTime != ''"> and push_time = #{pushTime} </if>
|
||||
<if test="pushIp != null and pushIp != ''"> and push_ip = #{pushIp} </if>
|
||||
<if test="mchtId != null and mchtId != ''"> and mcht_id = #{mchtId} </if>
|
||||
<if test="sn != null and sn != ''"> and sn = #{sn} </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 fb_order
|
||||
<where>
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="fbMerchantCode != null and fbMerchantCode != ''"> and fb_merchant_code = #{fbMerchantCode} </if>
|
||||
<if test="merchantOrderSn != null and merchantOrderSn != ''"> and merchant_order_sn = #{merchantOrderSn} </if>
|
||||
<if test="orderSn != null and orderSn != ''"> and order_sn = #{orderSn} </if>
|
||||
<if test="platformOrderNo != null and platformOrderNo != ''"> and platform_order_no = #{platformOrderNo} </if>
|
||||
<if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo} </if>
|
||||
<if test="orderState != null and orderState != ''"> and order_state = #{orderState} </if>
|
||||
<if test="fnCoupon != null and fnCoupon != ''"> and fn_coupon = #{fnCoupon} </if>
|
||||
<if test="redPacket != null and redPacket != ''"> and red_packet = #{redPacket} </if>
|
||||
<if test="totalFee != null and totalFee != ''"> and total_fee = #{totalFee} </if>
|
||||
<if test="orderPrice != null and orderPrice != ''"> and order_price = #{orderPrice} </if>
|
||||
<if test="fee != null and fee != ''"> and fee = #{fee} </if>
|
||||
<if test="body != null and body != ''"> and body = #{body} </if>
|
||||
<if test="attach != null and attach != ''"> and attach = #{attach} </if>
|
||||
<if test="storeId != null and storeId != ''"> and store_id = #{storeId} </if>
|
||||
<if test="cashierId != null and cashierId != ''"> and cashier_id = #{cashierId} </if>
|
||||
<if test="deviceNo != null and deviceNo != ''"> and device_no = #{deviceNo} </if>
|
||||
<if test="userId != null and userId != ''"> and user_id = #{userId} </if>
|
||||
<if test="userLogonId != null and userLogonId != ''"> and user_logon_id = #{userLogonId} </if>
|
||||
<if test="payTime != null and payTime != ''"> and pay_time = #{payTime} </if>
|
||||
<if test="payChannel != null and payChannel != ''"> and pay_channel = #{payChannel} </if>
|
||||
<if test="noCashCouponFee != null and noCashCouponFee != ''"> and no_cash_coupon_fee = #{noCashCouponFee} </if>
|
||||
<if test="cashCouponFee != null and cashCouponFee != ''"> and cash_coupon_fee = #{cashCouponFee} </if>
|
||||
<if test="cashFee != null and cashFee != ''"> and cash_fee = #{cashFee} </if>
|
||||
<if test="sign != null and sign != ''"> and sign = #{sign} </if>
|
||||
<if test="options != null and options != ''"> and options = #{options} </if>
|
||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||
<if test="pushTime != null and pushTime != ''"> and push_time = #{pushTime} </if>
|
||||
<if test="pushIp != null and pushIp != ''"> and push_ip = #{pushIp} </if>
|
||||
<if test="mchtId != null and mchtId != ''"> and mcht_id = #{mchtId} </if>
|
||||
<if test="sn != null and sn != ''"> and sn = #{sn} </if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.test.domain.OrderDO" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into fb_order
|
||||
(
|
||||
`fb_merchant_code`,
|
||||
`merchant_order_sn`,
|
||||
`order_sn`,
|
||||
`platform_order_no`,
|
||||
`trade_no`,
|
||||
`order_state`,
|
||||
`fn_coupon`,
|
||||
`red_packet`,
|
||||
`total_fee`,
|
||||
`order_price`,
|
||||
`fee`,
|
||||
`body`,
|
||||
`attach`,
|
||||
`store_id`,
|
||||
`cashier_id`,
|
||||
`device_no`,
|
||||
`user_id`,
|
||||
`user_logon_id`,
|
||||
`pay_time`,
|
||||
`pay_channel`,
|
||||
`no_cash_coupon_fee`,
|
||||
`cash_coupon_fee`,
|
||||
`cash_fee`,
|
||||
`sign`,
|
||||
`options`,
|
||||
`create_time`,
|
||||
`push_time`,
|
||||
`push_ip`,
|
||||
`mcht_id`,
|
||||
`sn`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{fbMerchantCode},
|
||||
#{merchantOrderSn},
|
||||
#{orderSn},
|
||||
#{platformOrderNo},
|
||||
#{tradeNo},
|
||||
#{orderState},
|
||||
#{fnCoupon},
|
||||
#{redPacket},
|
||||
#{totalFee},
|
||||
#{orderPrice},
|
||||
#{fee},
|
||||
#{body},
|
||||
#{attach},
|
||||
#{storeId},
|
||||
#{cashierId},
|
||||
#{deviceNo},
|
||||
#{userId},
|
||||
#{userLogonId},
|
||||
#{payTime},
|
||||
#{payChannel},
|
||||
#{noCashCouponFee},
|
||||
#{cashCouponFee},
|
||||
#{cashFee},
|
||||
#{sign},
|
||||
#{options},
|
||||
#{createTime},
|
||||
#{pushTime},
|
||||
#{pushIp},
|
||||
#{mchtId},
|
||||
#{sn}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="saveSelective" parameterType="com.java2nb.test.domain.OrderDO" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into fb_order
|
||||
(
|
||||
<if test="id != null"> `id`, </if>
|
||||
<if test="fbMerchantCode != null"> `fb_merchant_code`, </if>
|
||||
<if test="merchantOrderSn != null"> `merchant_order_sn`, </if>
|
||||
<if test="orderSn != null"> `order_sn`, </if>
|
||||
<if test="platformOrderNo != null"> `platform_order_no`, </if>
|
||||
<if test="tradeNo != null"> `trade_no`, </if>
|
||||
<if test="orderState != null"> `order_state`, </if>
|
||||
<if test="fnCoupon != null"> `fn_coupon`, </if>
|
||||
<if test="redPacket != null"> `red_packet`, </if>
|
||||
<if test="totalFee != null"> `total_fee`, </if>
|
||||
<if test="orderPrice != null"> `order_price`, </if>
|
||||
<if test="fee != null"> `fee`, </if>
|
||||
<if test="body != null"> `body`, </if>
|
||||
<if test="attach != null"> `attach`, </if>
|
||||
<if test="storeId != null"> `store_id`, </if>
|
||||
<if test="cashierId != null"> `cashier_id`, </if>
|
||||
<if test="deviceNo != null"> `device_no`, </if>
|
||||
<if test="userId != null"> `user_id`, </if>
|
||||
<if test="userLogonId != null"> `user_logon_id`, </if>
|
||||
<if test="payTime != null"> `pay_time`, </if>
|
||||
<if test="payChannel != null"> `pay_channel`, </if>
|
||||
<if test="noCashCouponFee != null"> `no_cash_coupon_fee`, </if>
|
||||
<if test="cashCouponFee != null"> `cash_coupon_fee`, </if>
|
||||
<if test="cashFee != null"> `cash_fee`, </if>
|
||||
<if test="sign != null"> `sign`, </if>
|
||||
<if test="options != null"> `options`, </if>
|
||||
<if test="createTime != null"> `create_time`, </if>
|
||||
<if test="pushTime != null"> `push_time`, </if>
|
||||
<if test="pushIp != null"> `push_ip`, </if>
|
||||
<if test="mchtId != null"> `mcht_id`, </if>
|
||||
<if test="sn != null"> `sn` </if>
|
||||
)
|
||||
values
|
||||
(
|
||||
<if test="id != null"> #{id}, </if>
|
||||
<if test="fbMerchantCode != null"> #{fbMerchantCode}, </if>
|
||||
<if test="merchantOrderSn != null"> #{merchantOrderSn}, </if>
|
||||
<if test="orderSn != null"> #{orderSn}, </if>
|
||||
<if test="platformOrderNo != null"> #{platformOrderNo}, </if>
|
||||
<if test="tradeNo != null"> #{tradeNo}, </if>
|
||||
<if test="orderState != null"> #{orderState}, </if>
|
||||
<if test="fnCoupon != null"> #{fnCoupon}, </if>
|
||||
<if test="redPacket != null"> #{redPacket}, </if>
|
||||
<if test="totalFee != null"> #{totalFee}, </if>
|
||||
<if test="orderPrice != null"> #{orderPrice}, </if>
|
||||
<if test="fee != null"> #{fee}, </if>
|
||||
<if test="body != null"> #{body}, </if>
|
||||
<if test="attach != null"> #{attach}, </if>
|
||||
<if test="storeId != null"> #{storeId}, </if>
|
||||
<if test="cashierId != null"> #{cashierId}, </if>
|
||||
<if test="deviceNo != null"> #{deviceNo}, </if>
|
||||
<if test="userId != null"> #{userId}, </if>
|
||||
<if test="userLogonId != null"> #{userLogonId}, </if>
|
||||
<if test="payTime != null"> #{payTime}, </if>
|
||||
<if test="payChannel != null"> #{payChannel}, </if>
|
||||
<if test="noCashCouponFee != null"> #{noCashCouponFee}, </if>
|
||||
<if test="cashCouponFee != null"> #{cashCouponFee}, </if>
|
||||
<if test="cashFee != null"> #{cashFee}, </if>
|
||||
<if test="sign != null"> #{sign}, </if>
|
||||
<if test="options != null"> #{options}, </if>
|
||||
<if test="createTime != null"> #{createTime}, </if>
|
||||
<if test="pushTime != null"> #{pushTime}, </if>
|
||||
<if test="pushIp != null"> #{pushIp}, </if>
|
||||
<if test="mchtId != null"> #{mchtId}, </if>
|
||||
<if test="sn != null"> #{sn} </if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.test.domain.OrderDO">
|
||||
update fb_order
|
||||
<set>
|
||||
<if test="fbMerchantCode != null">`fb_merchant_code` = #{fbMerchantCode}, </if>
|
||||
<if test="merchantOrderSn != null">`merchant_order_sn` = #{merchantOrderSn}, </if>
|
||||
<if test="orderSn != null">`order_sn` = #{orderSn}, </if>
|
||||
<if test="platformOrderNo != null">`platform_order_no` = #{platformOrderNo}, </if>
|
||||
<if test="tradeNo != null">`trade_no` = #{tradeNo}, </if>
|
||||
<if test="orderState != null">`order_state` = #{orderState}, </if>
|
||||
<if test="fnCoupon != null">`fn_coupon` = #{fnCoupon}, </if>
|
||||
<if test="redPacket != null">`red_packet` = #{redPacket}, </if>
|
||||
<if test="totalFee != null">`total_fee` = #{totalFee}, </if>
|
||||
<if test="orderPrice != null">`order_price` = #{orderPrice}, </if>
|
||||
<if test="fee != null">`fee` = #{fee}, </if>
|
||||
<if test="body != null">`body` = #{body}, </if>
|
||||
<if test="attach != null">`attach` = #{attach}, </if>
|
||||
<if test="storeId != null">`store_id` = #{storeId}, </if>
|
||||
<if test="cashierId != null">`cashier_id` = #{cashierId}, </if>
|
||||
<if test="deviceNo != null">`device_no` = #{deviceNo}, </if>
|
||||
<if test="userId != null">`user_id` = #{userId}, </if>
|
||||
<if test="userLogonId != null">`user_logon_id` = #{userLogonId}, </if>
|
||||
<if test="payTime != null">`pay_time` = #{payTime}, </if>
|
||||
<if test="payChannel != null">`pay_channel` = #{payChannel}, </if>
|
||||
<if test="noCashCouponFee != null">`no_cash_coupon_fee` = #{noCashCouponFee}, </if>
|
||||
<if test="cashCouponFee != null">`cash_coupon_fee` = #{cashCouponFee}, </if>
|
||||
<if test="cashFee != null">`cash_fee` = #{cashFee}, </if>
|
||||
<if test="sign != null">`sign` = #{sign}, </if>
|
||||
<if test="options != null">`options` = #{options}, </if>
|
||||
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||
<if test="pushTime != null">`push_time` = #{pushTime}, </if>
|
||||
<if test="pushIp != null">`push_ip` = #{pushIp}, </if>
|
||||
<if test="mchtId != null">`mcht_id` = #{mchtId}, </if>
|
||||
<if test="sn != null">`sn` = #{sn}</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="remove">
|
||||
delete from fb_order where id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from fb_order where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -74,7 +74,7 @@ function save() {
|
||||
$.ajax({
|
||||
cache: true,
|
||||
type: "POST",
|
||||
url: "/system/user/save",
|
||||
url: "/novel/category/save",
|
||||
data: $('#signupForm').serialize(),// 你的formid
|
||||
async: false,
|
||||
error: function (request) {
|
||||
@ -100,8 +100,12 @@ function validateRule() {
|
||||
$("#signupForm").validate({
|
||||
ignore: "",
|
||||
rules: {
|
||||
},
|
||||
name: {
|
||||
required: true
|
||||
}, },
|
||||
messages: {
|
||||
}
|
||||
name: {
|
||||
required: icon + "请选择分类名"
|
||||
}, }
|
||||
})
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
var prefix = "/system/user"
|
||||
var prefix = "/novel/category"
|
||||
$(function () {
|
||||
load();
|
||||
});
|
||||
@ -59,67 +59,23 @@ function load() {
|
||||
return arguments[2] + 1;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '主键'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'username',
|
||||
title: '登录名'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'password',
|
||||
title: '登录密码'
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
title: '分类名'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'nickName',
|
||||
title: '昵称'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'userPhoto',
|
||||
title: '用户头像'
|
||||
},
|
||||
{
|
||||
field: 'sort',
|
||||
title: '排序'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'userSex',
|
||||
title: '用户性别,0:男,1:女'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'accountBalance',
|
||||
title: '账户余额'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'status',
|
||||
title: '用户状态,0:正常'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '更新时间'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
{
|
||||
title: '操作',
|
||||
field: 'id',
|
||||
align: 'center',
|
||||
@ -133,14 +89,16 @@ function load() {
|
||||
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;
|
||||
return e + r;
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
function reLoad() {
|
||||
$('#exampleTable').bootstrapTable('refresh');
|
||||
}
|
||||
|
||||
function add() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
@ -151,6 +109,7 @@ function add() {
|
||||
content: prefix + '/add' // iframe的url
|
||||
});
|
||||
}
|
||||
|
||||
function detail(id) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
@ -161,6 +120,7 @@ function detail(id) {
|
||||
content: prefix + '/detail/' + id // iframe的url
|
||||
});
|
||||
}
|
||||
|
||||
function edit(id) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
@ -171,6 +131,7 @@ function edit(id) {
|
||||
content: prefix + '/edit/' + id // iframe的url
|
||||
});
|
||||
}
|
||||
|
||||
function remove(id) {
|
||||
layer.confirm('确定要删除选中的记录?', {
|
||||
btn: ['确定', '取消']
|
||||
@ -195,6 +156,7 @@ function remove(id) {
|
||||
|
||||
function resetPwd(id) {
|
||||
}
|
||||
|
||||
function batchRemove() {
|
||||
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
|
||||
if (rows.length == 0) {
|
@ -70,7 +70,7 @@ function update() {
|
||||
$.ajax({
|
||||
cache: true,
|
||||
type: "POST",
|
||||
url: "/system/user/update",
|
||||
url: "/novel/category/update",
|
||||
data: $('#signupForm').serialize(),// 你的formid
|
||||
async: false,
|
||||
error: function (request) {
|
||||
@ -96,8 +96,14 @@ function validateRule() {
|
||||
$("#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 () {
|
||||
|
||||
});
|
||||
}
|
@ -1,18 +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');
|
||||
VALUES ('1', '新闻类别表', 'novel/category', 'novel:category:category', '1', 'fa', '6');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
set @parentId = @@identity;
|
||||
|
||||
-- 菜单对应按钮SQL
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '查看', null, 'system:user:detail', '2', null, '6';
|
||||
SELECT @parentId, '查看', null, 'novel:category:detail', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '新增', null, 'system:user:add', '2', null, '6';
|
||||
SELECT @parentId, '新增', null, 'novel:category:add', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '修改', null, 'system:user:edit', '2', null, '6';
|
||||
SELECT @parentId, '修改', null, 'novel:category:edit', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '删除', null, 'system:user:remove', '2', null, '6';
|
||||
SELECT @parentId, '删除', null, 'novel:category:remove', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '批量删除', null, 'system:user:batchRemove', '2', null, '6';
|
||||
SELECT @parentId, '批量删除', null, 'novel:category:batchRemove', '2', null, '6';
|
@ -1,18 +1,18 @@
|
||||
-- 菜单SQL
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
VALUES ('1', '付呗-订单信息表', 'test/order', 'test:order:order', '1', 'fa', '6');
|
||||
VALUES ('1', '新闻表', 'novel/news', 'novel:news:news', '1', 'fa', '6');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
set @parentId = @@identity;
|
||||
|
||||
-- 菜单对应按钮SQL
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '查看', null, 'test:order:detail', '2', null, '6';
|
||||
SELECT @parentId, '查看', null, 'novel:news:detail', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '新增', null, 'test:order:add', '2', null, '6';
|
||||
SELECT @parentId, '新增', null, 'novel:news:add', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '修改', null, 'test:order:edit', '2', null, '6';
|
||||
SELECT @parentId, '修改', null, 'novel:news:edit', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '删除', null, 'test:order:remove', '2', null, '6';
|
||||
SELECT @parentId, '删除', null, 'novel:news:remove', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '批量删除', null, 'test:order:batchRemove', '2', null, '6';
|
||||
SELECT @parentId, '批量删除', null, 'novel:news:batchRemove', '2', null, '6';
|
@ -147,7 +147,7 @@
|
||||
<tr>
|
||||
<td>下载地址</td>
|
||||
<td>
|
||||
<a href="https://gitee.com/xiongxyang/fiction_house" target="_blank">Gitee</a> /
|
||||
<a href="https://gitee.com/novel_dev_team/fiction_house" target="_blank">Gitee</a> /
|
||||
<a href="https://github.com/201206030/fiction_house" target="_blank">Github</a>
|
||||
</td>
|
||||
</tr>
|
||||
@ -155,8 +155,8 @@
|
||||
<td>Gitee</td>
|
||||
<td style="padding-bottom: 0;">
|
||||
<div class="layui-btn-container">
|
||||
<a href='https://gitee.com/xiongxyang/fiction_house/stargazers'><img src='https://gitee.com/xiongxyang/fiction_house/badge/star.svg?theme=dark' alt='star'></img></a>
|
||||
<a href='https://gitee.com/xiongxyang/fiction_house/members'><img src='https://gitee.com/xiongxyang/fiction_house/badge/fork.svg?theme=dark' alt='fork'></img></a>
|
||||
<a href='https://gitee.com/novel_dev_team/fiction_house/stargazers'><img src='https://gitee.com/novel_dev_team/fiction_house/badge/star.svg?theme=dark' alt='star'></img></a>
|
||||
<a href='https://gitee.com/novel_dev_team/fiction_house/members'><img src='https://gitee.com/novel_dev_team/fiction_house/badge/fork.svg?theme=dark' alt='fork'></img></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -200,7 +200,7 @@
|
||||
<tr>
|
||||
<td>下载地址</td>
|
||||
<td>
|
||||
<a href="https://gitee.com/xiongxyang/novel-plus" target="_blank">Gitee</a> /
|
||||
<a href="https://gitee.com/novel_dev_team/novel-plus" target="_blank">Gitee</a> /
|
||||
<a href="https://github.com/201206030/novel-plus" target="_blank">Github</a>
|
||||
</td>
|
||||
</tr>
|
||||
@ -208,8 +208,8 @@
|
||||
<td>Gitee</td>
|
||||
<td style="padding-bottom: 0;">
|
||||
<div class="layui-btn-container">
|
||||
<a href='https://gitee.com/xiongxyang/novel-plus/stargazers'><img src='https://gitee.com/xiongxyang/novel-plus/badge/star.svg?theme=dark' alt='star'></img></a>
|
||||
<a href='https://gitee.com/xiongxyang/novel-plus/members'><img src='https://gitee.com/xiongxyang/novel-plus/badge/fork.svg?theme=dark' alt='fork'></img></a>
|
||||
<a href='https://gitee.com/novel_dev_team/novel-plus/stargazers'><img src='https://gitee.com/novel_dev_team/novel-plus/badge/star.svg?theme=dark' alt='star'></img></a>
|
||||
<a href='https://gitee.com/novel_dev_team/novel-plus/members'><img src='https://gitee.com/novel_dev_team/novel-plus/badge/fork.svg?theme=dark' alt='fork'></img></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -253,7 +253,7 @@
|
||||
<tr>
|
||||
<td>下载地址</td>
|
||||
<td>
|
||||
<a href="https://gitee.com/xiongxyang/novel-cloud" target="_blank">Gitee</a> /
|
||||
<a href="https://gitee.com/novel_dev_team/novel-cloud" target="_blank">Gitee</a> /
|
||||
<a href="https://github.com/201206030/novel-cloud" target="_blank">Github</a>
|
||||
</td>
|
||||
</tr>
|
||||
@ -261,8 +261,8 @@
|
||||
<td>Gitee</td>
|
||||
<td style="padding-bottom: 0;">
|
||||
<div class="layui-btn-container">
|
||||
<a href='https://gitee.com/xiongxyang/novel-cloud/stargazers'><img src='https://gitee.com/xiongxyang/novel-cloud/badge/star.svg?theme=dark' alt='star'></img></a>
|
||||
<a href='https://gitee.com/xiongxyang/novel-cloud/members'><img src='https://gitee.com/xiongxyang/novel-cloud/badge/fork.svg?theme=dark' alt='fork'></img></a>
|
||||
<a href='https://gitee.com/novel_dev_team/novel-cloud/stargazers'><img src='https://gitee.com/novel_dev_team/novel-cloud/badge/star.svg?theme=dark' alt='star'></img></a>
|
||||
<a href='https://gitee.com/novel_dev_team/novel-cloud/members'><img src='https://gitee.com/novel_dev_team/novel-cloud/badge/fork.svg?theme=dark' alt='fork'></img></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">分类名:</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="name" name="name"
|
||||
class="form-control"
|
||||
type="text" maxlength="10">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">排序:</label>
|
||||
<div class="col-sm-2">
|
||||
<input id="sort" name="sort"
|
||||
class="form-control"
|
||||
type="number" maxlength="2">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8 col-sm-offset-3">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||
<script type="text/javascript" src="/js/appjs/novel/category/add.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -9,26 +9,17 @@
|
||||
<div class="ibox-body">
|
||||
<div class="fixed-table-toolbar">
|
||||
<div class="columns pull-left">
|
||||
<button shiro:hasPermission="system:user:add" type="button"
|
||||
<button shiro:hasPermission="novel:category:add" type="button"
|
||||
class="btn btn-primary" onclick="add()">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||
</button>
|
||||
<button shiro:hasPermission="system:user:batchRemove" type="button"
|
||||
<button shiro:hasPermission="novel:category:batchRemove" type="button"
|
||||
class="btn btn-danger"
|
||||
onclick="batchRemove()">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||
</button>
|
||||
</div>
|
||||
<div 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">
|
||||
@ -50,17 +41,17 @@
|
||||
s_detail_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div shiro:hasPermission="system:user:edit">
|
||||
<div shiro:hasPermission="novel:category:edit">
|
||||
<script type="text/javascript">
|
||||
s_edit_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div shiro:hasPermission="system:user:remove">
|
||||
<div shiro:hasPermission="novel:category:remove">
|
||||
<script type="text/javascript">
|
||||
var s_remove_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script type="text/javascript" src="/js/appjs/system/user/user.js"></script>
|
||||
<script type="text/javascript" src="/js/appjs/novel/category/category.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,80 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<input id="id" name="id" th:value="${category.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">分类名:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${category.name}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">排序:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${category.sort}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${category.createUserId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${category.createTime}==null?null:${#dates.format(category.createTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${category.updateUserId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${category.updateTime}==null?null:${#dates.format(category.updateTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<input id="id" name="id" th:value="${category.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">分类名:</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="name" name="name"
|
||||
th:value="${category.name}"
|
||||
class="form-control"
|
||||
type="text" maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">排序:</label>
|
||||
<div class="col-sm-2">
|
||||
<input id="sort" name="sort"
|
||||
th:value="${category.sort}"
|
||||
class="form-control"
|
||||
type="number" maxlength="2">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8 col-sm-offset-3">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||
<script type="text/javascript" src="/js/appjs/novel/category/edit.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
105
novel-admin/src/main/resources/templates/novel/news/add.html
Normal file
105
novel-admin/src/main/resources/templates/novel/news/add.html
Normal file
@ -0,0 +1,105 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">类别:</label>
|
||||
<div class="col-sm-3">
|
||||
|
||||
<select data-placeholder="--选择--" id="catId"
|
||||
name="catId"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="catName" name="catName"/>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来源:</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="sourceName" name="sourceName"
|
||||
class="form-control"
|
||||
type="text" maxlength="10">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="title" name="title"
|
||||
class="form-control"
|
||||
type="text" maxlength="30">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">内容:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="content" name="content"/>
|
||||
<div id="contentEditorcontent">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8 col-sm-offset-3">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||
<script type="text/javascript" src="/js/appjs/novel/news/add.js">
|
||||
</script>
|
||||
<script>
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/novel/category/list",
|
||||
data: {limit:100,offset:0},
|
||||
success: function (r) {
|
||||
if (r.code == 0) {
|
||||
var list = r.data.rows;
|
||||
var catHtml = "<option>请选择</option>";
|
||||
for(var i = 0 ; i < list.length ; i++){
|
||||
var cat = list[i];
|
||||
catHtml += ("<option value='"+cat.id+"'>"+cat.name+"</option>");
|
||||
|
||||
}
|
||||
$("#catId").html(catHtml);
|
||||
$("#catId").change(function(){
|
||||
var catName = $(this).find("option:selected").text();
|
||||
if(catName != '请选择'){
|
||||
|
||||
$("#catName").val(catName);
|
||||
}else{
|
||||
$("#catName").val('');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(r.msg);
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -9,95 +9,93 @@
|
||||
<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}"
|
||||
<input id="id" name="id" th:value="${news.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">登录名:</label>
|
||||
<label class="col-sm-3 control-label">类别ID:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="${column.dictType}"
|
||||
th:attr="dict-value=${news.catId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">分类名:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${user.username}">
|
||||
th:text="${news.catName}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">登录密码:</label>
|
||||
<label class="col-sm-3 control-label">来源:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${user.password}">
|
||||
th:text="${news.sourceName}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">昵称:</label>
|
||||
<label class="col-sm-3 control-label">标题:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${user.nickName}">
|
||||
th:text="${news.title}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户头像:</label>
|
||||
<label class="col-sm-3 control-label">内容:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${user.userPhoto}">
|
||||
</div>
|
||||
|
||||
th:utext="${news.content}"></div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">用户性别,0:男,1:女:</label>
|
||||
<label class="col-sm-3 control-label">发布时间:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${user.userSex}">
|
||||
th:text="${news.createTime}==null?null:${#dates.format(news.createTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">账户余额:</label>
|
||||
<label class="col-sm-3 control-label">发布人ID:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${user.accountBalance}">
|
||||
th:text="${news.createUserId}">
|
||||
</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')}">
|
||||
th:text="${news.updateTime}==null?null:${#dates.format(news.updateTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">更新人ID:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${news.updateUserId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
109
novel-admin/src/main/resources/templates/novel/news/edit.html
Normal file
109
novel-admin/src/main/resources/templates/novel/news/edit.html
Normal file
@ -0,0 +1,109 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<input id="id" name="id" th:value="${news.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">类别:</label>
|
||||
<div class="col-sm-3">
|
||||
|
||||
<select data-placeholder="--选择--" id="catId"
|
||||
name="catId"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
|
||||
th:value="${news.catId}">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="catName" name="catName" th:value="${news.catName}"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">来源:</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="sourceName" name="sourceName"
|
||||
th:value="${news.sourceName}"
|
||||
class="form-control"
|
||||
type="text" maxlength="10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标题:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="title" name="title"
|
||||
th:value="${news.title}"
|
||||
class="form-control"
|
||||
type="text" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">内容:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="content" name="content" th:value="${news.content}"/>
|
||||
<div id="contentEditorcontent">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8 col-sm-offset-3">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||
<script type="text/javascript" src="/js/appjs/novel/news/edit.js">
|
||||
</script>
|
||||
<script>
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/novel/category/list",
|
||||
data: {limit:100,offset:0},
|
||||
success: function (r) {
|
||||
if (r.code == 0) {
|
||||
var list = r.data.rows;
|
||||
var catHtml = "<option>请选择</option>";
|
||||
for(var i = 0 ; i < list.length ; i++){
|
||||
var cat = list[i];
|
||||
if(cat.id == $("#catId").attr("value")){
|
||||
catHtml += ("<option selected value='"+cat.id+"'>"+cat.name+"</option>");
|
||||
}else{
|
||||
catHtml += ("<option value='"+cat.id+"'>"+cat.name+"</option>");
|
||||
}
|
||||
|
||||
}
|
||||
$("#catId").html(catHtml);
|
||||
$("#catId").change(function(){
|
||||
var catName = $(this).find("option:selected").text();
|
||||
if(catName != '请选择'){
|
||||
|
||||
$("#catName").val(catName);
|
||||
}else{
|
||||
$("#catName").val('');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(r.msg);
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -9,11 +9,11 @@
|
||||
<div class="ibox-body">
|
||||
<div class="fixed-table-toolbar">
|
||||
<div class="columns pull-left">
|
||||
<button shiro:hasPermission="test:order:add" type="button"
|
||||
<button shiro:hasPermission="novel:news:add" type="button"
|
||||
class="btn btn-primary" onclick="add()">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||
</button>
|
||||
<button shiro:hasPermission="test:order:batchRemove" type="button"
|
||||
<button shiro:hasPermission="novel:news:batchRemove" type="button"
|
||||
class="btn btn-danger"
|
||||
onclick="batchRemove()">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||
@ -25,8 +25,8 @@
|
||||
|
||||
<form id="searchForm">
|
||||
<div class="columns pull-right col-md-2">
|
||||
<input id="id" name="id" type="text" class="form-control"
|
||||
placeholder="主键">
|
||||
<input id="title" name="title" type="text" class="form-control"
|
||||
placeholder="标题">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -50,17 +50,17 @@
|
||||
s_detail_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div shiro:hasPermission="test:order:edit">
|
||||
<div shiro:hasPermission="novel:news:edit">
|
||||
<script type="text/javascript">
|
||||
s_edit_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div shiro:hasPermission="test:order:remove">
|
||||
<div shiro:hasPermission="novel:news:remove">
|
||||
<script type="text/javascript">
|
||||
var s_remove_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script type="text/javascript" src="/js/appjs/test/order/order.js"></script>
|
||||
<script type="text/javascript" src="/js/appjs/novel/news/news.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,327 +0,0 @@
|
||||
<!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="fbMerchantCode" name="fbMerchantCode"
|
||||
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="merchantOrderSn" name="merchantOrderSn"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="orderSn"
|
||||
name="orderSn"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="color">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">平台方订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="platformOrderNo"
|
||||
name="platformOrderNo"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="oa_leave_type">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="tradeNo" name="tradeNo"/>
|
||||
<div id="contentEditortradeNo">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="orderState"
|
||||
name="orderState"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="yes_no">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">蜂鸟优惠卷抵扣:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fnCoupon" name="fnCoupon"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">红包抵扣:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="redPacket" name="redPacket"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">实收金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="totalFee" name="totalFee"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="orderPrice" name="orderPrice"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手续费(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fee" name="fee"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">对商品或交易的描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<img title="点击选择图片" id="picImagebody"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
src="/img/webuploader.png"/>
|
||||
<input id="body" name="body"
|
||||
class="form-control"
|
||||
type="hidden">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">附加数据:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="attach" name="attach"/>
|
||||
<div id="contentEditorattach">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的门店id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="storeId" name="storeId"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的收银员id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashierId" name="cashierId"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备终端号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="deviceNo" name="deviceNo"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="userId" name="userId"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付宝顾客的账号:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="userLogonId" name="userLogonId"
|
||||
class="form-control"></textarea>
|
||||
|
||||
</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="payTime"
|
||||
name="payTime"
|
||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||
style="background-color: #fff;" readonly="readonly"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付通道:1微信、2支付宝、3银联:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="payChannel"
|
||||
name="payChannel"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="del_flag">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">免充值代金券金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="noCashCouponFee" name="noCashCouponFee"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">预充值代金券金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashCouponFee" name="cashCouponFee"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">顾客实际支付金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashFee" name="cashFee"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">签名:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="sign"
|
||||
name="sign"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="theme">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">其它选项:</label>
|
||||
<div class="col-sm-8">
|
||||
<img title="点击选择图片" id="picImageoptions"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
src="/img/webuploader.png"/>
|
||||
<input id="options" name="options"
|
||||
class="form-control"
|
||||
type="hidden">
|
||||
|
||||
</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="pushTime"
|
||||
name="pushTime"
|
||||
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">推送IP:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="pushIp" name="pushIp"/>
|
||||
<div id="contentEditorpushIp">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="mchtId" name="mchtId"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">QR编号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="sn" name="sn"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8 col-sm-offset-3">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||
<script type="text/javascript" src="/js/appjs/test/order/add.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,315 +0,0 @@
|
||||
<!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="${order.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="${order.fbMerchantCode}">
|
||||
</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="${order.merchantOrderSn}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗订单号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="color"
|
||||
th:attr="dict-value=${order.orderSn}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">平台方订单号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="oa_leave_type"
|
||||
th:attr="dict-value=${order.platformOrderNo}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户单号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:utext="${order.tradeNo}"></div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="yes_no"
|
||||
th:attr="dict-value=${order.orderState}">
|
||||
</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="${order.fnCoupon}">
|
||||
</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="${order.redPacket}">
|
||||
</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="${order.totalFee}">
|
||||
</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="${order.orderPrice}">
|
||||
</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="${order.fee}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">对商品或交易的描述:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8">
|
||||
<img id="picImagebody"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
th:src="${order.body}==null?'/img/webuploader.png':${order.body}"/>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">附加数据:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:utext="${order.attach}"></div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的门店id:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.storeId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的收银员id:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.cashierId}">
|
||||
</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="${order.deviceNo}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.userId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付宝顾客的账号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.userLogonId}">
|
||||
</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="${order.payTime}==null?null:${#dates.format(order.payTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付通道:1微信、2支付宝、3银联:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="del_flag"
|
||||
th:attr="dict-value=${order.payChannel}">
|
||||
</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="${order.noCashCouponFee}">
|
||||
</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="${order.cashCouponFee}">
|
||||
</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="${order.cashFee}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">签名:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="theme"
|
||||
th:attr="dict-value=${order.sign}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">其它选项:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8">
|
||||
<img id="picImageoptions"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
th:src="${order.options}==null?'/img/webuploader.png':${order.options}"/>
|
||||
</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="${order.createTime}==null?null:${#dates.format(order.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="${order.pushTime}==null?null:${#dates.format(order.pushTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">推送IP:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:utext="${order.pushIp}"></div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户id:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.mchtId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">QR编号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.sn}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
</body>
|
||||
</html>
|
@ -1,323 +0,0 @@
|
||||
<!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="${order.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗商户号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fbMerchantCode" name="fbMerchantCode"
|
||||
th:value="${order.fbMerchantCode}"
|
||||
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="merchantOrderSn" name="merchantOrderSn"
|
||||
th:value="${order.merchantOrderSn}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="orderSn"
|
||||
name="orderSn"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="color"
|
||||
th:attr="dict-value=${order.orderSn}" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">平台方订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="platformOrderNo"
|
||||
name="platformOrderNo"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="oa_leave_type"
|
||||
th:attr="dict-value=${order.platformOrderNo}" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="tradeNo" name="tradeNo" th:value="${order.tradeNo}"/>
|
||||
<div id="contentEditortradeNo">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="orderState"
|
||||
name="orderState"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="yes_no"
|
||||
th:attr="dict-value=${order.orderState}" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">蜂鸟优惠卷抵扣:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fnCoupon" name="fnCoupon"
|
||||
th:value="${order.fnCoupon}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">红包抵扣:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="redPacket" name="redPacket"
|
||||
th:value="${order.redPacket}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">实收金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="totalFee" name="totalFee"
|
||||
th:value="${order.totalFee}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="orderPrice" name="orderPrice"
|
||||
th:value="${order.orderPrice}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手续费(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fee" name="fee"
|
||||
th:value="${order.fee}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">对商品或交易的描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<img title="点击选择图片" id="picImagebody"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
th:src="${order.body}==null?'/img/webuploader.png':${order.body}"/>
|
||||
<input id="body" name="body" th:value="${order.body}"
|
||||
class="form-control"
|
||||
type="hidden">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">附加数据:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="attach" name="attach" th:value="${order.attach}"/>
|
||||
<div id="contentEditorattach">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的门店id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="storeId" name="storeId"
|
||||
th:value="${order.storeId}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的收银员id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashierId" name="cashierId"
|
||||
th:value="${order.cashierId}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备终端号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="deviceNo" name="deviceNo"
|
||||
th:value="${order.deviceNo}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="userId" name="userId"
|
||||
th:value="${order.userId}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付宝顾客的账号:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="userLogonId" name="userLogonId"
|
||||
class="form-control" th:text="${order.userLogonId}"></textarea>
|
||||
</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="payTime"
|
||||
name="payTime"
|
||||
th:value="${order.payTime}==null?null:${#dates.format(order.payTime,'yyyy-MM-dd HH:mm:ss')}"
|
||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||
style="background-color: #fff;" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付通道:1微信、2支付宝、3银联:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="payChannel"
|
||||
name="payChannel"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="del_flag"
|
||||
th:attr="dict-value=${order.payChannel}" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">免充值代金券金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="noCashCouponFee" name="noCashCouponFee"
|
||||
th:value="${order.noCashCouponFee}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">预充值代金券金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashCouponFee" name="cashCouponFee"
|
||||
th:value="${order.cashCouponFee}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">顾客实际支付金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashFee" name="cashFee"
|
||||
th:value="${order.cashFee}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">签名:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="sign"
|
||||
name="sign"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="theme"
|
||||
th:attr="dict-value=${order.sign}" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">其它选项:</label>
|
||||
<div class="col-sm-8">
|
||||
<img title="点击选择图片" id="picImageoptions"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
th:src="${order.options}==null?'/img/webuploader.png':${order.options}"/>
|
||||
<input id="options" name="options" th:value="${order.options}"
|
||||
class="form-control"
|
||||
type="hidden">
|
||||
</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="${order.createTime}==null?null:${#dates.format(order.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="pushTime"
|
||||
name="pushTime"
|
||||
th:value="${order.pushTime}==null?null:${#dates.format(order.pushTime,'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">推送IP:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="pushIp" name="pushIp" th:value="${order.pushIp}"/>
|
||||
<div id="contentEditorpushIp">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="mchtId" name="mchtId"
|
||||
th:value="${order.mchtId}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">QR编号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="sn" name="sn"
|
||||
th:value="${order.sn}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8 col-sm-offset-3">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||
<script type="text/javascript" src="/js/appjs/test/order/edit.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,25 +0,0 @@
|
||||
package com.java2nb.testDemo;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController()
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class TestDemo {
|
||||
@Autowired
|
||||
RedisTemplate redisTemplate;
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
redisTemplate.opsForValue().set("a", "b");
|
||||
System.out.println(redisTemplate.opsForValue().get("a"));
|
||||
}
|
||||
|
||||
;
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>novel</artifactId>
|
||||
<groupId>com.java2nb</groupId>
|
||||
<version>2.10.0</version>
|
||||
<version>3.6.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -103,12 +103,6 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis.dynamic-sql</groupId>
|
||||
<artifactId>mybatis-dynamic-sql</artifactId>
|
||||
@ -123,6 +117,30 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.github.xxyopen</groupId>
|
||||
<artifactId>xxy-model</artifactId>
|
||||
<version>${xxyopen.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.github.xxyopen</groupId>
|
||||
<artifactId>xxy-web</artifactId>
|
||||
<version>${xxyopen.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.github.xxyopen</groupId>
|
||||
<artifactId>xxy-util</artifactId>
|
||||
<version>${xxyopen.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
@ -1,37 +0,0 @@
|
||||
package com.java2nb.novel.core.advice;
|
||||
|
||||
import com.java2nb.novel.core.bean.ResultBean;
|
||||
import com.java2nb.novel.core.exception.BusinessException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* 通用的异常处理器
|
||||
*
|
||||
* @author 11797*/
|
||||
@Slf4j
|
||||
@ControllerAdvice
|
||||
@ResponseBody
|
||||
public class CommonExceptionHandler {
|
||||
|
||||
/**
|
||||
* 处理业务异常
|
||||
* */
|
||||
@ExceptionHandler(BusinessException.class)
|
||||
public ResultBean handlerBusinessException(BusinessException e){
|
||||
log.error(e.getMessage(),e);
|
||||
return ResultBean.fail(e.getResStatus());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理系统异常
|
||||
* */
|
||||
@ExceptionHandler(Exception.class)
|
||||
public ResultBean handlerException(Exception e){
|
||||
log.error(e.getMessage(),e);
|
||||
return ResultBean.error();
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.java2nb.novel.core.advice;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
|
||||
/**
|
||||
* 页面异常处理器
|
||||
*
|
||||
* @author 11797
|
||||
*/
|
||||
@Slf4j
|
||||
@ControllerAdvice(basePackages = "com.java2nb.novel.page")
|
||||
public class PageExceptionHandler {
|
||||
|
||||
|
||||
/**
|
||||
* 处理所有异常
|
||||
*/
|
||||
@ExceptionHandler(Exception.class)
|
||||
public String handlerException(Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
//跳转页面过程中出现异常时统一跳转到404页面
|
||||
return "404";
|
||||
}
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
package com.java2nb.novel.core.bean;
|
||||
|
||||
|
||||
import com.java2nb.novel.core.enums.ResponseStatus;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 自定义响应结构
|
||||
* @author 11797
|
||||
* @param <T>
|
||||
*/
|
||||
@Data
|
||||
public class ResultBean<T> implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int code = ResponseStatus.OK.getCode();
|
||||
|
||||
/**
|
||||
* 响应消息
|
||||
* */
|
||||
private String msg = ResponseStatus.OK.getMsg();
|
||||
/**
|
||||
* 响应中的数据
|
||||
* */
|
||||
private T data;
|
||||
|
||||
private ResultBean() {
|
||||
|
||||
}
|
||||
|
||||
private ResultBean(ResponseStatus ResponseStatus) {
|
||||
this.code = ResponseStatus.getCode();;
|
||||
this.msg = ResponseStatus.getMsg();
|
||||
}
|
||||
|
||||
private ResultBean(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 业务处理成功,无数据返回
|
||||
* */
|
||||
public static ResultBean ok() {
|
||||
return new ResultBean();
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务处理成功,有数据返回
|
||||
* */
|
||||
public static <T> ResultBean ok(T data) {
|
||||
return new ResultBean(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务处理失败
|
||||
* */
|
||||
public static ResultBean fail(ResponseStatus ResponseStatus) {
|
||||
return new ResultBean(ResponseStatus);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 系统错误
|
||||
* */
|
||||
public static ResultBean error() {
|
||||
return new ResultBean(ResponseStatus.ERROR);
|
||||
}
|
||||
}
|
||||
|
@ -65,4 +65,8 @@ public interface CacheKey {
|
||||
* 累积的小说点击量
|
||||
* */
|
||||
String BOOK_ADD_VISIT_COUNT = "bookAddVisitCount";
|
||||
}
|
||||
/**
|
||||
* 测试爬虫规则缓存
|
||||
*/
|
||||
String BOOK_TEST_PARSE = "testParse";
|
||||
}
|
||||
|
@ -16,108 +16,107 @@ import org.springframework.stereotype.Service;
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class EhCacheServiceImpl implements CacheService {
|
||||
|
||||
private final CacheManager cacheManager ;
|
||||
|
||||
|
||||
/**
|
||||
* 获得一个Cache,没有则创建一个。
|
||||
* @return
|
||||
*/
|
||||
private Cache getCache(){
|
||||
|
||||
Cache cache = cacheManager.getCache("util_cache");
|
||||
return cache;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String get(String key) {
|
||||
Element element = getCache().get(key);
|
||||
return element==null?null:(String)element.getObjectValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(String key, String value) {
|
||||
Element element = new Element(key, value);
|
||||
Cache cache = getCache();
|
||||
//不过期
|
||||
cache.getCacheConfiguration().setEternal(true);
|
||||
cache.put(element);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(String key, String value, long timeout) {
|
||||
Element element = new Element(key, value);
|
||||
element.setTimeToLive((int) timeout);
|
||||
Cache cache = getCache();
|
||||
cache.put(element);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(String key) {
|
||||
getCache().remove(key);
|
||||
private final CacheManager cacheManager;
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* 获得一个Cache,没有则创建一个。
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private Cache getCache() {
|
||||
|
||||
@Override
|
||||
public boolean contains(String key) {
|
||||
return getCache().isKeyInCache(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void expire(String key, long timeout) {
|
||||
Element element = getCache().get(key);
|
||||
if (element != null) {
|
||||
Object value = element.getValue();
|
||||
element = new Element(key, value);
|
||||
element.setTimeToLive((int)timeout);
|
||||
Cache cache = getCache();
|
||||
cache.put(element);
|
||||
}
|
||||
}
|
||||
Cache cache = cacheManager.getCache("util_cache");
|
||||
return cache;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据key获取缓存的Object类型数据
|
||||
*/
|
||||
@Override
|
||||
public Object getObject(String key) {
|
||||
Element element = getCache().get(key);
|
||||
return element==null?null:element.getObjectValue();
|
||||
}
|
||||
@Override
|
||||
public String get(String key) {
|
||||
Element element = getCache().get(key);
|
||||
return element == null ? null : (String) element.getObjectValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(String key, String value) {
|
||||
Element element = new Element(key, value);
|
||||
Cache cache = getCache();
|
||||
//不过期
|
||||
cache.getCacheConfiguration().setEternal(true);
|
||||
cache.put(element);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(String key, String value, long timeout) {
|
||||
Element element = new Element(key, value);
|
||||
element.setTimeToLive((int) timeout);
|
||||
Cache cache = getCache();
|
||||
cache.put(element);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(String key) {
|
||||
getCache().remove(key);
|
||||
|
||||
|
||||
/**
|
||||
* 设置Object类型的缓存
|
||||
*/
|
||||
@Override
|
||||
public void setObject(String key, Object value) {
|
||||
Element element = new Element(key, value);
|
||||
Cache cache = getCache();
|
||||
//不过期
|
||||
cache.getCacheConfiguration().setEternal(true);
|
||||
cache.put(element);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(String key) {
|
||||
return getCache().isKeyInCache(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void expire(String key, long timeout) {
|
||||
Element element = getCache().get(key);
|
||||
if (element != null) {
|
||||
Object value = element.getValue();
|
||||
element = new Element(key, value);
|
||||
element.setTimeToLive((int) timeout);
|
||||
Cache cache = getCache();
|
||||
cache.put(element);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置一个有过期时间的Object类型的缓存,单位秒
|
||||
*/
|
||||
@Override
|
||||
public void setObject(String key, Object value, long timeout) {
|
||||
Element element = new Element(key, value);
|
||||
element.setTimeToLive((int) timeout);
|
||||
Cache cache = getCache();
|
||||
cache.put(element);
|
||||
|
||||
}
|
||||
/**
|
||||
* 根据key获取缓存的Object类型数据
|
||||
*/
|
||||
@Override
|
||||
public Object getObject(String key) {
|
||||
Element element = getCache().get(key);
|
||||
return element == null ? null : element.getObjectValue();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置Object类型的缓存
|
||||
*/
|
||||
@Override
|
||||
public void setObject(String key, Object value) {
|
||||
Element element = new Element(key, value);
|
||||
Cache cache = getCache();
|
||||
//不过期
|
||||
cache.getCacheConfiguration().setEternal(true);
|
||||
cache.put(element);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置一个有过期时间的Object类型的缓存,单位秒
|
||||
*/
|
||||
@Override
|
||||
public void setObject(String key, Object value, long timeout) {
|
||||
Element element = new Element(key, value);
|
||||
element.setTimeToLive((int) timeout);
|
||||
Cache cache = getCache();
|
||||
cache.put(element);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.java2nb.novel.core.enums;
|
||||
|
||||
import io.github.xxyopen.model.resp.IResultCode;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -11,27 +12,7 @@ import lombok.NoArgsConstructor;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public enum ResponseStatus {
|
||||
|
||||
/**
|
||||
* 请求成功
|
||||
* */
|
||||
OK(200,"SUCCESS"),
|
||||
|
||||
/**
|
||||
* 服务器异常
|
||||
* */
|
||||
ERROR(500,"未知异常,请联系管理员!"),
|
||||
|
||||
/**
|
||||
* 参数错误
|
||||
* */
|
||||
PARAM_ERROR(400,"非法参数!"),
|
||||
|
||||
/**
|
||||
* 拒绝访问
|
||||
* */
|
||||
FORBIDDEN(403,"拒绝访问!"),
|
||||
public enum ResponseStatus implements IResultCode {
|
||||
|
||||
|
||||
/**
|
||||
@ -68,6 +49,12 @@ public enum ResponseStatus {
|
||||
* */
|
||||
ES_SEARCH_FAIL(9001,"搜索引擎查询错误!"),
|
||||
|
||||
/**
|
||||
* 文件相关错误
|
||||
* */
|
||||
FILE_DIR_MAKE_FAIL(10001,"目录创建失败"),
|
||||
FILE_NOT_IMAGE(10002,"请上传图片类型的文件"),
|
||||
FILE_SIZE_LIMIT(10003,"文件大小超出限制"),
|
||||
|
||||
/**
|
||||
* 其他通用错误
|
||||
|
@ -1,22 +0,0 @@
|
||||
package com.java2nb.novel.core.exception;
|
||||
|
||||
import com.java2nb.novel.core.enums.ResponseStatus;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 自定义业务异常,用于处理用户请求时,业务错误时抛出
|
||||
*/
|
||||
@Data
|
||||
public class BusinessException extends RuntimeException {
|
||||
|
||||
private ResponseStatus resStatus;
|
||||
|
||||
public BusinessException(ResponseStatus resStatus) {
|
||||
//不调用父类Throwable的fillInStackTrace()方法生成栈追踪信息,提高应用性能
|
||||
//构造器之间的调用必须在第一行
|
||||
super(resStatus.getMsg(), null, false, false);
|
||||
this.resStatus = resStatus;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
package com.java2nb.novel.core.utils;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Bean操作工具类
|
||||
* @author Administrator
|
||||
*/
|
||||
public class BeanUtil {
|
||||
|
||||
/**
|
||||
* 复制集合对象属性值,生成新类型集合
|
||||
* @param source 源集合
|
||||
* @param targetClass 目标集合类型
|
||||
* @return 新集合
|
||||
* */
|
||||
@SneakyThrows
|
||||
public static <T> List<T> copyList(List source,Class<T> targetClass){
|
||||
List<T> target = new ArrayList<>(source.size());
|
||||
for( int i = 0 ; i < source.size() ; i++){
|
||||
Object sourceItem = source.get(i);
|
||||
T targetItem = targetClass.newInstance();
|
||||
BeanUtils.copyProperties(sourceItem,targetItem);
|
||||
target.add(targetItem);
|
||||
}
|
||||
return target;
|
||||
|
||||
}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package com.java2nb.novel.core.utils;
|
||||
|
||||
import io.github.xxyopen.util.UUIDUtil;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.Charsets;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
@ -11,21 +13,24 @@ import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 文件操作工具类
|
||||
*
|
||||
* @author 11797
|
||||
*/
|
||||
@UtilityClass
|
||||
@Slf4j
|
||||
public class FileUtil {
|
||||
|
||||
/**
|
||||
* 网络图片转本地
|
||||
* */
|
||||
public static String network2Local(String picSrc,String picSavePath,String visitPrefix) {
|
||||
*/
|
||||
public String network2Local(String picSrc, String picSavePath, String visitPrefix) {
|
||||
InputStream input = null;
|
||||
OutputStream out = null;
|
||||
try {
|
||||
@ -50,37 +55,70 @@ public class FileUtil {
|
||||
}
|
||||
|
||||
out.flush();
|
||||
if( ImageIO.read(picFile) == null){
|
||||
if (ImageIO.read(picFile) == null) {
|
||||
picSrc = "/images/default.gif";
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(),e);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
picSrc = "/images/default.gif";
|
||||
}finally {
|
||||
if(input != null){
|
||||
try {
|
||||
input.close();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}finally {
|
||||
if(out != null){
|
||||
try {
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
closeStream(input, out);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return picSrc;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
private void closeStream(InputStream input, OutputStream out) {
|
||||
if (input != null) {
|
||||
input.close();
|
||||
}
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断文件是否为图片
|
||||
*
|
||||
* @param file 需要判断的文件
|
||||
* @return true:是图片,false:不是图片
|
||||
*/
|
||||
@SneakyThrows
|
||||
public boolean isImage(File file) {
|
||||
|
||||
BufferedImage bi = ImageIO.read(file);
|
||||
|
||||
return bi != null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void writeContentToFile(String fileSavePath, String fileSrc, String content) {
|
||||
OutputStream out = null;
|
||||
try {
|
||||
File file = new File(fileSavePath + fileSrc);
|
||||
File parentFile = file.getParentFile();
|
||||
if (!parentFile.exists()) {
|
||||
parentFile.mkdirs();
|
||||
}
|
||||
out = new FileOutputStream(file);
|
||||
out.write(content.getBytes());
|
||||
byte[] b = new byte[4096];
|
||||
out.flush();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new RuntimeException("文件写入失败");
|
||||
} finally {
|
||||
closeStream(null, out);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,6 @@
|
||||
package com.java2nb.novel.core.utils;
|
||||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
@ -28,4 +25,23 @@ public class HttpUtil {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getByHttpClientWithChrome(String url) {
|
||||
try {
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("user-agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36");
|
||||
HttpEntity<String> requestEntity = new HttpEntity<>(null, headers);
|
||||
ResponseEntity<String> forEntity = restTemplate.exchange(url.toString(), HttpMethod.GET, requestEntity, String.class);
|
||||
|
||||
if (forEntity.getStatusCode() == HttpStatus.OK) {
|
||||
return forEntity.getBody();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,163 +0,0 @@
|
||||
package com.java2nb.novel.core.utils;
|
||||
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
|
||||
/**
|
||||
* <p>名称:IdWorker.java</p>
|
||||
* <p>描述:分布式自增长ID</p>
|
||||
* <pre>
|
||||
* Twitter的 Snowflake JAVA实现方案
|
||||
* </pre>
|
||||
* 核心代码为其IdWorker这个类实现,其原理结构如下,我分别用一个0表示一位,用—分割开部分的作用:
|
||||
* 1||0---0000000000 0000000000 0000000000 0000000000 0 --- 00000 ---00000 ---000000000000
|
||||
* 在上面的字符串中,第一位为未使用(实际上也可作为long的符号位),接下来的41位为毫秒级时间,
|
||||
* 然后5位datacenter标识位,5位机器ID(并不算标识符,实际是为线程标识),
|
||||
* 然后12位该毫秒内的当前毫秒内的计数,加起来刚好64位,为一个Long型。
|
||||
* 这样的好处是,整体上按照时间自增排序,并且整个分布式系统内不会产生ID碰撞(由datacenter和机器ID作区分),
|
||||
* 并且效率较高,经测试,snowflake每秒能够产生26万ID左右,完全满足需要。
|
||||
* <p>
|
||||
* 64位ID (42(毫秒)+5(机器ID)+5(业务编码)+12(重复累加))
|
||||
*
|
||||
*/
|
||||
public class IdWorker {
|
||||
// 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动)
|
||||
private final static long twepoch = 1288834974657L;
|
||||
// 机器标识位数
|
||||
private final static long workerIdBits = 5L;
|
||||
// 数据中心标识位数
|
||||
private final static long datacenterIdBits = 5L;
|
||||
// 机器ID最大值
|
||||
private final static long maxWorkerId = -1L ^ (-1L << workerIdBits);
|
||||
// 数据中心ID最大值
|
||||
private final static long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
|
||||
// 毫秒内自增位
|
||||
private final static long sequenceBits = 12L;
|
||||
// 机器ID偏左移12位
|
||||
private final static long workerIdShift = sequenceBits;
|
||||
// 数据中心ID左移17位
|
||||
private final static long datacenterIdShift = sequenceBits + workerIdBits;
|
||||
// 时间毫秒左移22位
|
||||
private final static long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
|
||||
|
||||
private final static long sequenceMask = -1L ^ (-1L << sequenceBits);
|
||||
/* 上次生产id时间戳 */
|
||||
private static long lastTimestamp = -1L;
|
||||
// 0,并发控制
|
||||
private long sequence = 0L;
|
||||
|
||||
private final long workerId;
|
||||
// 数据标识id部分
|
||||
private final long datacenterId;
|
||||
|
||||
public IdWorker(){
|
||||
this.datacenterId = getDatacenterId(maxDatacenterId);
|
||||
this.workerId = getMaxWorkerId(datacenterId, maxWorkerId);
|
||||
}
|
||||
/**
|
||||
* @param workerId
|
||||
* 工作机器ID
|
||||
* @param datacenterId
|
||||
* 序列号
|
||||
*/
|
||||
public IdWorker(long workerId, long datacenterId) {
|
||||
if (workerId > maxWorkerId || workerId < 0) {
|
||||
throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
|
||||
}
|
||||
if (datacenterId > maxDatacenterId || datacenterId < 0) {
|
||||
throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
|
||||
}
|
||||
this.workerId = workerId;
|
||||
this.datacenterId = datacenterId;
|
||||
}
|
||||
/**
|
||||
* 获取下一个ID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public synchronized long nextId() {
|
||||
long timestamp = timeGen();
|
||||
if (timestamp < lastTimestamp) {
|
||||
throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
|
||||
}
|
||||
|
||||
if (lastTimestamp == timestamp) {
|
||||
// 当前毫秒内,则+1
|
||||
sequence = (sequence + 1) & sequenceMask;
|
||||
if (sequence == 0) {
|
||||
// 当前毫秒内计数满了,则等待下一秒
|
||||
timestamp = tilNextMillis(lastTimestamp);
|
||||
}
|
||||
} else {
|
||||
sequence = 0L;
|
||||
}
|
||||
lastTimestamp = timestamp;
|
||||
// ID偏移组合生成最终的ID,并返回ID
|
||||
long nextId = ((timestamp - twepoch) << timestampLeftShift)
|
||||
| (datacenterId << datacenterIdShift)
|
||||
| (workerId << workerIdShift) | sequence;
|
||||
|
||||
return nextId;
|
||||
}
|
||||
|
||||
private long tilNextMillis(final long lastTimestamp) {
|
||||
long timestamp = this.timeGen();
|
||||
while (timestamp <= lastTimestamp) {
|
||||
timestamp = this.timeGen();
|
||||
}
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
private long timeGen() {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 获取 maxWorkerId
|
||||
* </p>
|
||||
*/
|
||||
protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) {
|
||||
StringBuffer mpid = new StringBuffer();
|
||||
mpid.append(datacenterId);
|
||||
String name = ManagementFactory.getRuntimeMXBean().getName();
|
||||
if (!name.isEmpty()) {
|
||||
/*
|
||||
* GET jvmPid
|
||||
*/
|
||||
mpid.append(name.split("@")[0]);
|
||||
}
|
||||
/*
|
||||
* MAC + PID 的 hashcode 获取16个低位
|
||||
*/
|
||||
return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据标识id部分
|
||||
* </p>
|
||||
*/
|
||||
protected static long getDatacenterId(long maxDatacenterId) {
|
||||
long id = 0L;
|
||||
try {
|
||||
InetAddress ip = InetAddress.getLocalHost();
|
||||
NetworkInterface network = NetworkInterface.getByInetAddress(ip);
|
||||
if (network == null) {
|
||||
id = 1L;
|
||||
} else {
|
||||
byte[] mac = network.getHardwareAddress();
|
||||
id = ((0x000000FF & (long) mac[mac.length - 1])
|
||||
| (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6;
|
||||
id = id % (maxDatacenterId + 1);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println(" getDatacenterId: " + e.getMessage());
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.java2nb.novel.core.utils;
|
||||
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
/**
|
||||
* @author 11797
|
||||
*/
|
||||
public class MD5Util {
|
||||
|
||||
private static final String DEFAUL_CHARSET = "utf-8" ;
|
||||
|
||||
private static String byteArrayToHexString(byte[] b) {
|
||||
StringBuffer resultSb = new StringBuffer();
|
||||
for (int i = 0; i < b.length; i++) {
|
||||
resultSb.append(byteToHexString(b[i]));
|
||||
}
|
||||
|
||||
return resultSb.toString();
|
||||
}
|
||||
|
||||
private static String byteToHexString(byte b) {
|
||||
int n = b;
|
||||
if (n < 0) {
|
||||
n += 256;
|
||||
}
|
||||
int d1 = n / 16;
|
||||
int d2 = n % 16;
|
||||
return HEX_DIGITS[d1] + HEX_DIGITS[d2];
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static String MD5Encode(String origin,String charsetname) {
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
if (charsetname == null || "".equals(charsetname)) {
|
||||
return byteArrayToHexString(md.digest(origin
|
||||
.getBytes()));
|
||||
} else {
|
||||
return byteArrayToHexString(md.digest(origin
|
||||
.getBytes(charsetname)));
|
||||
}
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static String MD5New(String str) {
|
||||
//首先利用MD5算法将密码加密,变成等长字节
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] b1 = md.digest(str.getBytes());
|
||||
//将等长字节利用Base64算法转换成字符串
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
return encoder.encode(b1);
|
||||
}
|
||||
|
||||
private static final String[] HEX_DIGITS = {"0", "1", "2", "3", "4", "5",
|
||||
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
|
||||
|
||||
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package com.java2nb.novel.core.utils;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Component
|
||||
public class SpringUtil implements ApplicationContextAware {
|
||||
|
||||
|
||||
|
||||
private static ApplicationContext applicationContext;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) {
|
||||
if (SpringUtil.applicationContext == null) {
|
||||
SpringUtil.applicationContext = applicationContext;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取applicationContext
|
||||
* */
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过name获取 Bean.
|
||||
* */
|
||||
public static Object getBean(String name) {
|
||||
return getApplicationContext().getBean(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过class获取Bean
|
||||
* */
|
||||
public static <T> T getBean(Class<T> clazz) {
|
||||
return getApplicationContext().getBean(clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过name,以及Clazz返回指定的Bean
|
||||
* */
|
||||
public static <T> T getBean(String name, Class<T> clazz) {
|
||||
return getApplicationContext().getBean(name, clazz);
|
||||
}
|
||||
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package com.java2nb.novel.core.utils;
|
||||
|
||||
/**
|
||||
* 线程工具类
|
||||
* @author Administrator
|
||||
*/
|
||||
public class ThreadUtil {
|
||||
|
||||
/**
|
||||
* 根据线程ID获取线程
|
||||
* */
|
||||
public static Thread findThread(long threadId) {
|
||||
ThreadGroup group = Thread.currentThread().getThreadGroup();
|
||||
while(group != null) {
|
||||
Thread[] threads = new Thread[(int)(group.activeCount() * 1.2)];
|
||||
int count = group.enumerate(threads, true);
|
||||
for(int i = 0; i < count; i++) {
|
||||
if(threadId == threads[i].getId()) {
|
||||
return threads[i];
|
||||
}
|
||||
}
|
||||
group = group.getParent();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
package com.java2nb.novel.core.utils;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
public class UUIDUtil {
|
||||
|
||||
public static final String[] CHARS = new String[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l",
|
||||
"m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6",
|
||||
"7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
|
||||
"S", "T", "U", "V", "W", "X", "Y", "Z" };
|
||||
|
||||
/**
|
||||
* 生成指定长度的uuid
|
||||
*
|
||||
* @param length
|
||||
* @return
|
||||
*/
|
||||
private static String getUUID(int length, UUID uuid) {
|
||||
int groupLength = 32 / length;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String id = uuid.toString().replace("-", "");
|
||||
for (int i = 0; i < length; i++) {
|
||||
String str = id.substring(i * groupLength, i * groupLength + groupLength);
|
||||
int x = Integer.parseInt(str, 16);
|
||||
sb.append(CHARS[x % 0x3E]);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 8位UUID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getUUID8() {
|
||||
return getUUID(8, UUID.randomUUID());
|
||||
}
|
||||
|
||||
/**
|
||||
* 8位UUID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getUUID8(byte[] bytes) {
|
||||
return getUUID(8, UUID.nameUUIDFromBytes(bytes));
|
||||
}
|
||||
|
||||
/**
|
||||
* 8位UUID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getUUID8(String fromString) {
|
||||
return getUUID(8, UUID.fromString(fromString));
|
||||
}
|
||||
|
||||
/**
|
||||
* 16位UUID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getUUID16() {
|
||||
return getUUID(16, UUID.randomUUID());
|
||||
}
|
||||
|
||||
/**
|
||||
* 16位UUID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getUUID16(String fromString) {
|
||||
return getUUID(16, UUID.fromString(fromString));
|
||||
}
|
||||
|
||||
/**
|
||||
* 16位UUID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getUUID16(byte[] bytes) {
|
||||
return getUUID(16, UUID.nameUUIDFromBytes(bytes));
|
||||
}
|
||||
|
||||
/**
|
||||
* 32位UUID
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getUUID32() {
|
||||
return UUID.randomUUID().toString().replace("-", "");
|
||||
}
|
||||
|
||||
}
|
@ -25,6 +25,9 @@ public class BookIndex {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Integer bookPrice;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private String storageType;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Date createTime;
|
||||
|
||||
@ -101,6 +104,16 @@ public class BookIndex {
|
||||
this.bookPrice = bookPrice;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public String getStorageType() {
|
||||
return storageType;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setStorageType(String storageType) {
|
||||
this.storageType = storageType == null ? null : storageType.trim();
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.java2nb.novel.entity;
|
||||
|
||||
|
||||
import javax.annotation.Generated;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
public class News implements Serializable {
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Long id;
|
||||
|
||||
@ -21,6 +21,9 @@ public class News implements Serializable {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private String title;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Long readCount;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Date createTime;
|
||||
|
||||
@ -86,6 +89,16 @@ public class News implements Serializable {
|
||||
this.title = title == null ? null : title.trim();
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Long getReadCount() {
|
||||
return readCount;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setReadCount(Long readCount) {
|
||||
this.readCount = readCount;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
@ -135,4 +148,4 @@ public class News implements Serializable {
|
||||
public void setContent(String content) {
|
||||
this.content = content == null ? null : content.trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,36 +1,56 @@
|
||||
package com.java2nb.novel.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import io.github.xxyopen.web.valid.AddGroup;
|
||||
import io.github.xxyopen.web.valid.UpdateGroup;
|
||||
|
||||
import javax.annotation.Generated;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
|
||||
public class User {
|
||||
|
||||
@Null(groups = {AddGroup.class, UpdateGroup.class})
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Long id;
|
||||
|
||||
|
||||
@NotBlank(groups = {AddGroup.class},message="手机号不能为空!")
|
||||
@Pattern(groups = {AddGroup.class},regexp="^1[3|4|5|6|7|8|9][0-9]{9}$",message="手机号格式不正确!")
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private String username;
|
||||
|
||||
@NotBlank(groups = {AddGroup.class},message="密码不能为空!")
|
||||
@Null(groups = {UpdateGroup.class})
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private String password;
|
||||
|
||||
@Null(groups = {AddGroup.class})
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private String nickName;
|
||||
|
||||
@Null(groups = {AddGroup.class})
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private String userPhoto;
|
||||
|
||||
@Null(groups = {AddGroup.class})
|
||||
@Min(value = 0,groups = {UpdateGroup.class})
|
||||
@Max(value = 1,groups = {UpdateGroup.class})
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Byte userSex;
|
||||
|
||||
@Null(groups = {AddGroup.class,UpdateGroup.class})
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Long accountBalance;
|
||||
|
||||
@Null(groups = {AddGroup.class,UpdateGroup.class})
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Byte status;
|
||||
|
||||
@Null(groups = {AddGroup.class,UpdateGroup.class})
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Date createTime;
|
||||
|
||||
@Null(groups = {AddGroup.class,UpdateGroup.class})
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Date updateTime;
|
||||
|
||||
|
@ -31,6 +31,9 @@ public final class BookIndexDynamicSqlSupport {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Integer> bookPrice = bookIndex.bookPrice;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<String> storageType = bookIndex.storageType;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Date> createTime = bookIndex.createTime;
|
||||
|
||||
@ -53,6 +56,8 @@ public final class BookIndexDynamicSqlSupport {
|
||||
|
||||
public final SqlColumn<Integer> bookPrice = column("book_price", JDBCType.INTEGER);
|
||||
|
||||
public final SqlColumn<String> storageType = column("storage_type", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<Date> createTime = column("create_time", JDBCType.TIMESTAMP);
|
||||
|
||||
public final SqlColumn<Date> updateTime = column("update_time", JDBCType.TIMESTAMP);
|
||||
|
@ -37,46 +37,47 @@ import org.mybatis.dynamic.sql.util.mybatis3.MyBatis3Utils;
|
||||
@Mapper
|
||||
public interface BookIndexMapper {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
BasicColumn[] selectList = BasicColumn.columnList(id, bookId, indexNum, indexName, wordCount, isVip, bookPrice, createTime, updateTime);
|
||||
BasicColumn[] selectList = BasicColumn.columnList(id, bookId, indexNum, indexName, wordCount, isVip, bookPrice, storageType, createTime, updateTime);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@SelectProvider(type = SqlProviderAdapter.class, method = "select")
|
||||
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||
long count(SelectStatementProvider selectStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@DeleteProvider(type = SqlProviderAdapter.class, method = "delete")
|
||||
@DeleteProvider(type=SqlProviderAdapter.class, method="delete")
|
||||
int delete(DeleteStatementProvider deleteStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@InsertProvider(type = SqlProviderAdapter.class, method = "insert")
|
||||
@InsertProvider(type=SqlProviderAdapter.class, method="insert")
|
||||
int insert(InsertStatementProvider<BookIndex> insertStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@InsertProvider(type = SqlProviderAdapter.class, method = "insertMultiple")
|
||||
@InsertProvider(type=SqlProviderAdapter.class, method="insertMultiple")
|
||||
int insertMultiple(MultiRowInsertStatementProvider<BookIndex> multipleInsertStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@SelectProvider(type = SqlProviderAdapter.class, method = "select")
|
||||
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||
@ResultMap("BookIndexResult")
|
||||
Optional<BookIndex> selectOne(SelectStatementProvider selectStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@SelectProvider(type = SqlProviderAdapter.class, method = "select")
|
||||
@Results(id = "BookIndexResult", value = {
|
||||
@Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
|
||||
@Result(column = "book_id", property = "bookId", jdbcType = JdbcType.BIGINT),
|
||||
@Result(column = "index_num", property = "indexNum", jdbcType = JdbcType.INTEGER),
|
||||
@Result(column = "index_name", property = "indexName", jdbcType = JdbcType.VARCHAR),
|
||||
@Result(column = "word_count", property = "wordCount", jdbcType = JdbcType.INTEGER),
|
||||
@Result(column = "is_vip", property = "isVip", jdbcType = JdbcType.TINYINT),
|
||||
@Result(column = "book_price", property = "bookPrice", jdbcType = JdbcType.INTEGER),
|
||||
@Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
|
||||
@Result(column = "update_time", property = "updateTime", jdbcType = JdbcType.TIMESTAMP)
|
||||
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||
@Results(id="BookIndexResult", value = {
|
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
|
||||
@Result(column="book_id", property="bookId", jdbcType=JdbcType.BIGINT),
|
||||
@Result(column="index_num", property="indexNum", jdbcType=JdbcType.INTEGER),
|
||||
@Result(column="index_name", property="indexName", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="word_count", property="wordCount", jdbcType=JdbcType.INTEGER),
|
||||
@Result(column="is_vip", property="isVip", jdbcType=JdbcType.TINYINT),
|
||||
@Result(column="book_price", property="bookPrice", jdbcType=JdbcType.INTEGER),
|
||||
@Result(column="storage_type", property="storageType", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
|
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
|
||||
})
|
||||
List<BookIndex> selectMany(SelectStatementProvider selectStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@UpdateProvider(type = SqlProviderAdapter.class, method = "update")
|
||||
@UpdateProvider(type=SqlProviderAdapter.class, method="update")
|
||||
int update(UpdateStatementProvider updateStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@ -92,52 +93,55 @@ public interface BookIndexMapper {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int deleteByPrimaryKey(Long id_) {
|
||||
return delete(c ->
|
||||
c.where(id, isEqualTo(id_))
|
||||
c.where(id, isEqualTo(id_))
|
||||
);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int insert(BookIndex record) {
|
||||
return MyBatis3Utils.insert(this::insert, record, bookIndex, c ->
|
||||
c.map(id).toProperty("id")
|
||||
.map(bookId).toProperty("bookId")
|
||||
.map(indexNum).toProperty("indexNum")
|
||||
.map(indexName).toProperty("indexName")
|
||||
.map(wordCount).toProperty("wordCount")
|
||||
.map(isVip).toProperty("isVip")
|
||||
.map(bookPrice).toProperty("bookPrice")
|
||||
.map(createTime).toProperty("createTime")
|
||||
.map(updateTime).toProperty("updateTime")
|
||||
c.map(id).toProperty("id")
|
||||
.map(bookId).toProperty("bookId")
|
||||
.map(indexNum).toProperty("indexNum")
|
||||
.map(indexName).toProperty("indexName")
|
||||
.map(wordCount).toProperty("wordCount")
|
||||
.map(isVip).toProperty("isVip")
|
||||
.map(bookPrice).toProperty("bookPrice")
|
||||
.map(storageType).toProperty("storageType")
|
||||
.map(createTime).toProperty("createTime")
|
||||
.map(updateTime).toProperty("updateTime")
|
||||
);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int insertMultiple(Collection<BookIndex> records) {
|
||||
return MyBatis3Utils.insertMultiple(this::insertMultiple, records, bookIndex, c ->
|
||||
c.map(id).toProperty("id")
|
||||
.map(bookId).toProperty("bookId")
|
||||
.map(indexNum).toProperty("indexNum")
|
||||
.map(indexName).toProperty("indexName")
|
||||
.map(wordCount).toProperty("wordCount")
|
||||
.map(isVip).toProperty("isVip")
|
||||
.map(bookPrice).toProperty("bookPrice")
|
||||
.map(createTime).toProperty("createTime")
|
||||
.map(updateTime).toProperty("updateTime")
|
||||
c.map(id).toProperty("id")
|
||||
.map(bookId).toProperty("bookId")
|
||||
.map(indexNum).toProperty("indexNum")
|
||||
.map(indexName).toProperty("indexName")
|
||||
.map(wordCount).toProperty("wordCount")
|
||||
.map(isVip).toProperty("isVip")
|
||||
.map(bookPrice).toProperty("bookPrice")
|
||||
.map(storageType).toProperty("storageType")
|
||||
.map(createTime).toProperty("createTime")
|
||||
.map(updateTime).toProperty("updateTime")
|
||||
);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int insertSelective(BookIndex record) {
|
||||
return MyBatis3Utils.insert(this::insert, record, bookIndex, c ->
|
||||
c.map(id).toPropertyWhenPresent("id", record::getId)
|
||||
.map(bookId).toPropertyWhenPresent("bookId", record::getBookId)
|
||||
.map(indexNum).toPropertyWhenPresent("indexNum", record::getIndexNum)
|
||||
.map(indexName).toPropertyWhenPresent("indexName", record::getIndexName)
|
||||
.map(wordCount).toPropertyWhenPresent("wordCount", record::getWordCount)
|
||||
.map(isVip).toPropertyWhenPresent("isVip", record::getIsVip)
|
||||
.map(bookPrice).toPropertyWhenPresent("bookPrice", record::getBookPrice)
|
||||
.map(createTime).toPropertyWhenPresent("createTime", record::getCreateTime)
|
||||
.map(updateTime).toPropertyWhenPresent("updateTime", record::getUpdateTime)
|
||||
c.map(id).toPropertyWhenPresent("id", record::getId)
|
||||
.map(bookId).toPropertyWhenPresent("bookId", record::getBookId)
|
||||
.map(indexNum).toPropertyWhenPresent("indexNum", record::getIndexNum)
|
||||
.map(indexName).toPropertyWhenPresent("indexName", record::getIndexName)
|
||||
.map(wordCount).toPropertyWhenPresent("wordCount", record::getWordCount)
|
||||
.map(isVip).toPropertyWhenPresent("isVip", record::getIsVip)
|
||||
.map(bookPrice).toPropertyWhenPresent("bookPrice", record::getBookPrice)
|
||||
.map(storageType).toPropertyWhenPresent("storageType", record::getStorageType)
|
||||
.map(createTime).toPropertyWhenPresent("createTime", record::getCreateTime)
|
||||
.map(updateTime).toPropertyWhenPresent("updateTime", record::getUpdateTime)
|
||||
);
|
||||
}
|
||||
|
||||
@ -159,7 +163,7 @@ public interface BookIndexMapper {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default Optional<BookIndex> selectByPrimaryKey(Long id_) {
|
||||
return selectOne(c ->
|
||||
c.where(id, isEqualTo(id_))
|
||||
c.where(id, isEqualTo(id_))
|
||||
);
|
||||
}
|
||||
|
||||
@ -177,6 +181,7 @@ public interface BookIndexMapper {
|
||||
.set(wordCount).equalTo(record::getWordCount)
|
||||
.set(isVip).equalTo(record::getIsVip)
|
||||
.set(bookPrice).equalTo(record::getBookPrice)
|
||||
.set(storageType).equalTo(record::getStorageType)
|
||||
.set(createTime).equalTo(record::getCreateTime)
|
||||
.set(updateTime).equalTo(record::getUpdateTime);
|
||||
}
|
||||
@ -190,6 +195,7 @@ public interface BookIndexMapper {
|
||||
.set(wordCount).equalToWhenPresent(record::getWordCount)
|
||||
.set(isVip).equalToWhenPresent(record::getIsVip)
|
||||
.set(bookPrice).equalToWhenPresent(record::getBookPrice)
|
||||
.set(storageType).equalToWhenPresent(record::getStorageType)
|
||||
.set(createTime).equalToWhenPresent(record::getCreateTime)
|
||||
.set(updateTime).equalToWhenPresent(record::getUpdateTime);
|
||||
}
|
||||
@ -197,30 +203,32 @@ public interface BookIndexMapper {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int updateByPrimaryKey(BookIndex record) {
|
||||
return update(c ->
|
||||
c.set(bookId).equalTo(record::getBookId)
|
||||
.set(indexNum).equalTo(record::getIndexNum)
|
||||
.set(indexName).equalTo(record::getIndexName)
|
||||
.set(wordCount).equalTo(record::getWordCount)
|
||||
.set(isVip).equalTo(record::getIsVip)
|
||||
.set(bookPrice).equalTo(record::getBookPrice)
|
||||
.set(createTime).equalTo(record::getCreateTime)
|
||||
.set(updateTime).equalTo(record::getUpdateTime)
|
||||
.where(id, isEqualTo(record::getId))
|
||||
c.set(bookId).equalTo(record::getBookId)
|
||||
.set(indexNum).equalTo(record::getIndexNum)
|
||||
.set(indexName).equalTo(record::getIndexName)
|
||||
.set(wordCount).equalTo(record::getWordCount)
|
||||
.set(isVip).equalTo(record::getIsVip)
|
||||
.set(bookPrice).equalTo(record::getBookPrice)
|
||||
.set(storageType).equalTo(record::getStorageType)
|
||||
.set(createTime).equalTo(record::getCreateTime)
|
||||
.set(updateTime).equalTo(record::getUpdateTime)
|
||||
.where(id, isEqualTo(record::getId))
|
||||
);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int updateByPrimaryKeySelective(BookIndex record) {
|
||||
return update(c ->
|
||||
c.set(bookId).equalToWhenPresent(record::getBookId)
|
||||
.set(indexNum).equalToWhenPresent(record::getIndexNum)
|
||||
.set(indexName).equalToWhenPresent(record::getIndexName)
|
||||
.set(wordCount).equalToWhenPresent(record::getWordCount)
|
||||
.set(isVip).equalToWhenPresent(record::getIsVip)
|
||||
.set(bookPrice).equalToWhenPresent(record::getBookPrice)
|
||||
.set(createTime).equalToWhenPresent(record::getCreateTime)
|
||||
.set(updateTime).equalToWhenPresent(record::getUpdateTime)
|
||||
.where(id, isEqualTo(record::getId))
|
||||
c.set(bookId).equalToWhenPresent(record::getBookId)
|
||||
.set(indexNum).equalToWhenPresent(record::getIndexNum)
|
||||
.set(indexName).equalToWhenPresent(record::getIndexName)
|
||||
.set(wordCount).equalToWhenPresent(record::getWordCount)
|
||||
.set(isVip).equalToWhenPresent(record::getIsVip)
|
||||
.set(bookPrice).equalToWhenPresent(record::getBookPrice)
|
||||
.set(storageType).equalToWhenPresent(record::getStorageType)
|
||||
.set(createTime).equalToWhenPresent(record::getCreateTime)
|
||||
.set(updateTime).equalToWhenPresent(record::getUpdateTime)
|
||||
.where(id, isEqualTo(record::getId))
|
||||
);
|
||||
}
|
||||
}
|
@ -25,6 +25,9 @@ public final class NewsDynamicSqlSupport {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<String> title = news.title;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Long> readCount = news.readCount;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Date> createTime = news.createTime;
|
||||
|
||||
@ -52,6 +55,8 @@ public final class NewsDynamicSqlSupport {
|
||||
|
||||
public final SqlColumn<String> title = column("title", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<Long> readCount = column("read_count", JDBCType.BIGINT);
|
||||
|
||||
public final SqlColumn<Date> createTime = column("create_time", JDBCType.TIMESTAMP);
|
||||
|
||||
public final SqlColumn<Long> createUserId = column("create_user_id", JDBCType.BIGINT);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user