Compare commits
2 Commits
2f607878cb
...
c7e83f0671
| Author | SHA1 | Date | |
|---|---|---|---|
| c7e83f0671 | |||
| 2784183fde |
57
pom.xml
57
pom.xml
@ -20,17 +20,60 @@
|
|||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
<version>3.13.0</version>
|
<version>3.1.3</version>
|
||||||
<configuration>
|
</plugin>
|
||||||
<source>21</source>
|
<plugin>
|
||||||
<target>21</target>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<encoding>UTF-8</encoding>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
</configuration>
|
<version>3.3.1</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>jar-no-fork</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>3.11.2</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-javadocs</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>timi_nexus</id>
|
||||||
|
<url>https://nexus.imyeyu.com/repository/maven-releases/</url>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>timi_nexus</id>
|
||||||
|
<url>https://nexus.imyeyu.com/repository/maven-public/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
|||||||
57
src/main/java/com/imyeyu/java/bean/BasePage.java
Normal file
57
src/main/java/com/imyeyu/java/bean/BasePage.java
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
package com.imyeyu.java.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 夜雨
|
||||||
|
* @since 2025-07-25 11:04
|
||||||
|
*/
|
||||||
|
public class BasePage {
|
||||||
|
|
||||||
|
/** 下标 */
|
||||||
|
protected int index = 0;
|
||||||
|
|
||||||
|
/** 数据量 */
|
||||||
|
protected int size = 16;
|
||||||
|
|
||||||
|
/** 关键字 */
|
||||||
|
protected String keyword;
|
||||||
|
|
||||||
|
public BasePage() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasePage(int index, int size) {
|
||||||
|
this.index = index;
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void prev() {
|
||||||
|
index--;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void next() {
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIndex() {
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndex(int index) {
|
||||||
|
this.index = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(int size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeyword() {
|
||||||
|
return keyword;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyword(String keyword) {
|
||||||
|
this.keyword = keyword;
|
||||||
|
}
|
||||||
|
}
|
||||||
56
src/main/java/com/imyeyu/java/bean/BasePageResult.java
Normal file
56
src/main/java/com/imyeyu/java/bean/BasePageResult.java
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
package com.imyeyu.java.bean;
|
||||||
|
|
||||||
|
import com.imyeyu.java.TimiJava;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 夜雨
|
||||||
|
* @since 2025-07-25 11:04
|
||||||
|
*/
|
||||||
|
public class BasePageResult<T> {
|
||||||
|
|
||||||
|
/** 总数据量 */
|
||||||
|
protected long total;
|
||||||
|
|
||||||
|
/** 总页数 */
|
||||||
|
protected int pages;
|
||||||
|
|
||||||
|
protected List<T> list;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取总数据量
|
||||||
|
*
|
||||||
|
* @return 总数据量
|
||||||
|
*/
|
||||||
|
public long getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置总数据量
|
||||||
|
*
|
||||||
|
* @param total 总数据量
|
||||||
|
*/
|
||||||
|
public void setTotal(long total) {
|
||||||
|
this.total = total;
|
||||||
|
if (TimiJava.isNotEmpty(list)) {
|
||||||
|
pages = (int) Math.ceil(1D * total / list.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> getList() {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setList(List<T> list) {
|
||||||
|
this.list = list;
|
||||||
|
if (TimiJava.isNotEmpty(list)) {
|
||||||
|
pages = (int) Math.ceil(1D * total / list.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPages() {
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user