mirror of
https://github.com/CarmJos/EasyPlugin.git
synced 2026-06-05 00:58:17 +08:00
feat(users): Seperated users registry interface for api usage.
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>easyplugin-parent</artifactId>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<version>1.5.12</version>
|
||||
<version>1.5.13</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import org.junit.Test;
|
||||
|
||||
public class PageTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
System.out.println(maxPage(0, 10));
|
||||
System.out.println(maxPage(10, 10));
|
||||
System.out.println(maxPage(5, 10));
|
||||
System.out.println(maxPage(15, 10));
|
||||
System.out.println(maxPage(19, 10));
|
||||
System.out.println(maxPage(20, 10));
|
||||
|
||||
}
|
||||
|
||||
int maxPage(int contents, int size) {
|
||||
if (contents == 0 || size == 0) return 1;
|
||||
return (contents / size) + ((contents % size) == 0 ? 0 : 1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user