mirror of
https://gitee.com/jzsw-it/yexuejc-base.git
synced 2025-06-08 06:44:04 +08:00
commit
a7132e9b5b
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
.mvn
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
nbproject/private/
|
||||||
|
build/
|
||||||
|
nbbuild/
|
||||||
|
dist/
|
||||||
|
nbdist/
|
||||||
|
.nb-gradle/
|
@ -1,13 +1,13 @@
|
|||||||
<component name="libraryTable">
|
<component name="libraryTable">
|
||||||
<library name="Maven: javax.validation:validation-api:1.1.0.Final">
|
<library name="Maven: javax.validation:validation-api:1.1.0.Final">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="jar://J:/localRepo/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar!/" />
|
<root url="jar://$MAVEN_REPOSITORY$/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC>
|
<JAVADOC>
|
||||||
<root url="jar://J:/localRepo/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final-javadoc.jar!/" />
|
<root url="jar://$MAVEN_REPOSITORY$/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final-javadoc.jar!/" />
|
||||||
</JAVADOC>
|
</JAVADOC>
|
||||||
<SOURCES>
|
<SOURCES>
|
||||||
<root url="jar://J:/localRepo/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final-sources.jar!/" />
|
<root url="jar://$MAVEN_REPOSITORY$/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final-sources.jar!/" />
|
||||||
</SOURCES>
|
</SOURCES>
|
||||||
</library>
|
</library>
|
||||||
</component>
|
</component>
|
@ -7,21 +7,22 @@
|
|||||||
|
|
||||||
|
|
||||||
### 使用
|
### 使用
|
||||||
>yexuejc.base.version=1.1.6
|
>yexuejc.base.version=1.1.7
|
||||||
|
|
||||||
pom.xml
|
pom.xml
|
||||||
```
|
```
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.yexuejc</groupId>
|
<groupId>com.yexuejc.base</groupId>
|
||||||
<artifactId>yexuejc-base</artifactId>
|
<artifactId>yexuejc-base</artifactId>
|
||||||
<version>${yexuejc.base.version}</version>
|
<version>${yexuejc.base.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>jitpack.io</id>
|
<id>yexuejc-nexus-public</id>
|
||||||
<url>https://jitpack.io</url>
|
<name>yexuejc-nexus-public</name>
|
||||||
|
<url>https://nexus.yexuejc.club/repository/maven-public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
```
|
```
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
yexuejc-base 更新记录
|
yexuejc-base 更新记录
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
#### version :1.1.7
|
||||||
|
**time:2018-8-17 11:22:50** <br/>
|
||||||
|
**branch:** master <br/>
|
||||||
|
**update:** <br/>
|
||||||
|
>1. 优化ApiVO
|
||||||
|
#
|
||||||
|
|
||||||
#### version :1.1.6
|
#### version :1.1.6
|
||||||
**time:2018-7-7 11:32:56** <br/>
|
**time:2018-7-7 11:32:56** <br/>
|
||||||
**branch:** master <br/>
|
**branch:** master <br/>
|
||||||
|
19
WIKI.md
19
WIKI.md
@ -1,9 +1,28 @@
|
|||||||
yexuejc-base 文档
|
yexuejc-base 文档
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
> com.yexuejc.base.constant
|
||||||
##### 1. RespsConsts 网络请求统一返回 常量
|
##### 1. RespsConsts 网络请求统一返回 常量
|
||||||
|
> com.yexuejc.base.http
|
||||||
##### 2. Resps 网络请求统一返回类
|
##### 2. Resps 网络请求统一返回类
|
||||||
|
> com.yexuejc.base.pojo
|
||||||
##### 3. ApiVO 接口交互API
|
##### 3. ApiVO 接口交互API
|
||||||
##### 4. BaseVO 基类VO
|
##### 4. BaseVO 基类VO
|
||||||
|
##### 5. PagerVO 分页VO
|
||||||
|
##### 6. ParamsPO 加密参数封装
|
||||||
|
> com.yexuejc.base.util
|
||||||
|
##### 7. AlgorithmUtils 算法工具类:进制转换
|
||||||
|
##### 8. DateTimeUtil 日期时间工具:基于`java.time.*`家族
|
||||||
|
##### 9. DateUtil 日期时间工具:基于`java.util.Date`家族
|
||||||
|
##### 10. ExcelImportUtils excel工具
|
||||||
|
##### 11. FileUtil 文件操作工具
|
||||||
|
##### 12. IdcardValidator 身份证工具
|
||||||
|
##### 13. JsonUtil json操作工具:基于`com.fasterxml.jackson`家族
|
||||||
|
##### 14. JwtUtil jwt库工具
|
||||||
|
##### 15. MapRemoveNullUtil map处理空值
|
||||||
|
##### 16. MoneyUtils 金额转换:元->分 分->元
|
||||||
|
##### 17. RegexUtils 常用正则
|
||||||
|
##### 18. StrUtil 字符串工具
|
||||||
|
##### 19. SysUtils 常用java系统操作封装
|
||||||
|
|
||||||
待完善......
|
待完善......
|
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.yexuejc.base</groupId>
|
<groupId>com.yexuejc.base</groupId>
|
||||||
<artifactId>yexuejc-base</artifactId>
|
<artifactId>yexuejc-base</artifactId>
|
||||||
<version>1.1.6</version>
|
<version>1.1.7</version>
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ public class ApiVO implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用默认返回code
|
* 使用默认返回code
|
||||||
|
*
|
||||||
* @param status
|
* @param status
|
||||||
* @param msg
|
* @param msg
|
||||||
*/
|
*/
|
||||||
@ -55,6 +56,20 @@ public class ApiVO implements Serializable {
|
|||||||
this.msgs = msg;
|
this.msgs = msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ApiVO setStatus(STATUS status, String code, String msg) {
|
||||||
|
this.status = status;
|
||||||
|
this.code = code;
|
||||||
|
this.msgs = StrUtil.isNotEmpty(msg) ? new String[]{msg} : null;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiVO setStatus(STATUS status, String code, String[] msg) {
|
||||||
|
this.status = status;
|
||||||
|
this.code = code;
|
||||||
|
this.msgs = msg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public enum STATUS {
|
public enum STATUS {
|
||||||
/**
|
/**
|
||||||
* 成功
|
* 成功
|
||||||
@ -93,36 +108,24 @@ public class ApiVO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Object object2;
|
private Object object2;
|
||||||
|
|
||||||
public <T extends Object> void setObject1(T obj) {
|
public <T extends Object> ApiVO setObject1(T obj) {
|
||||||
object1 = obj;
|
object1 = obj;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends Object> T getObject1(Class<T> clazz) {
|
public <T extends Object> T getObject1(Class<T> clazz) {
|
||||||
return (T) object1;
|
return (T) object1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends Object> void setObject2(T obj) {
|
public <T extends Object> ApiVO setObject2(T obj) {
|
||||||
object2 = obj;
|
object2 = obj;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends Object> T getObject2(Class<T> clazz) {
|
public <T extends Object> T getObject2(Class<T> clazz) {
|
||||||
return (T) object2;
|
return (T) object2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApiVO setStatus(STATUS status, String code, String msg) {
|
|
||||||
this.status = status;
|
|
||||||
this.code = code;
|
|
||||||
this.msgs = StrUtil.isNotEmpty(msg) ? new String[]{msg} : null;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApiVO setStatus(STATUS status, String code, String[] msg) {
|
|
||||||
this.status = status;
|
|
||||||
this.code = code;
|
|
||||||
this.msgs = msg;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSucc() {
|
public boolean isSucc() {
|
||||||
if (STATUS.S.name().equals(status.name())) {
|
if (STATUS.S.name().equals(status.name())) {
|
||||||
return true;
|
return true;
|
||||||
@ -137,8 +140,9 @@ public class ApiVO implements Serializable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMsg(String msg) {
|
public ApiVO setMsg(String msg) {
|
||||||
this.msgs = StrUtil.isNotEmpty(msg) ? new String[]{msg} : null;
|
this.msgs = StrUtil.isNotEmpty(msg) ? new String[]{msg} : null;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFail() {
|
public boolean isFail() {
|
||||||
@ -149,8 +153,9 @@ public class ApiVO implements Serializable {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(String code) {
|
public ApiVO setCode(String code) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -162,12 +167,14 @@ public class ApiVO implements Serializable {
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(STATUS status) {
|
public ApiVO setStatus(STATUS status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMsgs(String[] msgs) {
|
public ApiVO setMsgs(String[] msgs) {
|
||||||
this.msgs = msgs;
|
this.msgs = msgs;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getMsgs() {
|
public String[] getMsgs() {
|
||||||
|
@ -6,6 +6,7 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 基类VO
|
* 基类VO
|
||||||
|
*
|
||||||
* @PackageName: com.yexuejc.util.base.pojo
|
* @PackageName: com.yexuejc.util.base.pojo
|
||||||
* @Description:
|
* @Description:
|
||||||
* @author: maxf
|
* @author: maxf
|
||||||
@ -15,16 +16,16 @@ public class BaseVO implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = -1442656950873492155L;
|
private static final long serialVersionUID = -1442656950873492155L;
|
||||||
|
|
||||||
public static interface Add {
|
public interface Add {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface Del {
|
public interface Del {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface Mdfy {
|
public interface Mdfy {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface Srch {
|
public interface Srch {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user