# UserController
Date: 2020-05-30

com.java2nb.novel.user.controller

## 类 UserController

- java.lang.Object
- - com.java2nb.novel.common.base.BaseController
  - - com.java2nb.novel.user.controller.UserController

    @RestController
     @RequestMapping(value="user")
    public class UserController
    extends BaseController

用户微服务Controller

从以下版本开始:
  2020/5/27
版本:
  1.0
作者:
  xiongxiaoyang

### 字段概要

### 从类继承的字段 com.java2nb.novel.common.base.BaseController

`jwtTokenUtil`

### 构造器概要

构造器
构造器和说明
`UserController()`

### 方法概要

所有方法 实例方法 具体方法
`ResultBean` `addBookComment(BookComment comment, javax.servlet.http.HttpServletRequest request)` 发布评价
`ResultBean` `addFeedBack(java.lang.String content, javax.servlet.http.HttpServletRequest request)` 添加反馈
`ResultBean` `addReadHistory(java.lang.Long bookId, java.lang.Long preContentId, javax.servlet.http.HttpServletRequest request)` 添加阅读记录
`ResultBean` `addToBookShelf(java.lang.Long bookId, java.lang.Long preContentId, javax.servlet.http.HttpServletRequest request)` 加入书架
`ResultBean<PageBean<BookShelfVO>>` `listBookShelfByPage(int page, int pageSize, javax.servlet.http.HttpServletRequest request)` 分页查询书架
`ResultBean<PageBean<BookComment>>` `listCommentByPage(int page, int pageSize, javax.servlet.http.HttpServletRequest request)` 用户书评分页查询
`ResultBean<PageBean<BookReadHistoryVO>>` `listReadHistoryByPage(int page, int pageSize, javax.servlet.http.HttpServletRequest request)` 分页查询阅读记录
`ResultBean<PageBean<UserFeedback>>` `listUserFeedBackByPage(int page, int pageSize, javax.servlet.http.HttpServletRequest request)` 分页查询我的反馈列表
`ResultBean<java.util.Map<java.lang.String,java.lang.Object>>` `login(@Valid UserForm user, org.springframework.validation.BindingResult result)` 登陆
`ResultBean` `queryIsInShelf(java.lang.Long bookId, javax.servlet.http.HttpServletRequest request)` 查询小说是否已加入书架
`ResultBean<java.util.Map<java.lang.String,java.lang.Object>>` `refreshToken(javax.servlet.http.HttpServletRequest request)` 刷新token
`ResultBean<java.util.Map<java.lang.String,java.lang.Object>>` `register(@Valid UserForm user, java.lang.String velCode, org.springframework.validation.BindingResult result)` 注册
`ResultBean` `removeFromBookShelf(java.lang.Long bookId, javax.servlet.http.HttpServletRequest request)` 移出书架
`ResultBean` `updatePassword(java.lang.String oldPassword, java.lang.String newPassword1, java.lang.String newPassword2, javax.servlet.http.HttpServletRequest request)` 更新密码
`ResultBean` `updateUserInfo(User user, javax.servlet.http.HttpServletRequest request)` 更新个人信息
`ResultBean<User>` `userInfo(javax.servlet.http.HttpServletRequest request)` 查询个人信息

### 从类继承的方法 com.java2nb.novel.common.base.BaseController

`getToken, getUserDetails, setJwtTokenUtil`

### 从类继承的方法 java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 构造器详细资料

#### UserController

    public UserController()

### 方法详细资料

#### login

    @GetMapping(value="login")
    public ResultBean<java.util.Map<java.lang.String,java.lang.Object>> login(@Valid
                                                                                                         @Valid UserForm user,
                                                                                                         org.springframework.validation.BindingResult result)

登陆

#### register

    @PostMapping(value="register")
    public ResultBean<java.util.Map<java.lang.String,java.lang.Object>> register(@Valid
                                                                                                                @Valid UserForm user,
                                                                                                                @RequestParam(value="velCode",defaultValue="")
                                                                                                                java.lang.String velCode,
                                                                                                                org.springframework.validation.BindingResult result)

注册

#### refreshToken

    @PostMapping(value="refreshToken")
    public ResultBean<java.util.Map<java.lang.String,java.lang.Object>> refreshToken(javax.servlet.http.HttpServletRequest request)

刷新token

#### queryIsInShelf

    @GetMapping(value="queryIsInShelf")
    public ResultBean queryIsInShelf(java.lang.Long bookId,
                                                                         javax.servlet.http.HttpServletRequest request)

查询小说是否已加入书架

#### addToBookShelf

    @PostMapping(value="addToBookShelf")
    public ResultBean addToBookShelf(java.lang.Long bookId,
                                                                          java.lang.Long preContentId,
                                                                          javax.servlet.http.HttpServletRequest request)

加入书架

#### removeFromBookShelf

    @DeleteMapping(value="removeFromBookShelf")
    public ResultBean removeFromBookShelf(java.lang.Long bookId,
                                                                                      javax.servlet.http.HttpServletRequest request)

移出书架

#### listBookShelfByPage

    @GetMapping(value="listBookShelfByPage")
    public ResultBean<PageBean<BookShelfVO>> listBookShelfByPage(@RequestParam(value="curr",defaultValue="1")
                                                                                                          int page,
                                                                                                          @RequestParam(value="limit",defaultValue="10")
                                                                                                          int pageSize,
                                                                                                          javax.servlet.http.HttpServletRequest request)

分页查询书架

#### listReadHistoryByPage

    @GetMapping(value="listReadHistoryByPage")
    public ResultBean<PageBean<BookReadHistoryVO>> listReadHistoryByPage(@RequestParam(value="curr",defaultValue="1")
                                                                                                                    int page,
                                                                                                                    @RequestParam(value="limit",defaultValue="10")
                                                                                                                    int pageSize,
                                                                                                                    javax.servlet.http.HttpServletRequest request)

分页查询阅读记录

#### addReadHistory

    @PostMapping(value="addReadHistory")
    public ResultBean addReadHistory(java.lang.Long bookId,
                                                                          java.lang.Long preContentId,
                                                                          javax.servlet.http.HttpServletRequest request)

添加阅读记录

#### addFeedBack

    @PostMapping(value="addFeedBack")
    public ResultBean addFeedBack(java.lang.String content,
                                                                    javax.servlet.http.HttpServletRequest request)

添加反馈

#### listUserFeedBackByPage

    @GetMapping(value="listUserFeedBackByPage")
    public ResultBean<PageBean<UserFeedback>> listUserFeedBackByPage(@RequestParam(value="curr",defaultValue="1")
                                                                                                                 int page,
                                                                                                                 @RequestParam(value="limit",defaultValue="5")
                                                                                                                 int pageSize,
                                                                                                                 javax.servlet.http.HttpServletRequest request)

分页查询我的反馈列表

#### userInfo

    @GetMapping(value="userInfo")
    public ResultBean<User> userInfo(javax.servlet.http.HttpServletRequest request)

查询个人信息

#### updateUserInfo

    @PostMapping(value="updateUserInfo")
    public ResultBean updateUserInfo(User user,
                                                                          javax.servlet.http.HttpServletRequest request)

更新个人信息

#### updatePassword

    @PostMapping(value="updatePassword")
    public ResultBean updatePassword(java.lang.String oldPassword,
                                                                          java.lang.String newPassword1,
                                                                          java.lang.String newPassword2,
                                                                          javax.servlet.http.HttpServletRequest request)

更新密码

#### addBookComment

    @PostMapping(value="addBookComment")
    public ResultBean addBookComment(BookComment comment,
                                                                          javax.servlet.http.HttpServletRequest request)

发布评价

#### listCommentByPage

    @GetMapping(value="listCommentByPage")
    public ResultBean<PageBean<BookComment>> listCommentByPage(@RequestParam(value="curr",defaultValue="1")
                                                                                                      int page,
                                                                                                      @RequestParam(value="limit",defaultValue="5")
                                                                                                      int pageSize,
                                                                                                      javax.servlet.http.HttpServletRequest request)

用户书评分页查询