From b2797633838a6d422bef39dcc3c37e35d35dd891 Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <773861846@qq.com> Date: Tue, 1 Dec 2020 05:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=A6=96=E9=A1=B5=E6=9B=B4?= =?UTF-8?q?=20=E6=96=B0=EF=BC=8C=E6=96=B0=E5=A2=9E=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E6=80=BB=E6=95=B0/=E4=BD=9C=E5=AE=B6=E6=80=BB=E6=95=B0/?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=80=BB=E6=95=B0/=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E6=80=BB=E6=95=B0=E7=BB=9F=E8=AE=A1=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?7=E6=97=A5=E5=86=85=E4=BC=9A=E5=91=98=E6=96=B0=E5=A2=9E/?= =?UTF-8?q?=E4=BD=9C=E5=AE=B6=E6=96=B0=E5=A2=9E/=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E6=96=B0=E5=A2=9E/=E4=BA=A4=E6=98=93=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/UserController.java" | 135 +++++ .../java/com/java2nb/system/dao/UserDao.java" | 32 ++ .../com/java2nb/system/domain/UserDO.java" | 177 +++++++ .../java2nb/system/service/UserService.java" | 30 ++ .../system/service/impl/UserServiceImpl.java" | 55 ++ .../resources/mybatis/system/UserMapper.xml" | 138 +++++ .../static/js/appjs/system/user/add.js" | 107 ++++ .../static/js/appjs/system/user/edit.js" | 103 ++++ .../static/js/appjs/system/user/user.js" | 231 ++++++++ .../resources/static/sql/system/user/menu.js" | 18 + .../resources/templates/system/user/add.html" | 113 ++++ .../templates/system/user/detail.html" | 110 ++++ .../templates/system/user/edit.html" | 115 ++++ .../templates/system/user/user.html" | 66 +++ .../com/java2nb/common/utils/DateUtils.java | 37 ++ .../novel/controller/BookController.java | 135 +++++ .../novel/controller/PayController.java | 135 +++++ .../novel/controller/StatController.java | 83 +++ .../novel/controller/UserController.java | 135 +++++ .../java/com/java2nb/novel/dao/AuthorDao.java | 3 + .../java/com/java2nb/novel/dao/BookDao.java | 35 ++ .../java/com/java2nb/novel/dao/PayDao.java | 35 ++ .../java/com/java2nb/novel/dao/UserDao.java | 35 ++ .../java/com/java2nb/novel/domain/BookDO.java | 493 ++++++++++++++++++ .../java/com/java2nb/novel/domain/PayDO.java | 166 ++++++ .../java/com/java2nb/novel/domain/UserDO.java | 177 +++++++ .../java2nb/novel/service/AuthorService.java | 3 + .../java2nb/novel/service/BookService.java | 33 ++ .../com/java2nb/novel/service/PayService.java | 33 ++ .../java2nb/novel/service/UserService.java | 33 ++ .../novel/service/impl/AuthorServiceImpl.java | 13 +- .../novel/service/impl/BookServiceImpl.java | 65 +++ .../novel/service/impl/PayServiceImpl.java | 66 +++ .../novel/service/impl/UserServiceImpl.java | 65 +++ ...Controller.java => SysUserController.java} | 6 +- .../dao/{UserDao.java => SysUserDao.java} | 2 +- .../{UserService.java => SysUserService.java} | 2 +- .../system/service/impl/RoleServiceImpl.java | 4 +- ...rviceImpl.java => SysUserServiceImpl.java} | 10 +- .../com/java2nb/system/shiro/UserRealm.java | 6 +- .../resources/mybatis/novel/AuthorMapper.xml | 14 + .../resources/mybatis/novel/BookMapper.xml | 306 +++++++++++ .../resources/mybatis/novel/PayMapper.xml | 145 ++++++ .../resources/mybatis/novel/UserMapper.xml | 154 ++++++ .../resources/mybatis/system/UserMapper.xml | 2 +- .../static/js/appjs/novel/book/add.js | 107 ++++ .../static/js/appjs/novel/book/book.js | 363 +++++++++++++ .../static/js/appjs/novel/book/edit.js | 103 ++++ .../static/js/appjs/novel/pay/add.js | 107 ++++ .../static/js/appjs/novel/pay/edit.js | 103 ++++ .../static/js/appjs/novel/pay/pay.js | 225 ++++++++ .../static/js/appjs/novel/user/add.js | 107 ++++ .../static/js/appjs/novel/user/edit.js | 103 ++++ .../static/js/appjs/novel/user/user.js | 231 ++++++++ .../resources/static/sql/novel/book/menu.js | 18 + .../resources/static/sql/novel/pay/menu.js | 18 + .../resources/static/sql/novel/user/menu.js | 18 + .../src/main/resources/templates/main.html | 453 ++++++++-------- .../resources/templates/novel/book/add.html | 315 +++++++++++ .../resources/templates/novel/book/book.html | 66 +++ .../templates/novel/book/detail.html | 328 ++++++++++++ .../resources/templates/novel/book/edit.html | 317 +++++++++++ .../resources/templates/novel/pay/add.html | 104 ++++ .../resources/templates/novel/pay/detail.html | 100 ++++ .../resources/templates/novel/pay/edit.html | 106 ++++ .../resources/templates/novel/pay/pay.html | 66 +++ .../resources/templates/novel/user/add.html | 113 ++++ .../templates/novel/user/detail.html | 110 ++++ .../resources/templates/novel/user/edit.html | 115 ++++ .../resources/templates/novel/user/user.html | 66 +++ 70 files changed, 7369 insertions(+), 254 deletions(-) create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/controller/UserController.java" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/dao/UserDao.java" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/domain/UserDO.java" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/service/UserService.java" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/service/impl/UserServiceImpl.java" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/resources/mybatis/system/UserMapper.xml" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/add.js" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/edit.js" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/user.js" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/sql/system/user/menu.js" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/add.html" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/detail.html" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/edit.html" create mode 100644 "D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/user.html" create mode 100644 novel-admin/src/main/java/com/java2nb/novel/controller/BookController.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/controller/PayController.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/controller/StatController.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/controller/UserController.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/dao/BookDao.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/dao/PayDao.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/dao/UserDao.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/domain/PayDO.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/domain/UserDO.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/service/BookService.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/service/PayService.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/service/UserService.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/service/impl/BookServiceImpl.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/service/impl/PayServiceImpl.java create mode 100644 novel-admin/src/main/java/com/java2nb/novel/service/impl/UserServiceImpl.java rename novel-admin/src/main/java/com/java2nb/system/controller/{UserController.java => SysUserController.java} (97%) rename novel-admin/src/main/java/com/java2nb/system/dao/{UserDao.java => SysUserDao.java} (95%) rename novel-admin/src/main/java/com/java2nb/system/service/{UserService.java => SysUserService.java} (97%) rename novel-admin/src/main/java/com/java2nb/system/service/impl/{UserServiceImpl.java => SysUserServiceImpl.java} (97%) create mode 100644 novel-admin/src/main/resources/mybatis/novel/BookMapper.xml create mode 100644 novel-admin/src/main/resources/mybatis/novel/PayMapper.xml create mode 100644 novel-admin/src/main/resources/mybatis/novel/UserMapper.xml create mode 100644 novel-admin/src/main/resources/static/js/appjs/novel/book/add.js create mode 100644 novel-admin/src/main/resources/static/js/appjs/novel/book/book.js create mode 100644 novel-admin/src/main/resources/static/js/appjs/novel/book/edit.js create mode 100644 novel-admin/src/main/resources/static/js/appjs/novel/pay/add.js create mode 100644 novel-admin/src/main/resources/static/js/appjs/novel/pay/edit.js create mode 100644 novel-admin/src/main/resources/static/js/appjs/novel/pay/pay.js create mode 100644 novel-admin/src/main/resources/static/js/appjs/novel/user/add.js create mode 100644 novel-admin/src/main/resources/static/js/appjs/novel/user/edit.js create mode 100644 novel-admin/src/main/resources/static/js/appjs/novel/user/user.js create mode 100644 novel-admin/src/main/resources/static/sql/novel/book/menu.js create mode 100644 novel-admin/src/main/resources/static/sql/novel/pay/menu.js create mode 100644 novel-admin/src/main/resources/static/sql/novel/user/menu.js create mode 100644 novel-admin/src/main/resources/templates/novel/book/add.html create mode 100644 novel-admin/src/main/resources/templates/novel/book/book.html create mode 100644 novel-admin/src/main/resources/templates/novel/book/detail.html create mode 100644 novel-admin/src/main/resources/templates/novel/book/edit.html create mode 100644 novel-admin/src/main/resources/templates/novel/pay/add.html create mode 100644 novel-admin/src/main/resources/templates/novel/pay/detail.html create mode 100644 novel-admin/src/main/resources/templates/novel/pay/edit.html create mode 100644 novel-admin/src/main/resources/templates/novel/pay/pay.html create mode 100644 novel-admin/src/main/resources/templates/novel/user/add.html create mode 100644 novel-admin/src/main/resources/templates/novel/user/detail.html create mode 100644 novel-admin/src/main/resources/templates/novel/user/edit.html create mode 100644 novel-admin/src/main/resources/templates/novel/user/user.html diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/controller/UserController.java" "b/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/controller/UserController.java" new file mode 100644 index 0000000..f88810e --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/controller/UserController.java" @@ -0,0 +1,135 @@ +package com.java2nb.system.controller; + +import java.util.List; +import java.util.Map; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import io.swagger.annotations.ApiOperation; + + +import com.java2nb.system.domain.UserDO; +import com.java2nb.system.service.UserService; +import com.java2nb.common.utils.PageBean; +import com.java2nb.common.utils.Query; +import com.java2nb.common.utils.R; + +/** + * + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:46:33 + */ + +@Controller +@RequestMapping("/system/user") +public class UserController { + @Autowired + private UserService userService; + + @GetMapping() + @RequiresPermissions("system:user:user") + String User() { + return "system/user/user"; + } + + @ApiOperation(value = "获取列表", notes = "获取列表") + @ResponseBody + @GetMapping("/list") + @RequiresPermissions("system:user:user") + public R list(@RequestParam Map params) { + //查询列表数据 + Query query = new Query(params); + List 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(); + } + +} diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/dao/UserDao.java" "b/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/dao/UserDao.java" new file mode 100644 index 0000000..af50a51 --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/dao/UserDao.java" @@ -0,0 +1,32 @@ +package com.java2nb.system.dao; + +import com.java2nb.system.domain.UserDO; + +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; + +/** + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:46:33 + */ +@Mapper +public interface UserDao { + + UserDO get(Long id); + + List list(Map map); + + int count(Map map); + + int save(UserDO user); + + int update(UserDO user); + + int remove(Long id); + + int batchRemove(Long[] ids); +} diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/domain/UserDO.java" "b/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/domain/UserDO.java" new file mode 100644 index 0000000..f903dfe --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/domain/UserDO.java" @@ -0,0 +1,177 @@ +package com.java2nb.system.domain; + +import java.io.Serializable; + + +import java.math.BigDecimal; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.java2nb.common.jsonserializer.LongToStringSerializer; + + +import org.springframework.format.annotation.DateTimeFormat; +import java.util.Date; + + + +/** + * + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:46:33 + */ +public class UserDO implements Serializable { + private static final long serialVersionUID = 1L; + + + //主键 + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long id; + //登录名 + private String username; + //登录密码 + private String password; + //昵称 + private String nickName; + //用户头像 + private String userPhoto; + //用户性别,0:男,1:女 + private Integer userSex; + //账户余额 + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long accountBalance; + //用户状态,0:正常 + private Integer status; + //创建时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + //更新时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** + * 设置:主键 + */ + public void setId(Long id) { + this.id = id; + } + /** + * 获取:主键 + */ + public Long getId() { + return id; + } + /** + * 设置:登录名 + */ + public void setUsername(String username) { + this.username = username; + } + /** + * 获取:登录名 + */ + public String getUsername() { + return username; + } + /** + * 设置:登录密码 + */ + public void setPassword(String password) { + this.password = password; + } + /** + * 获取:登录密码 + */ + public String getPassword() { + return password; + } + /** + * 设置:昵称 + */ + public void setNickName(String nickName) { + this.nickName = nickName; + } + /** + * 获取:昵称 + */ + public String getNickName() { + return nickName; + } + /** + * 设置:用户头像 + */ + public void setUserPhoto(String userPhoto) { + this.userPhoto = userPhoto; + } + /** + * 获取:用户头像 + */ + public String getUserPhoto() { + return userPhoto; + } + /** + * 设置:用户性别,0:男,1:女 + */ + public void setUserSex(Integer userSex) { + this.userSex = userSex; + } + /** + * 获取:用户性别,0:男,1:女 + */ + public Integer getUserSex() { + return userSex; + } + /** + * 设置:账户余额 + */ + public void setAccountBalance(Long accountBalance) { + this.accountBalance = accountBalance; + } + /** + * 获取:账户余额 + */ + public Long getAccountBalance() { + return accountBalance; + } + /** + * 设置:用户状态,0:正常 + */ + public void setStatus(Integer status) { + this.status = status; + } + /** + * 获取:用户状态,0:正常 + */ + public Integer getStatus() { + return status; + } + /** + * 设置:创建时间 + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + /** + * 获取:创建时间 + */ + public Date getCreateTime() { + return createTime; + } + /** + * 设置:更新时间 + */ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + /** + * 获取:更新时间 + */ + public Date getUpdateTime() { + return updateTime; + } +} diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/service/UserService.java" "b/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/service/UserService.java" new file mode 100644 index 0000000..38c8b51 --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/service/UserService.java" @@ -0,0 +1,30 @@ +package com.java2nb.system.service; + +import com.java2nb.system.domain.UserDO; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:46:33 + */ +public interface UserService { + + UserDO get(Long id); + + List list(Map map); + + int count(Map map); + + int save(UserDO user); + + int update(UserDO user); + + int remove(Long id); + + int batchRemove(Long[] ids); +} diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/service/impl/UserServiceImpl.java" "b/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/service/impl/UserServiceImpl.java" new file mode 100644 index 0000000..53d7d1b --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/java/com/java2nb/system/service/impl/UserServiceImpl.java" @@ -0,0 +1,55 @@ +package com.java2nb.system.service.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +import com.java2nb.system.dao.UserDao; +import com.java2nb.system.domain.UserDO; +import com.java2nb.system.service.UserService; + + + +@Service +public class UserServiceImpl implements UserService { + @Autowired + private UserDao userDao; + + @Override + public UserDO get(Long id){ + return userDao.get(id); + } + + @Override + public List list(Map map){ + return userDao.list(map); + } + + @Override + public int count(Map 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); + } + +} diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/resources/mybatis/system/UserMapper.xml" "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/mybatis/system/UserMapper.xml" new file mode 100644 index 0000000..cbb3d5b --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/mybatis/system/UserMapper.xml" @@ -0,0 +1,138 @@ + + + + + + + + + + + + + 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 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} + ) + + + + update user + + `username` = #{username}, + `password` = #{password}, + `nick_name` = #{nickName}, + `user_photo` = #{userPhoto}, + `user_sex` = #{userSex}, + `account_balance` = #{accountBalance}, + `status` = #{status}, + `create_time` = #{createTime}, + `update_time` = #{updateTime} + + where id = #{id} + + + + delete from user where id = #{value} + + + + delete from user where id in + + #{id} + + + + \ No newline at end of file diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/add.js" "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/add.js" new file mode 100644 index 0000000..790371d --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/add.js" @@ -0,0 +1,107 @@ +var E = window.wangEditor; +$("[id^='contentEditor']").each(function (index, ele) { + var relName = $(ele).attr("id").substring(13); + var editor = new E('#contentEditor' + relName); +// 自定义菜单配置 + editor.customConfig.menus = [ + 'head', // 标题 + 'bold', // 粗体 + 'fontSize', // 字号 + 'fontName', // 字体 + 'italic', // 斜体 + 'underline', // 下划线 + 'strikeThrough', // 删除线 + 'foreColor', // 文字颜色 + //'backColor', // 背景颜色 + //'link', // 插入链接 + 'list', // 列表 + 'justify', // 对齐方式 + 'quote', // 引用 + 'emoticon', // 表情 + 'image', // 插入图片 + //'table', // 表格 + //'video', // 插入视频 + //'code', // 插入代码 + 'undo', // 撤销 + 'redo' // 重复 + ]; + editor.customConfig.onchange = function (html) { + // html 即变化之后的内容 + $("#" + relName).val(html); + } + editor.customConfig.uploadImgShowBase64 = true; + editor.create(); + +}) + +$("[id^='picImage']").each(function (index, ele) { + var relName = $(ele).attr("id").substring(8); + layui.use('upload', function () { + var upload = layui.upload; + //执行实例 + var uploadInst = upload.render({ + elem: '#picImage' + relName, //绑定元素 + url: '/common/sysFile/upload', //上传接口 + size: 1000, + accept: 'file', + done: function (r) { + $("#picImage" + relName).attr("src", r.fileName); + $("#" + relName).val(r.fileName); + }, + error: function (r) { + layer.msg(r.msg); + } + }); + }); + +}); + + + + + + +$().ready(function () { + validateRule(); +}); + +$.validator.setDefaults({ + submitHandler: function () { + save(); + } +}); +function save() { + $.ajax({ + cache: true, + type: "POST", + url: "/system/user/save", + data: $('#signupForm').serialize(),// 你的formid + async: false, + error: function (request) { + parent.layer.alert("Connection error"); + }, + success: function (data) { + if (data.code == 0) { + parent.layer.msg("操作成功"); + parent.reLoad(); + var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引 + parent.layer.close(index); + + } else { + parent.layer.alert(data.msg) + } + + } + }); + +} +function validateRule() { + var icon = " "; + $("#signupForm").validate({ + ignore: "", + rules: { + }, + messages: { + } +}) +} \ No newline at end of file diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/edit.js" "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/edit.js" new file mode 100644 index 0000000..fecfb95 --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/edit.js" @@ -0,0 +1,103 @@ +var E = window.wangEditor; +$("[id^='contentEditor']").each(function (index, ele) { + var relName = $(ele).attr("id").substring(13); + var editor = new E('#contentEditor' + relName); +// 自定义菜单配置 + editor.customConfig.menus = [ + 'head', // 标题 + 'bold', // 粗体 + 'fontSize', // 字号 + 'fontName', // 字体 + 'italic', // 斜体 + 'underline', // 下划线 + 'strikeThrough', // 删除线 + 'foreColor', // 文字颜色 + //'backColor', // 背景颜色 + //'link', // 插入链接 + 'list', // 列表 + 'justify', // 对齐方式 + 'quote', // 引用 + 'emoticon', // 表情 + 'image', // 插入图片 + //'table', // 表格 + //'video', // 插入视频 + //'code', // 插入代码 + 'undo', // 撤销 + 'redo' // 重复 + ]; + editor.customConfig.onchange = function (html) { + // html 即变化之后的内容 + $("#" + relName).val(html); + } + editor.customConfig.uploadImgShowBase64 = true; + editor.create(); + editor.txt.html($("#" + relName).val()); + +}) + +$("[id^='picImage']").each(function (index, ele) { + var relName = $(ele).attr("id").substring(8); + layui.use('upload', function () { + var upload = layui.upload; + //执行实例 + var uploadInst = upload.render({ + elem: '#picImage' + relName, //绑定元素 + url: '/common/sysFile/upload', //上传接口 + size: 1000, + accept: 'file', + done: function (r) { + $("#picImage" + relName).attr("src", r.fileName); + $("#" + relName).val(r.fileName); + }, + error: function (r) { + layer.msg(r.msg); + } + }); + }); + +}); + +$().ready(function () { + validateRule(); +}); + +$.validator.setDefaults({ + submitHandler: function () { + update(); + } +}); +function update() { + $.ajax({ + cache: true, + type: "POST", + url: "/system/user/update", + data: $('#signupForm').serialize(),// 你的formid + async: false, + error: function (request) { + parent.layer.alert("Connection error"); + }, + success: function (data) { + if (data.code == 0) { + parent.layer.msg("操作成功"); + parent.reLoad(); + var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引 + parent.layer.close(index); + + } else { + parent.layer.alert(data.msg) + } + + } + }); + +} +function validateRule() { + var icon = " "; + $("#signupForm").validate({ + ignore: "", + rules: { + }, + messages: { + } +}) +} \ No newline at end of file diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/user.js" "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/user.js" new file mode 100644 index 0000000..36cd101 --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/js/appjs/system/user/user.js" @@ -0,0 +1,231 @@ +var prefix = "/system/user" +$(function () { + load(); +}); + +function load() { + $('#exampleTable') + .bootstrapTable( + { + method: 'get', // 服务器数据的请求方式 get or post + url: prefix + "/list", // 服务器数据的加载地址 + // showRefresh : true, + // showToggle : true, + // showColumns : true, + iconSize: 'outline', + toolbar: '#exampleToolbar', + striped: true, // 设置为true会有隔行变色效果 + dataType: "json", // 服务器返回的数据类型 + pagination: true, // 设置为true会在底部显示分页条 + // queryParamsType : "limit", + // //设置为limit则会发送符合RESTFull格式的参数 + singleSelect: false, // 设置为true将禁止多选 + // contentType : "application/x-www-form-urlencoded", + // //发送到服务器的数据编码类型 + pageSize: 10, // 如果设置了分页,每页数据条数 + pageNumber: 1, // 如果设置了分布,首页页码 + //search : true, // 是否显示搜索框 + showColumns: false, // 是否显示内容下拉框(选择显示的列) + sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server" + queryParams: function (params) { + //说明:传入后台的参数包括offset开始索引,limit步长,sort排序列,order:desc或者,以及所有列的键值对 + var queryParams = getFormJson("searchForm"); + queryParams.limit = params.limit; + queryParams.offset = params.offset; + return queryParams; + }, + // //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果 + // queryParamsType = 'limit' ,返回参数必须包含 + // limit, offset, search, sort, order 否则, 需要包含: + // pageSize, pageNumber, searchText, sortName, + // sortOrder. + // 返回false将会终止请求 + responseHandler: function (rs) { + + if (rs.code == 0) { + return rs.data; + } else { + parent.layer.alert(rs.msg) + return {total: 0, rows: []}; + } + }, + columns: [ + { + checkbox: true + }, + { + title: '序号', + formatter: function () { + return arguments[2] + 1; + } + }, + { + field: 'id', + title: '主键' + }, + + + { + field: 'username', + title: '登录名' + }, + + + { + field: 'password', + title: '登录密码' + }, + + + { + field: 'nickName', + title: '昵称' + }, + + + { + field: 'userPhoto', + title: '用户头像' + }, + + + { + field: 'userSex', + title: '用户性别,0:男,1:女' + }, + + + { + field: 'accountBalance', + title: '账户余额' + }, + + + { + field: 'status', + title: '用户状态,0:正常' + }, + + + { + field: 'createTime', + title: '创建时间' + }, + + + { + field: 'updateTime', + title: '更新时间' + }, + + + { + title: '操作', + field: 'id', + align: 'center', + formatter: function (value, row, index) { + var d = ' '; + var e = ' '; + var r = ' '; + return d + e + r; + } + }] + }); +} +function reLoad() { + $('#exampleTable').bootstrapTable('refresh'); +} +function add() { + layer.open({ + type: 2, + title: '增加', + maxmin: true, + shadeClose: false, // 点击遮罩关闭层 + area: ['800px', '520px'], + content: prefix + '/add' // iframe的url + }); +} +function detail(id) { + layer.open({ + type: 2, + title: '详情', + maxmin: true, + shadeClose: false, // 点击遮罩关闭层 + area: ['800px', '520px'], + content: prefix + '/detail/' + id // iframe的url + }); +} +function edit(id) { + layer.open({ + type: 2, + title: '编辑', + maxmin: true, + shadeClose: false, // 点击遮罩关闭层 + area: ['800px', '520px'], + content: prefix + '/edit/' + id // iframe的url + }); +} +function remove(id) { + layer.confirm('确定要删除选中的记录?', { + btn: ['确定', '取消'] + }, function () { + $.ajax({ + url: prefix + "/remove", + type: "post", + data: { + 'id': id + }, + success: function (r) { + if (r.code == 0) { + layer.msg(r.msg); + reLoad(); + } else { + layer.msg(r.msg); + } + } + }); + }) +} + +function resetPwd(id) { +} +function batchRemove() { + var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组 + if (rows.length == 0) { + layer.msg("请选择要删除的数据"); + return; + } + layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", { + btn: ['确定', '取消'] + // 按钮 + }, function () { + var ids = new Array(); + // 遍历所有选择的行数据,取每条数据对应的ID + $.each(rows, function (i, row) { + ids[i] = row['id']; + }); + $.ajax({ + type: 'POST', + data: { + "ids": ids + }, + url: prefix + '/batchRemove', + success: function (r) { + if (r.code == 0) { + layer.msg(r.msg); + reLoad(); + } else { + layer.msg(r.msg); + } + } + }); + }, function () { + + }); +} \ No newline at end of file diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/sql/system/user/menu.js" "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/sql/system/user/menu.js" new file mode 100644 index 0000000..5ea286a --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/static/sql/system/user/menu.js" @@ -0,0 +1,18 @@ +-- 菜单SQL +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + VALUES ('1', '', 'system/user', 'system:user:user', '1', 'fa', '6'); + +-- 按钮父菜单ID +set @parentId = @@identity; + +-- 菜单对应按钮SQL +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + SELECT @parentId, '查看', null, 'system:user:detail', '2', null, '6'; +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + SELECT @parentId, '新增', null, 'system:user:add', '2', null, '6'; +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + SELECT @parentId, '修改', null, 'system:user:edit', '2', null, '6'; +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + SELECT @parentId, '删除', null, 'system:user:remove', '2', null, '6'; +INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`) + SELECT @parentId, '批量删除', null, 'system:user:batchRemove', '2', null, '6'; diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/add.html" "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/add.html" new file mode 100644 index 0000000..e8de6ff --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/add.html" @@ -0,0 +1,113 @@ + + + + + +
+
+
+
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + + + diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/detail.html" "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/detail.html" new file mode 100644 index 0000000..8494758 --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/detail.html" @@ -0,0 +1,110 @@ + + + + + +
+
+
+
+
+
+ +
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+ + diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/edit.html" "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/edit.html" new file mode 100644 index 0000000..f65d479 --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/edit.html" @@ -0,0 +1,115 @@ + + + + + +
+
+
+
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + + + diff --git "a/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/user.html" "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/user.html" new file mode 100644 index 0000000..577078b --- /dev/null +++ "b/D:\\gitee\\admin-base\\java2nb\\src/main/resources/templates/system/user/user.html" @@ -0,0 +1,66 @@ + + + + + +
+
+
+
+
+
+ + +
+
+ +
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + + \ No newline at end of file diff --git a/novel-admin/src/main/java/com/java2nb/common/utils/DateUtils.java b/novel-admin/src/main/java/com/java2nb/common/utils/DateUtils.java index 8263e84..0155625 100644 --- a/novel-admin/src/main/java/com/java2nb/common/utils/DateUtils.java +++ b/novel-admin/src/main/java/com/java2nb/common/utils/DateUtils.java @@ -1,10 +1,14 @@ package com.java2nb.common.utils; +import lombok.SneakyThrows; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; import java.util.Date; +import java.util.List; /** * 日期处理 @@ -91,4 +95,37 @@ public class DateUtils { r += "前"; return r; } + + /** + * 获取过去第几天的日期 + * + * @param past + * @return + */ + @SneakyThrows + public static String getPastDate(int past,Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - past); + Date today = calendar.getTime(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + return sdf.format(today); + } + + /** + * 获取过去几天的日期集合 + * + * @param past + * @return + */ + public static List getDateList(int past,Date date) { + List result = new ArrayList<>(past); + for(int i = past - 1 ; i > 0 ; i--){ + result.add(getPastDate(i,date)); + } + //今天的日期 + result.add(new SimpleDateFormat("yyyy-MM-dd").format(date)); + return result; + + } } diff --git a/novel-admin/src/main/java/com/java2nb/novel/controller/BookController.java b/novel-admin/src/main/java/com/java2nb/novel/controller/BookController.java new file mode 100644 index 0000000..0d03432 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/controller/BookController.java @@ -0,0 +1,135 @@ +package com.java2nb.novel.controller; + +import java.util.List; +import java.util.Map; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import io.swagger.annotations.ApiOperation; + + +import com.java2nb.novel.domain.BookDO; +import com.java2nb.novel.service.BookService; +import com.java2nb.common.utils.PageBean; +import com.java2nb.common.utils.Query; +import com.java2nb.common.utils.R; + +/** + * 小说表 + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:46 + */ + +@Controller +@RequestMapping("/novel/book") +public class BookController { + @Autowired + private BookService bookService; + + @GetMapping() + @RequiresPermissions("novel:book:book") + String Book() { + return "novel/book/book"; + } + + @ApiOperation(value = "获取小说表列表", notes = "获取小说表列表") + @ResponseBody + @GetMapping("/list") + @RequiresPermissions("novel:book:book") + public R list(@RequestParam Map params) { + //查询列表数据 + Query query = new Query(params); + List bookList = bookService.list(query); + int total = bookService.count(query); + PageBean pageBean = new PageBean(bookList, total); + return R.ok().put("data", pageBean); + } + + @ApiOperation(value = "新增小说表页面", notes = "新增小说表页面") + @GetMapping("/add") + @RequiresPermissions("novel:book:add") + String add() { + return "novel/book/add"; + } + + @ApiOperation(value = "修改小说表页面", notes = "修改小说表页面") + @GetMapping("/edit/{id}") + @RequiresPermissions("novel:book:edit") + String edit(@PathVariable("id") Long id, Model model) { + BookDO book = bookService.get(id); + model.addAttribute("book", book); + return "novel/book/edit"; + } + + @ApiOperation(value = "查看小说表页面", notes = "查看小说表页面") + @GetMapping("/detail/{id}") + @RequiresPermissions("novel:book:detail") + String detail(@PathVariable("id") Long id, Model model) { + BookDO book = bookService.get(id); + model.addAttribute("book", book); + return "novel/book/detail"; + } + + /** + * 保存 + */ + @ApiOperation(value = "新增小说表", notes = "新增小说表") + @ResponseBody + @PostMapping("/save") + @RequiresPermissions("novel:book:add") + public R save( BookDO book) { + if (bookService.save(book) > 0) { + return R.ok(); + } + return R.error(); + } + + /** + * 修改 + */ + @ApiOperation(value = "修改小说表", notes = "修改小说表") + @ResponseBody + @RequestMapping("/update") + @RequiresPermissions("novel:book:edit") + public R update( BookDO book) { + bookService.update(book); + return R.ok(); + } + + /** + * 删除 + */ + @ApiOperation(value = "删除小说表", notes = "删除小说表") + @PostMapping("/remove") + @ResponseBody + @RequiresPermissions("novel:book:remove") + public R remove( Long id) { + if (bookService.remove(id) > 0) { + return R.ok(); + } + return R.error(); + } + + /** + * 删除 + */ + @ApiOperation(value = "批量删除小说表", notes = "批量删除小说表") + @PostMapping("/batchRemove") + @ResponseBody + @RequiresPermissions("novel:book:batchRemove") + public R remove(@RequestParam("ids[]") Long[] ids) { + bookService.batchRemove(ids); + return R.ok(); + } + +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/controller/PayController.java b/novel-admin/src/main/java/com/java2nb/novel/controller/PayController.java new file mode 100644 index 0000000..8ab725d --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/controller/PayController.java @@ -0,0 +1,135 @@ +package com.java2nb.novel.controller; + +import java.util.List; +import java.util.Map; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import io.swagger.annotations.ApiOperation; + + +import com.java2nb.novel.domain.PayDO; +import com.java2nb.novel.service.PayService; +import com.java2nb.common.utils.PageBean; +import com.java2nb.common.utils.Query; +import com.java2nb.common.utils.R; + +/** + * 充值订单 + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:57 + */ + +@Controller +@RequestMapping("/novel/pay") +public class PayController { + @Autowired + private PayService payService; + + @GetMapping() + @RequiresPermissions("novel:pay:pay") + String Pay() { + return "novel/pay/pay"; + } + + @ApiOperation(value = "获取充值订单列表", notes = "获取充值订单列表") + @ResponseBody + @GetMapping("/list") + @RequiresPermissions("novel:pay:pay") + public R list(@RequestParam Map params) { + //查询列表数据 + Query query = new Query(params); + List payList = payService.list(query); + int total = payService.count(query); + PageBean pageBean = new PageBean(payList, total); + return R.ok().put("data", pageBean); + } + + @ApiOperation(value = "新增充值订单页面", notes = "新增充值订单页面") + @GetMapping("/add") + @RequiresPermissions("novel:pay:add") + String add() { + return "novel/pay/add"; + } + + @ApiOperation(value = "修改充值订单页面", notes = "修改充值订单页面") + @GetMapping("/edit/{id}") + @RequiresPermissions("novel:pay:edit") + String edit(@PathVariable("id") Long id, Model model) { + PayDO pay = payService.get(id); + model.addAttribute("pay", pay); + return "novel/pay/edit"; + } + + @ApiOperation(value = "查看充值订单页面", notes = "查看充值订单页面") + @GetMapping("/detail/{id}") + @RequiresPermissions("novel:pay:detail") + String detail(@PathVariable("id") Long id, Model model) { + PayDO pay = payService.get(id); + model.addAttribute("pay", pay); + return "novel/pay/detail"; + } + + /** + * 保存 + */ + @ApiOperation(value = "新增充值订单", notes = "新增充值订单") + @ResponseBody + @PostMapping("/save") + @RequiresPermissions("novel:pay:add") + public R save( PayDO pay) { + if (payService.save(pay) > 0) { + return R.ok(); + } + return R.error(); + } + + /** + * 修改 + */ + @ApiOperation(value = "修改充值订单", notes = "修改充值订单") + @ResponseBody + @RequestMapping("/update") + @RequiresPermissions("novel:pay:edit") + public R update( PayDO pay) { + payService.update(pay); + return R.ok(); + } + + /** + * 删除 + */ + @ApiOperation(value = "删除充值订单", notes = "删除充值订单") + @PostMapping("/remove") + @ResponseBody + @RequiresPermissions("novel:pay:remove") + public R remove( Long id) { + if (payService.remove(id) > 0) { + return R.ok(); + } + return R.error(); + } + + /** + * 删除 + */ + @ApiOperation(value = "批量删除充值订单", notes = "批量删除充值订单") + @PostMapping("/batchRemove") + @ResponseBody + @RequiresPermissions("novel:pay:batchRemove") + public R remove(@RequestParam("ids[]") Long[] ids) { + payService.batchRemove(ids); + return R.ok(); + } + +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/controller/StatController.java b/novel-admin/src/main/java/com/java2nb/novel/controller/StatController.java new file mode 100644 index 0000000..3816599 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/controller/StatController.java @@ -0,0 +1,83 @@ +package com.java2nb.novel.controller; + +import com.java2nb.common.utils.DateUtils; +import com.java2nb.common.utils.PageBean; +import com.java2nb.common.utils.Query; +import com.java2nb.common.utils.R; +import com.java2nb.novel.domain.AuthorCodeDO; +import com.java2nb.novel.service.*; +import com.java2nb.test.service.OrderService; +import io.swagger.annotations.ApiOperation; +import lombok.SneakyThrows; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.*; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 统计 + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:40:12 + */ + +@Controller +@RequestMapping("/novel/stat") +public class StatController { + @Autowired + private UserService userService; + + @Autowired + private AuthorService authorService; + + @Autowired + private BookService bookService; + + @Autowired + private PayService orderPayService; + + + @ResponseBody + @GetMapping("/countSta") + public R countUser() { + Map map = new HashMap<>(0); + int userCount = userService.count(map); + int authorCount = authorService.count(map); + int bookCount = bookService.count(map); + int orderCount = orderPayService.count(map); + return R.ok().put("userCount",userCount) + .put("authorCount",authorCount) + .put("bookCount",bookCount) + .put("orderCount",orderCount); + } + + @ResponseBody + @GetMapping("/tableSta") + @SneakyThrows + public R tableSta() { + Date currentDate = new Date(); + List dateList = DateUtils.getDateList(7,currentDate); + Date minDate = new SimpleDateFormat("yyyy-MM-dd").parse(dateList.get(0)); + Map userTableSta = userService.tableSta(minDate); + Map bookTableSta = bookService.tableSta(minDate); + Map authorTableSta = authorService.tableSta(minDate); + Map orderTableSta = orderPayService.tableSta(minDate); + return R.ok().put("dateList",dateList) + .put("userTableSta",userTableSta) + .put("bookTableSta",bookTableSta) + .put("authorTableSta",authorTableSta) + .put("orderTableSta",orderTableSta) + ; + } + + + +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/controller/UserController.java b/novel-admin/src/main/java/com/java2nb/novel/controller/UserController.java new file mode 100644 index 0000000..cfe5d15 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/controller/UserController.java @@ -0,0 +1,135 @@ +package com.java2nb.novel.controller; + +import java.util.List; +import java.util.Map; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import io.swagger.annotations.ApiOperation; + + +import com.java2nb.novel.domain.UserDO; +import com.java2nb.novel.service.UserService; +import com.java2nb.common.utils.PageBean; +import com.java2nb.common.utils.Query; +import com.java2nb.common.utils.R; + +/** + * + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:08 + */ + +@Controller +@RequestMapping("/novel/user") +public class UserController { + @Autowired + private UserService userService; + + @GetMapping() + @RequiresPermissions("novel:user:user") + String User() { + return "novel/user/user"; + } + + @ApiOperation(value = "获取列表", notes = "获取列表") + @ResponseBody + @GetMapping("/list") + @RequiresPermissions("novel:user:user") + public R list(@RequestParam Map params) { + //查询列表数据 + Query query = new Query(params); + List userList = userService.list(query); + int total = userService.count(query); + PageBean pageBean = new PageBean(userList, total); + return R.ok().put("data", pageBean); + } + + @ApiOperation(value = "新增页面", notes = "新增页面") + @GetMapping("/add") + @RequiresPermissions("novel:user:add") + String add() { + return "novel/user/add"; + } + + @ApiOperation(value = "修改页面", notes = "修改页面") + @GetMapping("/edit/{id}") + @RequiresPermissions("novel:user:edit") + String edit(@PathVariable("id") Long id, Model model) { + UserDO user = userService.get(id); + model.addAttribute("user", user); + return "novel/user/edit"; + } + + @ApiOperation(value = "查看页面", notes = "查看页面") + @GetMapping("/detail/{id}") + @RequiresPermissions("novel:user:detail") + String detail(@PathVariable("id") Long id, Model model) { + UserDO user = userService.get(id); + model.addAttribute("user", user); + return "novel/user/detail"; + } + + /** + * 保存 + */ + @ApiOperation(value = "新增", notes = "新增") + @ResponseBody + @PostMapping("/save") + @RequiresPermissions("novel:user:add") + public R save( UserDO user) { + if (userService.save(user) > 0) { + return R.ok(); + } + return R.error(); + } + + /** + * 修改 + */ + @ApiOperation(value = "修改", notes = "修改") + @ResponseBody + @RequestMapping("/update") + @RequiresPermissions("novel:user:edit") + public R update( UserDO user) { + userService.update(user); + return R.ok(); + } + + /** + * 删除 + */ + @ApiOperation(value = "删除", notes = "删除") + @PostMapping("/remove") + @ResponseBody + @RequiresPermissions("novel:user:remove") + public R remove( Long id) { + if (userService.remove(id) > 0) { + return R.ok(); + } + return R.error(); + } + + /** + * 删除 + */ + @ApiOperation(value = "批量删除", notes = "批量删除") + @PostMapping("/batchRemove") + @ResponseBody + @RequiresPermissions("novel:user:batchRemove") + public R remove(@RequestParam("ids[]") Long[] ids) { + userService.batchRemove(ids); + return R.ok(); + } + +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/dao/AuthorDao.java b/novel-admin/src/main/java/com/java2nb/novel/dao/AuthorDao.java index cafdce8..9dd6632 100644 --- a/novel-admin/src/main/java/com/java2nb/novel/dao/AuthorDao.java +++ b/novel-admin/src/main/java/com/java2nb/novel/dao/AuthorDao.java @@ -2,6 +2,7 @@ package com.java2nb.novel.dao; import com.java2nb.novel.domain.AuthorDO; +import java.util.Date; import java.util.List; import java.util.Map; @@ -29,4 +30,6 @@ public interface AuthorDao { int remove(Long id); int batchRemove(Long[] ids); + + List> tableSta(Date minDate); } diff --git a/novel-admin/src/main/java/com/java2nb/novel/dao/BookDao.java b/novel-admin/src/main/java/com/java2nb/novel/dao/BookDao.java new file mode 100644 index 0000000..f2ba193 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/dao/BookDao.java @@ -0,0 +1,35 @@ +package com.java2nb.novel.dao; + +import com.java2nb.novel.domain.BookDO; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 小说表 + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:46 + */ +@Mapper +public interface BookDao { + + BookDO get(Long id); + + List list(Map map); + + int count(Map map); + + int save(BookDO book); + + int update(BookDO book); + + int remove(Long id); + + int batchRemove(Long[] ids); + + List> tableSta(Date minDate); +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/dao/PayDao.java b/novel-admin/src/main/java/com/java2nb/novel/dao/PayDao.java new file mode 100644 index 0000000..acb672e --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/dao/PayDao.java @@ -0,0 +1,35 @@ +package com.java2nb.novel.dao; + +import com.java2nb.novel.domain.PayDO; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 充值订单 + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:57 + */ +@Mapper +public interface PayDao { + + PayDO get(Long id); + + List list(Map map); + + int count(Map map); + + int save(PayDO pay); + + int update(PayDO pay); + + int remove(Long id); + + int batchRemove(Long[] ids); + + List> tableSta(Date minDate); +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/dao/UserDao.java b/novel-admin/src/main/java/com/java2nb/novel/dao/UserDao.java new file mode 100644 index 0000000..81eb056 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/dao/UserDao.java @@ -0,0 +1,35 @@ +package com.java2nb.novel.dao; + +import com.java2nb.novel.domain.UserDO; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.apache.ibatis.annotations.Mapper; + +/** + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:08 + */ +@Mapper +public interface UserDao { + + UserDO get(Long id); + + List list(Map map); + + int count(Map map); + + int save(UserDO user); + + int update(UserDO user); + + int remove(Long id); + + int batchRemove(Long[] ids); + + List> tableSta(Date minDate); +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java b/novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java new file mode 100644 index 0000000..4df2055 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/domain/BookDO.java @@ -0,0 +1,493 @@ +package com.java2nb.novel.domain; + +import java.io.Serializable; + + +import java.math.BigDecimal; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.java2nb.common.jsonserializer.LongToStringSerializer; + + +import org.springframework.format.annotation.DateTimeFormat; +import java.util.Date; + + + +/** + * 小说表 + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:46 + */ +public class BookDO implements Serializable { + private static final long serialVersionUID = 1L; + + + //主键 + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long id; + //作品方向,0:男频,1:女频' + private Integer workDirection; + //分类ID + private Integer catId; + //分类名 + private String catName; + //子分类ID + private Integer catChildId; + //子分类名 + private String catChildName; + //小说封面 + private String picUrl; + //小说名 + private String bookName; + //男主角姓名 + private String heroName; + //女主角姓名 + private String ladyName; + //作品风格,0:甜宠,1:虐恋,2:其他 + private Integer bookStyle; + //作品标签 + private String bookLabel; + //作者id + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long authorId; + //作者名 + private String authorName; + //书籍描述 + private String bookDesc; + //评分,预留字段 + private Float score; + //书籍状态,0:连载中,1:已完结 + private Integer bookStatus; + //点击量 + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long visitCount; + //总字数 + private Integer wordCount; + //评论数 + private Integer commentCount; + //昨日订阅数 + private Integer yesterdayBuy; + //最新目录ID + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long lastIndexId; + //最新目录名 + private String lastIndexName; + //最新目录更新时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date lastIndexUpdateTime; + //是否收费,1:收费,0:免费 + private Integer isVip; + //状态,0:入库,1:上架 + private Integer status; + //更新时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + //创建时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + //爬虫源站ID + private Integer crawlSourceId; + //抓取的源站小说ID + private String crawlBookId; + //最后一次的抓取时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date crawlLastTime; + //是否已停止更新,0:未停止,1:已停止 + private Integer crawlIsStop; + + /** + * 设置:主键 + */ + public void setId(Long id) { + this.id = id; + } + /** + * 获取:主键 + */ + public Long getId() { + return id; + } + /** + * 设置:作品方向,0:男频,1:女频' + */ + public void setWorkDirection(Integer workDirection) { + this.workDirection = workDirection; + } + /** + * 获取:作品方向,0:男频,1:女频' + */ + public Integer getWorkDirection() { + return workDirection; + } + /** + * 设置:分类ID + */ + public void setCatId(Integer catId) { + this.catId = catId; + } + /** + * 获取:分类ID + */ + public Integer getCatId() { + return catId; + } + /** + * 设置:分类名 + */ + public void setCatName(String catName) { + this.catName = catName; + } + /** + * 获取:分类名 + */ + public String getCatName() { + return catName; + } + /** + * 设置:子分类ID + */ + public void setCatChildId(Integer catChildId) { + this.catChildId = catChildId; + } + /** + * 获取:子分类ID + */ + public Integer getCatChildId() { + return catChildId; + } + /** + * 设置:子分类名 + */ + public void setCatChildName(String catChildName) { + this.catChildName = catChildName; + } + /** + * 获取:子分类名 + */ + public String getCatChildName() { + return catChildName; + } + /** + * 设置:小说封面 + */ + public void setPicUrl(String picUrl) { + this.picUrl = picUrl; + } + /** + * 获取:小说封面 + */ + public String getPicUrl() { + return picUrl; + } + /** + * 设置:小说名 + */ + public void setBookName(String bookName) { + this.bookName = bookName; + } + /** + * 获取:小说名 + */ + public String getBookName() { + return bookName; + } + /** + * 设置:男主角姓名 + */ + public void setHeroName(String heroName) { + this.heroName = heroName; + } + /** + * 获取:男主角姓名 + */ + public String getHeroName() { + return heroName; + } + /** + * 设置:女主角姓名 + */ + public void setLadyName(String ladyName) { + this.ladyName = ladyName; + } + /** + * 获取:女主角姓名 + */ + public String getLadyName() { + return ladyName; + } + /** + * 设置:作品风格,0:甜宠,1:虐恋,2:其他 + */ + public void setBookStyle(Integer bookStyle) { + this.bookStyle = bookStyle; + } + /** + * 获取:作品风格,0:甜宠,1:虐恋,2:其他 + */ + public Integer getBookStyle() { + return bookStyle; + } + /** + * 设置:作品标签 + */ + public void setBookLabel(String bookLabel) { + this.bookLabel = bookLabel; + } + /** + * 获取:作品标签 + */ + public String getBookLabel() { + return bookLabel; + } + /** + * 设置:作者id + */ + public void setAuthorId(Long authorId) { + this.authorId = authorId; + } + /** + * 获取:作者id + */ + public Long getAuthorId() { + return authorId; + } + /** + * 设置:作者名 + */ + public void setAuthorName(String authorName) { + this.authorName = authorName; + } + /** + * 获取:作者名 + */ + public String getAuthorName() { + return authorName; + } + /** + * 设置:书籍描述 + */ + public void setBookDesc(String bookDesc) { + this.bookDesc = bookDesc; + } + /** + * 获取:书籍描述 + */ + public String getBookDesc() { + return bookDesc; + } + /** + * 设置:评分,预留字段 + */ + public void setScore(Float score) { + this.score = score; + } + /** + * 获取:评分,预留字段 + */ + public Float getScore() { + return score; + } + /** + * 设置:书籍状态,0:连载中,1:已完结 + */ + public void setBookStatus(Integer bookStatus) { + this.bookStatus = bookStatus; + } + /** + * 获取:书籍状态,0:连载中,1:已完结 + */ + public Integer getBookStatus() { + return bookStatus; + } + /** + * 设置:点击量 + */ + public void setVisitCount(Long visitCount) { + this.visitCount = visitCount; + } + /** + * 获取:点击量 + */ + public Long getVisitCount() { + return visitCount; + } + /** + * 设置:总字数 + */ + public void setWordCount(Integer wordCount) { + this.wordCount = wordCount; + } + /** + * 获取:总字数 + */ + public Integer getWordCount() { + return wordCount; + } + /** + * 设置:评论数 + */ + public void setCommentCount(Integer commentCount) { + this.commentCount = commentCount; + } + /** + * 获取:评论数 + */ + public Integer getCommentCount() { + return commentCount; + } + /** + * 设置:昨日订阅数 + */ + public void setYesterdayBuy(Integer yesterdayBuy) { + this.yesterdayBuy = yesterdayBuy; + } + /** + * 获取:昨日订阅数 + */ + public Integer getYesterdayBuy() { + return yesterdayBuy; + } + /** + * 设置:最新目录ID + */ + public void setLastIndexId(Long lastIndexId) { + this.lastIndexId = lastIndexId; + } + /** + * 获取:最新目录ID + */ + public Long getLastIndexId() { + return lastIndexId; + } + /** + * 设置:最新目录名 + */ + public void setLastIndexName(String lastIndexName) { + this.lastIndexName = lastIndexName; + } + /** + * 获取:最新目录名 + */ + public String getLastIndexName() { + return lastIndexName; + } + /** + * 设置:最新目录更新时间 + */ + public void setLastIndexUpdateTime(Date lastIndexUpdateTime) { + this.lastIndexUpdateTime = lastIndexUpdateTime; + } + /** + * 获取:最新目录更新时间 + */ + public Date getLastIndexUpdateTime() { + return lastIndexUpdateTime; + } + /** + * 设置:是否收费,1:收费,0:免费 + */ + public void setIsVip(Integer isVip) { + this.isVip = isVip; + } + /** + * 获取:是否收费,1:收费,0:免费 + */ + public Integer getIsVip() { + return isVip; + } + /** + * 设置:状态,0:入库,1:上架 + */ + public void setStatus(Integer status) { + this.status = status; + } + /** + * 获取:状态,0:入库,1:上架 + */ + public Integer getStatus() { + return status; + } + /** + * 设置:更新时间 + */ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + /** + * 获取:更新时间 + */ + public Date getUpdateTime() { + return updateTime; + } + /** + * 设置:创建时间 + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + /** + * 获取:创建时间 + */ + public Date getCreateTime() { + return createTime; + } + /** + * 设置:爬虫源站ID + */ + public void setCrawlSourceId(Integer crawlSourceId) { + this.crawlSourceId = crawlSourceId; + } + /** + * 获取:爬虫源站ID + */ + public Integer getCrawlSourceId() { + return crawlSourceId; + } + /** + * 设置:抓取的源站小说ID + */ + public void setCrawlBookId(String crawlBookId) { + this.crawlBookId = crawlBookId; + } + /** + * 获取:抓取的源站小说ID + */ + public String getCrawlBookId() { + return crawlBookId; + } + /** + * 设置:最后一次的抓取时间 + */ + public void setCrawlLastTime(Date crawlLastTime) { + this.crawlLastTime = crawlLastTime; + } + /** + * 获取:最后一次的抓取时间 + */ + public Date getCrawlLastTime() { + return crawlLastTime; + } + /** + * 设置:是否已停止更新,0:未停止,1:已停止 + */ + public void setCrawlIsStop(Integer crawlIsStop) { + this.crawlIsStop = crawlIsStop; + } + /** + * 获取:是否已停止更新,0:未停止,1:已停止 + */ + public Integer getCrawlIsStop() { + return crawlIsStop; + } +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/domain/PayDO.java b/novel-admin/src/main/java/com/java2nb/novel/domain/PayDO.java new file mode 100644 index 0000000..39eb8b4 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/domain/PayDO.java @@ -0,0 +1,166 @@ +package com.java2nb.novel.domain; + +import java.io.Serializable; + + +import java.math.BigDecimal; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.java2nb.common.jsonserializer.LongToStringSerializer; + + +import org.springframework.format.annotation.DateTimeFormat; +import java.util.Date; + + + +/** + * 充值订单 + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:57 + */ +public class PayDO implements Serializable { + private static final long serialVersionUID = 1L; + + + //主键 + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long id; + //保留 + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long outTradeNo; + //订单号 + private String tradeNo; + //保留 + private Integer payChannel; + //交易香蕉币 + private Integer totalAmount; + //支付用户ID + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long userId; + //支付状态:0:支付失败,1:支付成功,2:待支付 + private Integer payStatus; + //创建时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + //更新时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** + * 设置:主键 + */ + public void setId(Long id) { + this.id = id; + } + /** + * 获取:主键 + */ + public Long getId() { + return id; + } + /** + * 设置:保留 + */ + public void setOutTradeNo(Long outTradeNo) { + this.outTradeNo = outTradeNo; + } + /** + * 获取:保留 + */ + public Long getOutTradeNo() { + return outTradeNo; + } + /** + * 设置:订单号 + */ + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo; + } + /** + * 获取:订单号 + */ + public String getTradeNo() { + return tradeNo; + } + /** + * 设置:保留 + */ + public void setPayChannel(Integer payChannel) { + this.payChannel = payChannel; + } + /** + * 获取:保留 + */ + public Integer getPayChannel() { + return payChannel; + } + /** + * 设置:交易香蕉币 + */ + public void setTotalAmount(Integer totalAmount) { + this.totalAmount = totalAmount; + } + /** + * 获取:交易香蕉币 + */ + public Integer getTotalAmount() { + return totalAmount; + } + /** + * 设置:支付用户ID + */ + public void setUserId(Long userId) { + this.userId = userId; + } + /** + * 获取:支付用户ID + */ + public Long getUserId() { + return userId; + } + /** + * 设置:支付状态:0:支付失败,1:支付成功,2:待支付 + */ + public void setPayStatus(Integer payStatus) { + this.payStatus = payStatus; + } + /** + * 获取:支付状态:0:支付失败,1:支付成功,2:待支付 + */ + public Integer getPayStatus() { + return payStatus; + } + /** + * 设置:创建时间 + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + /** + * 获取:创建时间 + */ + public Date getCreateTime() { + return createTime; + } + /** + * 设置:更新时间 + */ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + /** + * 获取:更新时间 + */ + public Date getUpdateTime() { + return updateTime; + } +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/domain/UserDO.java b/novel-admin/src/main/java/com/java2nb/novel/domain/UserDO.java new file mode 100644 index 0000000..d179f39 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/domain/UserDO.java @@ -0,0 +1,177 @@ +package com.java2nb.novel.domain; + +import java.io.Serializable; + + +import java.math.BigDecimal; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.java2nb.common.jsonserializer.LongToStringSerializer; + + +import org.springframework.format.annotation.DateTimeFormat; +import java.util.Date; + + + +/** + * + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:08 + */ +public class UserDO implements Serializable { + private static final long serialVersionUID = 1L; + + + //主键 + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long id; + //登录名 + private String username; + //登录密码 + private String password; + //昵称 + private String nickName; + //用户头像 + private String userPhoto; + //用户性别,0:男,1:女 + private Integer userSex; + //账户余额 + //java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值) + //所以通过序列化成字符串来解决 + @JsonSerialize(using = LongToStringSerializer.class) + private Long accountBalance; + //用户状态,0:正常 + private Integer status; + //创建时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + //更新时间 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** + * 设置:主键 + */ + public void setId(Long id) { + this.id = id; + } + /** + * 获取:主键 + */ + public Long getId() { + return id; + } + /** + * 设置:登录名 + */ + public void setUsername(String username) { + this.username = username; + } + /** + * 获取:登录名 + */ + public String getUsername() { + return username; + } + /** + * 设置:登录密码 + */ + public void setPassword(String password) { + this.password = password; + } + /** + * 获取:登录密码 + */ + public String getPassword() { + return password; + } + /** + * 设置:昵称 + */ + public void setNickName(String nickName) { + this.nickName = nickName; + } + /** + * 获取:昵称 + */ + public String getNickName() { + return nickName; + } + /** + * 设置:用户头像 + */ + public void setUserPhoto(String userPhoto) { + this.userPhoto = userPhoto; + } + /** + * 获取:用户头像 + */ + public String getUserPhoto() { + return userPhoto; + } + /** + * 设置:用户性别,0:男,1:女 + */ + public void setUserSex(Integer userSex) { + this.userSex = userSex; + } + /** + * 获取:用户性别,0:男,1:女 + */ + public Integer getUserSex() { + return userSex; + } + /** + * 设置:账户余额 + */ + public void setAccountBalance(Long accountBalance) { + this.accountBalance = accountBalance; + } + /** + * 获取:账户余额 + */ + public Long getAccountBalance() { + return accountBalance; + } + /** + * 设置:用户状态,0:正常 + */ + public void setStatus(Integer status) { + this.status = status; + } + /** + * 获取:用户状态,0:正常 + */ + public Integer getStatus() { + return status; + } + /** + * 设置:创建时间 + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + /** + * 获取:创建时间 + */ + public Date getCreateTime() { + return createTime; + } + /** + * 设置:更新时间 + */ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + /** + * 获取:更新时间 + */ + public Date getUpdateTime() { + return updateTime; + } +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/service/AuthorService.java b/novel-admin/src/main/java/com/java2nb/novel/service/AuthorService.java index 15d73ef..2e0c013 100644 --- a/novel-admin/src/main/java/com/java2nb/novel/service/AuthorService.java +++ b/novel-admin/src/main/java/com/java2nb/novel/service/AuthorService.java @@ -2,6 +2,7 @@ package com.java2nb.novel.service; import com.java2nb.novel.domain.AuthorDO; +import java.util.Date; import java.util.List; import java.util.Map; @@ -27,4 +28,6 @@ public interface AuthorService { int remove(Long id); int batchRemove(Long[] ids); + + Map tableSta(Date minDate); } diff --git a/novel-admin/src/main/java/com/java2nb/novel/service/BookService.java b/novel-admin/src/main/java/com/java2nb/novel/service/BookService.java new file mode 100644 index 0000000..5787fbf --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/service/BookService.java @@ -0,0 +1,33 @@ +package com.java2nb.novel.service; + +import com.java2nb.novel.domain.BookDO; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 小说表 + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:46 + */ +public interface BookService { + + BookDO get(Long id); + + List list(Map map); + + int count(Map map); + + int save(BookDO book); + + int update(BookDO book); + + int remove(Long id); + + int batchRemove(Long[] ids); + + Map tableSta(Date minDate); +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/service/PayService.java b/novel-admin/src/main/java/com/java2nb/novel/service/PayService.java new file mode 100644 index 0000000..a927d47 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/service/PayService.java @@ -0,0 +1,33 @@ +package com.java2nb.novel.service; + +import com.java2nb.novel.domain.PayDO; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 充值订单 + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:57 + */ +public interface PayService { + + PayDO get(Long id); + + List list(Map map); + + int count(Map map); + + int save(PayDO pay); + + int update(PayDO pay); + + int remove(Long id); + + int batchRemove(Long[] ids); + + Map tableSta(Date minDate); +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/service/UserService.java b/novel-admin/src/main/java/com/java2nb/novel/service/UserService.java new file mode 100644 index 0000000..ba3cfb6 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/service/UserService.java @@ -0,0 +1,33 @@ +package com.java2nb.novel.service; + +import com.java2nb.novel.domain.UserDO; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author xiongxy + * @email 1179705413@qq.com + * @date 2020-12-01 03:49:08 + */ +public interface UserService { + + UserDO get(Long id); + + List list(Map map); + + int count(Map map); + + int save(UserDO user); + + int update(UserDO user); + + int remove(Long id); + + int batchRemove(Long[] ids); + + Map tableSta(Date minDate); +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/service/impl/AuthorServiceImpl.java b/novel-admin/src/main/java/com/java2nb/novel/service/impl/AuthorServiceImpl.java index ef3d020..28bc40f 100644 --- a/novel-admin/src/main/java/com/java2nb/novel/service/impl/AuthorServiceImpl.java +++ b/novel-admin/src/main/java/com/java2nb/novel/service/impl/AuthorServiceImpl.java @@ -3,8 +3,10 @@ package com.java2nb.novel.service.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Date; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import com.java2nb.novel.dao.AuthorDao; import com.java2nb.novel.domain.AuthorDO; @@ -51,5 +53,14 @@ public class AuthorServiceImpl implements AuthorService { public int batchRemove(Long[] ids){ return authorDao.batchRemove(ids); } - + + @Override + public Map tableSta(Date minDate) { + List> maps = authorDao.tableSta(minDate); + + return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("authorCount"))); + + + } + } diff --git a/novel-admin/src/main/java/com/java2nb/novel/service/impl/BookServiceImpl.java b/novel-admin/src/main/java/com/java2nb/novel/service/impl/BookServiceImpl.java new file mode 100644 index 0000000..ae2d028 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/service/impl/BookServiceImpl.java @@ -0,0 +1,65 @@ +package com.java2nb.novel.service.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.java2nb.novel.dao.BookDao; +import com.java2nb.novel.domain.BookDO; +import com.java2nb.novel.service.BookService; + + + +@Service +public class BookServiceImpl implements BookService { + @Autowired + private BookDao bookDao; + + @Override + public BookDO get(Long id){ + return bookDao.get(id); + } + + @Override + public List list(Map map){ + return bookDao.list(map); + } + + @Override + public int count(Map map){ + return bookDao.count(map); + } + + @Override + public int save(BookDO book){ + return bookDao.save(book); + } + + @Override + public int update(BookDO book){ + return bookDao.update(book); + } + + @Override + public int remove(Long id){ + return bookDao.remove(id); + } + + @Override + public int batchRemove(Long[] ids){ + return bookDao.batchRemove(ids); + } + + @Override + public Map tableSta(Date minDate) { + List> maps = bookDao.tableSta(minDate); + + return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("bookCount"))); + + } + +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/service/impl/PayServiceImpl.java b/novel-admin/src/main/java/com/java2nb/novel/service/impl/PayServiceImpl.java new file mode 100644 index 0000000..263db88 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/service/impl/PayServiceImpl.java @@ -0,0 +1,66 @@ +package com.java2nb.novel.service.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.java2nb.novel.dao.PayDao; +import com.java2nb.novel.domain.PayDO; +import com.java2nb.novel.service.PayService; + + + +@Service +public class PayServiceImpl implements PayService { + @Autowired + private PayDao payDao; + + @Override + public PayDO get(Long id){ + return payDao.get(id); + } + + @Override + public List list(Map map){ + return payDao.list(map); + } + + @Override + public int count(Map map){ + return payDao.count(map); + } + + @Override + public int save(PayDO pay){ + return payDao.save(pay); + } + + @Override + public int update(PayDO pay){ + return payDao.update(pay); + } + + @Override + public int remove(Long id){ + return payDao.remove(id); + } + + @Override + public int batchRemove(Long[] ids){ + return payDao.batchRemove(ids); + } + + @Override + public Map tableSta(Date minDate) { + List> maps = payDao.tableSta(minDate); + + return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("orderCount"))); + + + } + +} diff --git a/novel-admin/src/main/java/com/java2nb/novel/service/impl/UserServiceImpl.java b/novel-admin/src/main/java/com/java2nb/novel/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..0ffb462 --- /dev/null +++ b/novel-admin/src/main/java/com/java2nb/novel/service/impl/UserServiceImpl.java @@ -0,0 +1,65 @@ +package com.java2nb.novel.service.impl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import com.java2nb.novel.dao.UserDao; +import com.java2nb.novel.domain.UserDO; +import com.java2nb.novel.service.UserService; + + + +@Service +public class UserServiceImpl implements UserService { + @Autowired + private UserDao userDao; + + @Override + public UserDO get(Long id){ + return userDao.get(id); + } + + @Override + public List list(Map map){ + return userDao.list(map); + } + + @Override + public int count(Map map){ + return userDao.count(map); + } + + @Override + public int save(UserDO user){ + return userDao.save(user); + } + + @Override + public int update(UserDO user){ + return userDao.update(user); + } + + @Override + public int remove(Long id){ + return userDao.remove(id); + } + + @Override + public int batchRemove(Long[] ids){ + return userDao.batchRemove(ids); + } + + @Override + public Map tableSta(Date minDate) { + + List> maps = userDao.tableSta(minDate); + + return maps.stream().collect(Collectors.toMap(x -> x.get("staDate"), x -> x.get("userCount"))); + } + +} diff --git a/novel-admin/src/main/java/com/java2nb/system/controller/UserController.java b/novel-admin/src/main/java/com/java2nb/system/controller/SysUserController.java similarity index 97% rename from novel-admin/src/main/java/com/java2nb/system/controller/UserController.java rename to novel-admin/src/main/java/com/java2nb/system/controller/SysUserController.java index d66b4fd..8ca31f7 100644 --- a/novel-admin/src/main/java/com/java2nb/system/controller/UserController.java +++ b/novel-admin/src/main/java/com/java2nb/system/controller/SysUserController.java @@ -10,7 +10,7 @@ import com.java2nb.system.domain.DeptDO; import com.java2nb.system.domain.RoleDO; import com.java2nb.system.domain.UserDO; import com.java2nb.system.service.RoleService; -import com.java2nb.system.service.UserService; +import com.java2nb.system.service.SysUserService; import com.java2nb.system.vo.UserVO; import javax.servlet.http.HttpServletRequest; @@ -27,10 +27,10 @@ import java.util.Map; @RequestMapping("/sys/user") @Controller -public class UserController extends BaseController { +public class SysUserController extends BaseController { private String prefix="system/user" ; @Autowired - UserService userService; + SysUserService userService; @Autowired RoleService roleService; @Autowired diff --git a/novel-admin/src/main/java/com/java2nb/system/dao/UserDao.java b/novel-admin/src/main/java/com/java2nb/system/dao/SysUserDao.java similarity index 95% rename from novel-admin/src/main/java/com/java2nb/system/dao/UserDao.java rename to novel-admin/src/main/java/com/java2nb/system/dao/SysUserDao.java index 75b9af9..4979a42 100644 --- a/novel-admin/src/main/java/com/java2nb/system/dao/UserDao.java +++ b/novel-admin/src/main/java/com/java2nb/system/dao/SysUserDao.java @@ -15,7 +15,7 @@ import org.apache.ibatis.annotations.Param; * @date 2019-10-03 09:45:11 */ @Mapper -public interface UserDao { +public interface SysUserDao { UserDO get(Long userId); diff --git a/novel-admin/src/main/java/com/java2nb/system/service/UserService.java b/novel-admin/src/main/java/com/java2nb/system/service/SysUserService.java similarity index 97% rename from novel-admin/src/main/java/com/java2nb/system/service/UserService.java rename to novel-admin/src/main/java/com/java2nb/system/service/SysUserService.java index 6d59679..edebd82 100644 --- a/novel-admin/src/main/java/com/java2nb/system/service/UserService.java +++ b/novel-admin/src/main/java/com/java2nb/system/service/SysUserService.java @@ -13,7 +13,7 @@ import com.java2nb.system.domain.UserDO; import org.springframework.web.multipart.MultipartFile; @Service -public interface UserService { +public interface SysUserService { UserDO get(Long id); List list(Map map); diff --git a/novel-admin/src/main/java/com/java2nb/system/service/impl/RoleServiceImpl.java b/novel-admin/src/main/java/com/java2nb/system/service/impl/RoleServiceImpl.java index d8064ed..429b89e 100644 --- a/novel-admin/src/main/java/com/java2nb/system/service/impl/RoleServiceImpl.java +++ b/novel-admin/src/main/java/com/java2nb/system/service/impl/RoleServiceImpl.java @@ -8,8 +8,6 @@ import java.util.Objects; import com.java2nb.system.dao.*; import com.java2nb.system.domain.RoleDataPermDO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -30,7 +28,7 @@ public class RoleServiceImpl implements RoleService { @Autowired RoleMenuDao roleMenuMapper; @Autowired - UserDao userMapper; + SysUserDao userMapper; @Autowired UserRoleDao userRoleMapper; @Autowired diff --git a/novel-admin/src/main/java/com/java2nb/system/service/impl/UserServiceImpl.java b/novel-admin/src/main/java/com/java2nb/system/service/impl/SysUserServiceImpl.java similarity index 97% rename from novel-admin/src/main/java/com/java2nb/system/service/impl/UserServiceImpl.java rename to novel-admin/src/main/java/com/java2nb/system/service/impl/SysUserServiceImpl.java index f513443..56f0d5d 100644 --- a/novel-admin/src/main/java/com/java2nb/system/service/impl/UserServiceImpl.java +++ b/novel-admin/src/main/java/com/java2nb/system/service/impl/SysUserServiceImpl.java @@ -19,21 +19,21 @@ import org.springframework.transaction.annotation.Transactional; import com.java2nb.common.domain.Tree; import com.java2nb.system.dao.DeptDao; -import com.java2nb.system.dao.UserDao; +import com.java2nb.system.dao.SysUserDao; import com.java2nb.system.dao.UserRoleDao; import com.java2nb.system.domain.DeptDO; import com.java2nb.system.domain.UserDO; import com.java2nb.system.domain.UserRoleDO; -import com.java2nb.system.service.UserService; +import com.java2nb.system.service.SysUserService; import org.springframework.web.multipart.MultipartFile; import javax.imageio.ImageIO; @Transactional @Service -public class UserServiceImpl implements UserService { +public class SysUserServiceImpl implements SysUserService { @Autowired - UserDao userMapper; + SysUserDao userMapper; @Autowired UserRoleDao userRoleMapper; @Autowired @@ -44,7 +44,7 @@ public class UserServiceImpl implements UserService { private JnConfig jnConfig; @Autowired DeptService deptService; - private static final Logger logger = LoggerFactory.getLogger(UserService.class); + private static final Logger logger = LoggerFactory.getLogger(SysUserService.class); @Override // @Cacheable(value = "user",key = "#id") diff --git a/novel-admin/src/main/java/com/java2nb/system/shiro/UserRealm.java b/novel-admin/src/main/java/com/java2nb/system/shiro/UserRealm.java index ea45d15..c7fc9ad 100644 --- a/novel-admin/src/main/java/com/java2nb/system/shiro/UserRealm.java +++ b/novel-admin/src/main/java/com/java2nb/system/shiro/UserRealm.java @@ -6,7 +6,6 @@ import com.java2nb.common.config.ApplicationContextRegister; import com.java2nb.system.dao.DataPermDao; import com.java2nb.system.dao.DeptDao; import com.java2nb.system.domain.DataPermDO; -import com.java2nb.system.domain.UserToken; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; import org.apache.shiro.authc.AuthenticationToken; @@ -18,10 +17,9 @@ import org.apache.shiro.authz.AuthorizationInfo; import org.apache.shiro.authz.SimpleAuthorizationInfo; import org.apache.shiro.realm.AuthorizingRealm; import org.apache.shiro.subject.PrincipalCollection; -import org.springframework.beans.factory.annotation.Autowired; import com.java2nb.common.utils.ShiroUtils; -import com.java2nb.system.dao.UserDao; +import com.java2nb.system.dao.SysUserDao; import com.java2nb.system.domain.UserDO; import com.java2nb.system.service.MenuService; @@ -48,7 +46,7 @@ public class UserRealm extends AuthorizingRealm { map.put("username", username); String password = new String((char[]) token.getCredentials()); - UserDao userMapper = ApplicationContextRegister.getBean(UserDao.class); + SysUserDao userMapper = ApplicationContextRegister.getBean(SysUserDao.class); // 查询用户信息 UserDO user = userMapper.list(map).get(0); diff --git a/novel-admin/src/main/resources/mybatis/novel/AuthorMapper.xml b/novel-admin/src/main/resources/mybatis/novel/AuthorMapper.xml index 42b5712..e78f977 100644 --- a/novel-admin/src/main/resources/mybatis/novel/AuthorMapper.xml +++ b/novel-admin/src/main/resources/mybatis/novel/AuthorMapper.xml @@ -133,4 +133,18 @@ + + \ No newline at end of file diff --git a/novel-admin/src/main/resources/mybatis/novel/BookMapper.xml b/novel-admin/src/main/resources/mybatis/novel/BookMapper.xml new file mode 100644 index 0000000..accc3ff --- /dev/null +++ b/novel-admin/src/main/resources/mybatis/novel/BookMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + insert into book + ( + `id`, + `work_direction`, + `cat_id`, + `cat_name`, + `cat_child_id`, + `cat_child_name`, + `pic_url`, + `book_name`, + `hero_name`, + `lady_name`, + `book_style`, + `book_label`, + `author_id`, + `author_name`, + `book_desc`, + `score`, + `book_status`, + `visit_count`, + `word_count`, + `comment_count`, + `yesterday_buy`, + `last_index_id`, + `last_index_name`, + `last_index_update_time`, + `is_vip`, + `status`, + `update_time`, + `create_time`, + `crawl_source_id`, + `crawl_book_id`, + `crawl_last_time`, + `crawl_is_stop` + ) + values + ( + #{id}, + #{workDirection}, + #{catId}, + #{catName}, + #{catChildId}, + #{catChildName}, + #{picUrl}, + #{bookName}, + #{heroName}, + #{ladyName}, + #{bookStyle}, + #{bookLabel}, + #{authorId}, + #{authorName}, + #{bookDesc}, + #{score}, + #{bookStatus}, + #{visitCount}, + #{wordCount}, + #{commentCount}, + #{yesterdayBuy}, + #{lastIndexId}, + #{lastIndexName}, + #{lastIndexUpdateTime}, + #{isVip}, + #{status}, + #{updateTime}, + #{createTime}, + #{crawlSourceId}, + #{crawlBookId}, + #{crawlLastTime}, + #{crawlIsStop} + ) + + + + insert into book + ( + `id`, + `work_direction`, + `cat_id`, + `cat_name`, + `cat_child_id`, + `cat_child_name`, + `pic_url`, + `book_name`, + `hero_name`, + `lady_name`, + `book_style`, + `book_label`, + `author_id`, + `author_name`, + `book_desc`, + `score`, + `book_status`, + `visit_count`, + `word_count`, + `comment_count`, + `yesterday_buy`, + `last_index_id`, + `last_index_name`, + `last_index_update_time`, + `is_vip`, + `status`, + `update_time`, + `create_time`, + `crawl_source_id`, + `crawl_book_id`, + `crawl_last_time`, + `crawl_is_stop` + ) + values + ( + #{id}, + #{workDirection}, + #{catId}, + #{catName}, + #{catChildId}, + #{catChildName}, + #{picUrl}, + #{bookName}, + #{heroName}, + #{ladyName}, + #{bookStyle}, + #{bookLabel}, + #{authorId}, + #{authorName}, + #{bookDesc}, + #{score}, + #{bookStatus}, + #{visitCount}, + #{wordCount}, + #{commentCount}, + #{yesterdayBuy}, + #{lastIndexId}, + #{lastIndexName}, + #{lastIndexUpdateTime}, + #{isVip}, + #{status}, + #{updateTime}, + #{createTime}, + #{crawlSourceId}, + #{crawlBookId}, + #{crawlLastTime}, + #{crawlIsStop} + ) + + + + update book + + `work_direction` = #{workDirection}, + `cat_id` = #{catId}, + `cat_name` = #{catName}, + `cat_child_id` = #{catChildId}, + `cat_child_name` = #{catChildName}, + `pic_url` = #{picUrl}, + `book_name` = #{bookName}, + `hero_name` = #{heroName}, + `lady_name` = #{ladyName}, + `book_style` = #{bookStyle}, + `book_label` = #{bookLabel}, + `author_id` = #{authorId}, + `author_name` = #{authorName}, + `book_desc` = #{bookDesc}, + `score` = #{score}, + `book_status` = #{bookStatus}, + `visit_count` = #{visitCount}, + `word_count` = #{wordCount}, + `comment_count` = #{commentCount}, + `yesterday_buy` = #{yesterdayBuy}, + `last_index_id` = #{lastIndexId}, + `last_index_name` = #{lastIndexName}, + `last_index_update_time` = #{lastIndexUpdateTime}, + `is_vip` = #{isVip}, + `status` = #{status}, + `update_time` = #{updateTime}, + `create_time` = #{createTime}, + `crawl_source_id` = #{crawlSourceId}, + `crawl_book_id` = #{crawlBookId}, + `crawl_last_time` = #{crawlLastTime}, + `crawl_is_stop` = #{crawlIsStop} + + where id = #{id} + + + + delete from book where id = #{value} + + + + delete from book where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/novel-admin/src/main/resources/mybatis/novel/PayMapper.xml b/novel-admin/src/main/resources/mybatis/novel/PayMapper.xml new file mode 100644 index 0000000..9b56909 --- /dev/null +++ b/novel-admin/src/main/resources/mybatis/novel/PayMapper.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + insert into order_pay + ( + `id`, + `out_trade_no`, + `trade_no`, + `pay_channel`, + `total_amount`, + `user_id`, + `pay_status`, + `create_time`, + `update_time` + ) + values + ( + #{id}, + #{outTradeNo}, + #{tradeNo}, + #{payChannel}, + #{totalAmount}, + #{userId}, + #{payStatus}, + #{createTime}, + #{updateTime} + ) + + + + insert into order_pay + ( + `id`, + `out_trade_no`, + `trade_no`, + `pay_channel`, + `total_amount`, + `user_id`, + `pay_status`, + `create_time`, + `update_time` + ) + values + ( + #{id}, + #{outTradeNo}, + #{tradeNo}, + #{payChannel}, + #{totalAmount}, + #{userId}, + #{payStatus}, + #{createTime}, + #{updateTime} + ) + + + + update order_pay + + `out_trade_no` = #{outTradeNo}, + `trade_no` = #{tradeNo}, + `pay_channel` = #{payChannel}, + `total_amount` = #{totalAmount}, + `user_id` = #{userId}, + `pay_status` = #{payStatus}, + `create_time` = #{createTime}, + `update_time` = #{updateTime} + + where id = #{id} + + + + delete from order_pay where id = #{value} + + + + delete from order_pay where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/novel-admin/src/main/resources/mybatis/novel/UserMapper.xml b/novel-admin/src/main/resources/mybatis/novel/UserMapper.xml new file mode 100644 index 0000000..4d107a8 --- /dev/null +++ b/novel-admin/src/main/resources/mybatis/novel/UserMapper.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + 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 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} + ) + + + + update user + + `username` = #{username}, + `password` = #{password}, + `nick_name` = #{nickName}, + `user_photo` = #{userPhoto}, + `user_sex` = #{userSex}, + `account_balance` = #{accountBalance}, + `status` = #{status}, + `create_time` = #{createTime}, + `update_time` = #{updateTime} + + where id = #{id} + + + + delete from user where id = #{value} + + + + delete from user where id in + + #{id} + + + + + + \ No newline at end of file diff --git a/novel-admin/src/main/resources/mybatis/system/UserMapper.xml b/novel-admin/src/main/resources/mybatis/system/UserMapper.xml index 23d8b15..2160fa6 100644 --- a/novel-admin/src/main/resources/mybatis/system/UserMapper.xml +++ b/novel-admin/src/main/resources/mybatis/system/UserMapper.xml @@ -1,7 +1,7 @@ - + + + + +
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+ +
+
+ + + + + + +
+ + + + diff --git a/novel-admin/src/main/resources/templates/novel/book/book.html b/novel-admin/src/main/resources/templates/novel/book/book.html new file mode 100644 index 0000000..3119bba --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/book/book.html @@ -0,0 +1,66 @@ + + + + + +
+
+
+
+
+
+ + +
+
+ +
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + + \ No newline at end of file diff --git a/novel-admin/src/main/resources/templates/novel/book/detail.html b/novel-admin/src/main/resources/templates/novel/book/detail.html new file mode 100644 index 0000000..e984485 --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/book/detail.html @@ -0,0 +1,328 @@ + + + + + +
+
+
+
+
+
+ +
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+
+
+
+
+
+
+
+ + diff --git a/novel-admin/src/main/resources/templates/novel/book/edit.html b/novel-admin/src/main/resources/templates/novel/book/edit.html new file mode 100644 index 0000000..dd012fb --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/book/edit.html @@ -0,0 +1,317 @@ + + + + + +
+
+
+
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + + + diff --git a/novel-admin/src/main/resources/templates/novel/pay/add.html b/novel-admin/src/main/resources/templates/novel/pay/add.html new file mode 100644 index 0000000..6171175 --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/pay/add.html @@ -0,0 +1,104 @@ + + + + + +
+
+
+
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + + + diff --git a/novel-admin/src/main/resources/templates/novel/pay/detail.html b/novel-admin/src/main/resources/templates/novel/pay/detail.html new file mode 100644 index 0000000..780ba16 --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/pay/detail.html @@ -0,0 +1,100 @@ + + + + + +
+
+
+
+
+
+ +
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+ + diff --git a/novel-admin/src/main/resources/templates/novel/pay/edit.html b/novel-admin/src/main/resources/templates/novel/pay/edit.html new file mode 100644 index 0000000..763d276 --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/pay/edit.html @@ -0,0 +1,106 @@ + + + + + +
+
+
+
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + + + diff --git a/novel-admin/src/main/resources/templates/novel/pay/pay.html b/novel-admin/src/main/resources/templates/novel/pay/pay.html new file mode 100644 index 0000000..9ae7ae5 --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/pay/pay.html @@ -0,0 +1,66 @@ + + + + + +
+
+
+
+
+
+ + +
+
+ +
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + + \ No newline at end of file diff --git a/novel-admin/src/main/resources/templates/novel/user/add.html b/novel-admin/src/main/resources/templates/novel/user/add.html new file mode 100644 index 0000000..6ef1a5e --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/user/add.html @@ -0,0 +1,113 @@ + + + + + +
+
+
+
+
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + + + diff --git a/novel-admin/src/main/resources/templates/novel/user/detail.html b/novel-admin/src/main/resources/templates/novel/user/detail.html new file mode 100644 index 0000000..8494758 --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/user/detail.html @@ -0,0 +1,110 @@ + + + + + +
+
+
+
+
+
+ +
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+ + diff --git a/novel-admin/src/main/resources/templates/novel/user/edit.html b/novel-admin/src/main/resources/templates/novel/user/edit.html new file mode 100644 index 0000000..3e48143 --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/user/edit.html @@ -0,0 +1,115 @@ + + + + + +
+
+
+
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + + + diff --git a/novel-admin/src/main/resources/templates/novel/user/user.html b/novel-admin/src/main/resources/templates/novel/user/user.html new file mode 100644 index 0000000..b79a8ef --- /dev/null +++ b/novel-admin/src/main/resources/templates/novel/user/user.html @@ -0,0 +1,66 @@ + + + + + +
+
+
+
+
+
+ + +
+
+ +
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + + \ No newline at end of file