-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
haiji.yang
committed
Apr 4, 2020
1 parent
b4f3eb9
commit e886d24
Showing
130 changed files
with
2,609 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...mon/annotation/JavayhBootApplication.java → ...mon/annotation/JavayhBootApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
...h-dependencies/javayh-common-starter/src/main/java/com/javayh/common/page/PageEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.javayh.common.page; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import javax.validation.constraints.Min; | ||
|
||
/** | ||
* <p> | ||
* | ||
* </p> | ||
* | ||
* @author Dylan-haiji | ||
* @version 1.0.0 | ||
* @since 2020-04-04 22:41 | ||
*/ | ||
@Setter | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PageEntity { | ||
|
||
@Min(value = 1, message = "当前页码不合法") | ||
private int pageNo = 1; | ||
|
||
@Min(value = 1, message = "每页展示数据不合法") | ||
private int pageSize; | ||
|
||
} |
98 changes: 98 additions & 0 deletions
98
...yh-dependencies/javayh-common-starter/src/main/java/com/javayh/common/page/PageQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package com.javayh.common.page; | ||
|
||
import com.github.pagehelper.Page; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
/** | ||
* <p> | ||
* 分页工具类 | ||
* </p> | ||
* @version 1.0.0 | ||
* @author Dylan-haiji | ||
* @since 2020/4/4 | ||
*/ | ||
public class PageQuery<T> { | ||
/** | ||
* 当前页码 | ||
*/ | ||
private Integer pageNum; | ||
/** | ||
* 每页显示数量 | ||
*/ | ||
private Integer pageSize; | ||
/** | ||
* 总条目数 | ||
*/ | ||
private Long totalCount; | ||
/** | ||
* 总页数 | ||
*/ | ||
private Integer totalPage; | ||
|
||
private List<T> list; | ||
|
||
public PageQuery() { | ||
} | ||
|
||
public static <T> PageQuery<T> ofPage(List<T> list) { | ||
return new PageQuery<>(list); | ||
} | ||
private PageQuery(List<T> list) { | ||
this.list = list; | ||
if (list instanceof Page) { | ||
Page page = (Page)list; | ||
this.pageNum = page.getPageNum(); | ||
this.pageSize = page.getPageSize(); | ||
this.totalPage = page.getPages(); | ||
this.totalCount = page.getTotal(); | ||
} else { | ||
this.pageNum = 1; | ||
this.pageSize = ((Collection) list).size(); | ||
this.totalPage = this.pageSize > 0 ? 1 : 0; | ||
this.totalCount = (long) ((Collection) list).size(); | ||
} | ||
|
||
} | ||
|
||
public Integer getPageNum() { | ||
return pageNum; | ||
} | ||
|
||
public void setPageNum(Integer pageNum) { | ||
this.pageNum = pageNum; | ||
} | ||
|
||
public Integer getPageSize() { | ||
return pageSize; | ||
} | ||
|
||
public void setPageSize(Integer pageSize) { | ||
this.pageSize = pageSize; | ||
} | ||
|
||
public Long getTotalCount() { | ||
return totalCount; | ||
} | ||
|
||
public void setTotalCount(Long totalCount) { | ||
this.totalCount = totalCount; | ||
} | ||
|
||
public Integer getTotalPage() { | ||
return totalPage; | ||
} | ||
|
||
public void setTotalPage(Integer totalPage) { | ||
this.totalPage = totalPage; | ||
} | ||
|
||
public List<T> getList() { | ||
return list; | ||
} | ||
|
||
public void setList(List<T> list) { | ||
this.list = list; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>javayh-dependencies</artifactId> | ||
<groupId>com.javayh</groupId> | ||
<version>1.0.0</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<description>关系性数据库多数据源</description> | ||
<artifactId>javayh-db-starter</artifactId> | ||
<packaging>jar</packaging> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.javayh</groupId> | ||
<artifactId>javayh-mybatis-starter</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.