分页参数修改

This commit is contained in:
x ronger 2019-12-02 09:02:01 +08:00
parent 8254c7fae0
commit 21682b7b7d
6 changed files with 22 additions and 14 deletions

View File

@ -8,6 +8,9 @@ import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date; import java.util.Date;
/**
* @author ronger
*/
@Data @Data
@Table(name = "vertical_topic") @Table(name = "vertical_topic")
public class Topic { public class Topic {

View File

@ -1,5 +1,6 @@
package com.rymcu.vertical.entity; package com.rymcu.vertical.entity;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.annotation.ColumnType; import tk.mybatis.mapper.annotation.ColumnType;
@ -29,6 +30,7 @@ public class User implements Serializable,Cloneable {
* 密码 * 密码
* */ * */
@Column(name = "password") @Column(name = "password")
@JSONField(serialize=false)
private String password; private String password;
/** /**
@ -92,17 +94,20 @@ public class User implements Serializable,Cloneable {
* 最后登录时间 * 最后登录时间
* */ * */
@Column(name = "last_login_time") @Column(name = "last_login_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date lastLoginTime; private Date lastLoginTime;
/** /**
* 创建时间 * 创建时间
* */ * */
@Column(name = "created_time") @Column(name = "created_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime; private Date createdTime;
/** /**
* 创建时间 * 创建时间
* */ * */
@Column(name = "updated_time") @Column(name = "updated_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date updatedTime; private Date updatedTime;
} }

View File

@ -94,8 +94,8 @@ public class CommonApiController {
Map map = new HashMap(2); Map map = new HashMap(2);
map.put("articles", pageInfo.getList()); map.put("articles", pageInfo.getList());
Map pagination = new HashMap(3); Map pagination = new HashMap(3);
pagination.put("paginationPageCount",pageInfo.getPages()); pagination.put("pageSize",pageInfo.getPageSize());
pagination.put("paginationPageNums",pageInfo.getNavigatepageNums()); pagination.put("total",pageInfo.getTotal());
pagination.put("currentPage",pageInfo.getPageNum()); pagination.put("currentPage",pageInfo.getPageNum());
map.put("pagination", pagination); map.put("pagination", pagination);
return GlobalResultGenerator.genSuccessResult(map); return GlobalResultGenerator.genSuccessResult(map);

View File

@ -25,11 +25,11 @@ public class TagController {
PageHelper.startPage(page, rows); PageHelper.startPage(page, rows);
List<ArticleDTO> list = articleService.findArticlesByTagName(name); List<ArticleDTO> list = articleService.findArticlesByTagName(name);
PageInfo pageInfo = new PageInfo(list); PageInfo pageInfo = new PageInfo(list);
Map map = new HashMap(); Map map = new HashMap(2);
map.put("articles", pageInfo.getList()); map.put("articles", pageInfo.getList());
Map pagination = new HashMap(); Map pagination = new HashMap(3);
pagination.put("paginationPageCount",pageInfo.getPages()); pagination.put("pageSize",pageInfo.getPageSize());
pagination.put("paginationPageNums",pageInfo.getNavigatepageNums()); pagination.put("total",pageInfo.getTotal());
pagination.put("currentPage",pageInfo.getPageNum()); pagination.put("currentPage",pageInfo.getPageNum());
map.put("pagination", pagination); map.put("pagination", pagination);
return GlobalResultGenerator.genSuccessResult(map); return GlobalResultGenerator.genSuccessResult(map);

View File

@ -35,11 +35,11 @@ public class TopicController {
PageHelper.startPage(page, rows); PageHelper.startPage(page, rows);
List<ArticleDTO> list = articleService.findArticlesByTopicName(name); List<ArticleDTO> list = articleService.findArticlesByTopicName(name);
PageInfo pageInfo = new PageInfo(list); PageInfo pageInfo = new PageInfo(list);
Map map = new HashMap(); Map map = new HashMap(2);
map.put("articles", pageInfo.getList()); map.put("articles", pageInfo.getList());
Map pagination = new HashMap(); Map pagination = new HashMap(3);
pagination.put("paginationPageCount",pageInfo.getPages()); pagination.put("pageSize",pageInfo.getPageSize());
pagination.put("paginationPageNums",pageInfo.getNavigatepageNums()); pagination.put("total",pageInfo.getTotal());
pagination.put("currentPage",pageInfo.getPageNum()); pagination.put("currentPage",pageInfo.getPageNum());
map.put("pagination", pagination); map.put("pagination", pagination);
return GlobalResultGenerator.genSuccessResult(map); return GlobalResultGenerator.genSuccessResult(map);

View File

@ -40,11 +40,11 @@ public class UserController {
PageHelper.startPage(page, rows); PageHelper.startPage(page, rows);
List<ArticleDTO> list = articleService.findUserArticlesByIdUser(userDTO.getIdUser()); List<ArticleDTO> list = articleService.findUserArticlesByIdUser(userDTO.getIdUser());
PageInfo pageInfo = new PageInfo(list); PageInfo pageInfo = new PageInfo(list);
Map map = new HashMap(); Map map = new HashMap(2);
map.put("articles", pageInfo.getList()); map.put("articles", pageInfo.getList());
Map pagination = new HashMap(); Map pagination = new HashMap(3);
pagination.put("paginationPageCount",pageInfo.getPages()); pagination.put("pageSize",pageInfo.getPageSize());
pagination.put("paginationPageNums",pageInfo.getNavigatepageNums()); pagination.put("total",pageInfo.getTotal());
pagination.put("currentPage",pageInfo.getPageNum()); pagination.put("currentPage",pageInfo.getPageNum());
map.put("pagination", pagination); map.put("pagination", pagination);
return GlobalResultGenerator.genSuccessResult(map); return GlobalResultGenerator.genSuccessResult(map);