2022-03-31初始化
This commit is contained in:
191
yyd-base/yyd-base-common/pom.xml
Normal file
191
yyd-base/yyd-base-common/pom.xml
Normal file
@@ -0,0 +1,191 @@
|
||||
<?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>yyd-base</artifactId>
|
||||
<groupId>com.yyd</groupId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>yyd-base-common</artifactId>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-annotation</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-ui</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-micro-spring-boot-starter</artifactId>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!--引入redis-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.lettuce</groupId>
|
||||
<artifactId>lettuce-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.auth0/java-jwt -->
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.penggle</groupId>
|
||||
<artifactId>kaptcha</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.axis</groupId>
|
||||
<artifactId>axis</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>axis</groupId>
|
||||
<artifactId>axis-jaxrpc</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/commons-discovery/commons-discovery -->
|
||||
<dependency>
|
||||
<groupId>commons-discovery</groupId>
|
||||
<artifactId>commons-discovery</artifactId>
|
||||
<version>0.5</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/wsdl4j/wsdl4j -->
|
||||
<dependency>
|
||||
<groupId>wsdl4j</groupId>
|
||||
<artifactId>wsdl4j</artifactId>
|
||||
<version>1.6.3</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.73</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>3.14</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 二维码 -->
|
||||
<!-- https://mvnrepository.com/artifact/com.google.zxing/core -->
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>3.3.2</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.google.zxing/javase -->
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>javase</artifactId>
|
||||
<version>3.3.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itextpdf</artifactId>
|
||||
<version>5.4.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--极光推送-->
|
||||
<dependency>
|
||||
<groupId>cn.jpush.api</groupId>
|
||||
<artifactId>jpush-client</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.jpush.api</groupId>
|
||||
<artifactId>jiguang-common</artifactId>
|
||||
<version>1.1.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>4.1.6.Final</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- 拼音 -->
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<!--工具包-->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,158 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Project: yxt-common <br/>
|
||||
* File: BaseEntity.java <br/>
|
||||
* Class: com.yxt.common.core.domain.BaseEntity <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/8/4 1:01 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
public class BaseEntity extends EntityWithId {
|
||||
|
||||
public String getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public Integer getLockVersion() {
|
||||
return lockVersion;
|
||||
}
|
||||
|
||||
public void setLockVersion(Integer lockVersion) {
|
||||
this.lockVersion = lockVersion;
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getModifyTime() {
|
||||
return modifyTime;
|
||||
}
|
||||
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(Integer state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Integer getIsEnable() {
|
||||
return isEnable;
|
||||
}
|
||||
|
||||
public void setIsEnable(Integer isEnable) {
|
||||
this.isEnable = isEnable;
|
||||
}
|
||||
|
||||
public Integer getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(Integer isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public String getCreateBySid() {
|
||||
return createBySid;
|
||||
}
|
||||
|
||||
public void setCreateBySid(String createBySid) {
|
||||
this.createBySid = createBySid;
|
||||
}
|
||||
|
||||
public String getUpdateBySid() {
|
||||
return updateBySid;
|
||||
}
|
||||
|
||||
public void setUpdateBySid(String updateBySid) {
|
||||
this.updateBySid = updateBySid;
|
||||
}
|
||||
|
||||
@ApiModelProperty("字符型编号")
|
||||
private String sid = UUID.randomUUID().toString();
|
||||
|
||||
// @Version
|
||||
@ApiModelProperty("记录版本,锁")
|
||||
private Integer lockVersion = 0;
|
||||
|
||||
@ApiModelProperty("记录创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date createTime = new Date();
|
||||
@ApiModelProperty("记录最后修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
private Date modifyTime = new Date();
|
||||
@ApiModelProperty("记录状态值")
|
||||
private Integer state = 1;
|
||||
@ApiModelProperty("记录是否可用,1:可用(默认),0:不可用")
|
||||
private Integer isEnable = 1;
|
||||
|
||||
// @TableLogic
|
||||
@ApiModelProperty("记录是否被删除,0:未删除(默认),1:已经删除")
|
||||
private Integer isDelete = 0;
|
||||
|
||||
@ApiModelProperty("备注信息")
|
||||
private String remarks;
|
||||
@ApiModelProperty("创建者")
|
||||
private String createBySid;
|
||||
@ApiModelProperty("更新者")
|
||||
private String updateBySid;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.yyd.base.common.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Entity implements Serializable {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.yyd.base.common.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class EntityWithId extends Entity {
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@ApiModelProperty("ID值的字符串形式")
|
||||
public String getIdStr() {
|
||||
if (null == id) {
|
||||
return "";
|
||||
}
|
||||
return "" + id;
|
||||
}
|
||||
|
||||
@ApiModelProperty("ID,唯一编号")
|
||||
private Integer id;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ClassName:" + getClass().getName() + ";id:" + getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int id2 = Long.hashCode(getId());
|
||||
return super.hashCode() + id2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof EntityWithId)) {
|
||||
return false;
|
||||
}
|
||||
EntityWithId entity = (EntityWithId) obj;
|
||||
return this.getId().equals(entity.getId());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.dto;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.yyd.base.common.domain.Entity;
|
||||
import com.yyd.base.common.vo.Vo;
|
||||
|
||||
/**
|
||||
* Project: jbsc-commons <br/>
|
||||
* File: Dto.java <br/>
|
||||
* Class: org.jbase.jbsc.commons.core.dto.Dto <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/9/17 23:30 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
public interface Dto extends Vo {
|
||||
|
||||
default <E extends Entity> void fillEntity(E e) {
|
||||
BeanUtil.copyProperties(this, e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.query;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Project: jbsc-commons <br/>
|
||||
* File: PagerQuery.java <br/>
|
||||
* Class: org.jbase.jbsc.commons.core.query.PagerQuery <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/9/21 下午3:58 <br/>
|
||||
*
|
||||
* @author popo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
public class PagerQuery<T extends Query> implements Serializable {
|
||||
|
||||
public PagerQuery() {
|
||||
}
|
||||
|
||||
public PagerQuery(long current) {
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
public PagerQuery(long current, long size) {
|
||||
this.size = size;
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
// @ApiModelProperty("总记录数")
|
||||
//private long total = 0L; //总记录数
|
||||
@ApiModelProperty(value = "每页记录数", example = "10")
|
||||
private long size = 10L; //每页记录数
|
||||
@ApiModelProperty(value = "当前页号", example = "1")
|
||||
private long current = 1L; //当前页号
|
||||
@ApiModelProperty("查询条件的项")
|
||||
private T params;
|
||||
|
||||
// @ApiModelProperty("每页记录数,size的别名,默认值为10")
|
||||
// public PagerQuery set_p_size(long _p_size) {
|
||||
// this.size = _p_size;
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// @ApiModelProperty("当前页号,current的别名,默认值为1")
|
||||
// public PagerQuery set_p_no(long _p_no) {
|
||||
// this.current = _p_no;
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// @ApiModelProperty("总记录数,total的别名,默认值为0")
|
||||
// public PagerQuery set_p_total(long _p_total) {
|
||||
// this.total = _p_total;
|
||||
// return this;
|
||||
// }
|
||||
|
||||
/* public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public PagerQuery setTotal(long total) {
|
||||
this.total = total;
|
||||
return this;
|
||||
}
|
||||
*/
|
||||
public long getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public PagerQuery setSize(long size) {
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getCurrent() {
|
||||
return current;
|
||||
}
|
||||
|
||||
public PagerQuery setCurrent(long current) {
|
||||
this.current = current;
|
||||
return this;
|
||||
}
|
||||
|
||||
public T getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public PagerQuery setParams(T params) {
|
||||
this.params = params;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void fromPagerQuery(PagerQuery s_query)
|
||||
{
|
||||
this.setCurrent(s_query.getCurrent()).setSize(s_query.getSize()).setParams(params.fromMap(s_query.getParams().toMap()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.query;
|
||||
|
||||
|
||||
import com.yyd.base.common.vo.Vo;
|
||||
|
||||
/**
|
||||
* Project: jbsc-commons <br/>
|
||||
* File: Query.java <br/>
|
||||
* Class: org.jbase.jbsc.commons.core.query.Query <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/9/21 下午3:24 <br/>
|
||||
*
|
||||
* @author popo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
public interface Query extends Vo {
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yyd.base.common.result;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author liuguohui
|
||||
* @Date 2021/10/11
|
||||
*/
|
||||
@ApiModel(description = "手机端返回数据结构(同查询数据字典)")
|
||||
@Data
|
||||
public class AppResultData {
|
||||
|
||||
@ApiModelProperty(value = "数据字典项sid")
|
||||
private String sid;
|
||||
|
||||
@ApiModelProperty(value = "数据字典项key")
|
||||
private String dictKey;
|
||||
|
||||
@ApiModelProperty(value = "数据字典类型")
|
||||
private String dictType;
|
||||
|
||||
@ApiModelProperty(value = "数据字典项名称")
|
||||
private String dictValue;
|
||||
@ApiModelProperty(value = "父级sid:0为第一级")
|
||||
private String parentSid;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.yyd.base.common.result;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2021/6/16 10:50
|
||||
* @description
|
||||
*/
|
||||
|
||||
public class HttpStatus {
|
||||
|
||||
/**
|
||||
* 操作成功
|
||||
*/
|
||||
public static final int SUCCESS = 200;
|
||||
|
||||
/**
|
||||
* 系统内部错误
|
||||
*/
|
||||
public static final int ERROR = 500;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.result;
|
||||
|
||||
/**
|
||||
* Project: yxt-common <br/>
|
||||
* File: IResultCodeMsg.java <br/>
|
||||
* Class: com.yxt.common.core.result.IResultCodeMsg <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021/9/11 下午11:00 <br/>
|
||||
*
|
||||
* @author popo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
public interface IResultCodeMsg {
|
||||
String getCode();
|
||||
String getMsg();
|
||||
}
|
||||
@@ -0,0 +1,304 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.result;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Project: yxt-common-core <br/>
|
||||
* File: ResultBean.java <br/>
|
||||
* Class: com.yxt.common.core.result.ResultBean <br/>
|
||||
* Description: 通过接口、Rest、逻辑处理执行后的结果信息. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/8/4 0:51 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@ApiModel(description = "返回结果")
|
||||
public class ResultBean<T> implements Serializable {
|
||||
private static final long serialVersionUID = 4529658978692424234L;
|
||||
|
||||
// @SuppressWarnings("unchecked")
|
||||
// private Class<T> clazz() {
|
||||
// Class<T> targetClass = (Class<T>) ((ParameterizedType) this.getClass().getGenericSuperclass())
|
||||
// .getActualTypeArguments()[0];
|
||||
//// if(targetClass==null)
|
||||
//// targetClass=Object.class;
|
||||
// return targetClass;
|
||||
// }
|
||||
//
|
||||
// @SuppressWarnings("unchecked")
|
||||
// private T obj() {
|
||||
// T instance = null;
|
||||
// Class<T> targetClass = (Class<T>) ((ParameterizedType) this.getClass().getGenericSuperclass())
|
||||
// .getActualTypeArguments()[1];
|
||||
// try {
|
||||
// instance = targetClass.newInstance();
|
||||
// } catch (InstantiationException e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// } catch (IllegalAccessException e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return instance;
|
||||
// }
|
||||
|
||||
@ApiModelProperty("对象创建的时间戳")
|
||||
private long timestamp = System.currentTimeMillis();
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
// 是否成功
|
||||
@ApiModelProperty("是否成功: true or false")
|
||||
private boolean success;
|
||||
|
||||
// 消息 返回结果的说明
|
||||
@ApiModelProperty("返回结果的说明")
|
||||
private String msg;
|
||||
|
||||
// 结果状态码
|
||||
@ApiModelProperty("结果状态码")
|
||||
private String code;
|
||||
|
||||
// 数据
|
||||
@ApiModelProperty("业务数据")
|
||||
private T data;
|
||||
|
||||
private String message;
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public ResultBean<T> setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultBean() {
|
||||
}
|
||||
|
||||
public ResultBean(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public ResultBean(boolean success, String msg) {
|
||||
this.success = success;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public ResultBean(boolean success, String msg, String code) {
|
||||
this.success = success;
|
||||
this.msg = msg;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ResultBean(T data) {
|
||||
this.success = true;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public ResultBean(String code, T data) {
|
||||
this.success = true;
|
||||
this.code = code;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public ResultBean(String code, String msg, T data) {
|
||||
this.success = true;
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public boolean getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public ResultBean<T> setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public ResultBean<T> setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public ResultBean<T> setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
// if (this.data == null && this.map != null && !this.map.isEmpty()) {
|
||||
//// Object t = new Object();
|
||||
//// Object r = (Object)this.map;map
|
||||
//// BeanUtil.fillBeanWithMap(this.map, t, false);
|
||||
// this.data = obj();
|
||||
// BeanUtil.copyProperties(this.map, this.data, true);
|
||||
//// this.data = (T) t;
|
||||
//// return t;
|
||||
// }
|
||||
return data;
|
||||
}
|
||||
|
||||
public ResultBean<T> setData(T data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultBean<T> successOne() {
|
||||
this.setSuccess(true);
|
||||
this.setCode("0");
|
||||
this.setMessage("成功!");
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultBean<T> failOne() {
|
||||
this.setSuccess(false);
|
||||
this.setCode(String.valueOf(HttpStatus.ERROR));
|
||||
this.setMessage("操作失败!");
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultBean<T> success() {
|
||||
this.setSuccess(true);
|
||||
this.setCode(String.valueOf(HttpStatus.SUCCESS));
|
||||
this.setMsg("操作成功!");
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultBean<T> fail() {
|
||||
this.setSuccess(false);
|
||||
this.setCode(String.valueOf(HttpStatus.ERROR));
|
||||
this.setMsg("操作失败!");
|
||||
return this;
|
||||
}
|
||||
|
||||
public static <T> ResultBean<T> fireSuccess() {
|
||||
ResultBean<T> rb = new ResultBean<T>();
|
||||
rb.setSuccess(true);
|
||||
rb.setCode(String.valueOf(HttpStatus.SUCCESS));
|
||||
rb.setMsg("操作成功!");
|
||||
return rb;
|
||||
}
|
||||
|
||||
public static <T> ResultBean<T> fireFail() {
|
||||
ResultBean<T> rb = new ResultBean<T>();
|
||||
rb.setSuccess(false);
|
||||
rb.setCode(String.valueOf(HttpStatus.ERROR));
|
||||
rb.setMsg("操作失败!");
|
||||
return rb;
|
||||
}
|
||||
|
||||
// @ApiModelProperty("无类型的业务数据对象")
|
||||
//// @JsonIgnore
|
||||
// private Map<String, Object> map = Collections.emptyMap();
|
||||
//
|
||||
// public ResultBean<T> clear() {
|
||||
// this.map = null;
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public Object get(String key) {
|
||||
// if (this.map == null)
|
||||
// return null;
|
||||
// return this.map.get(key);
|
||||
// }
|
||||
//
|
||||
// public ResultBean<T> remove(String key) {
|
||||
// if (this.map == null)
|
||||
// return this;
|
||||
// this.map.remove(key);
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public ResultBean<T> put(String key, Object value) {
|
||||
// if (this.map == null)
|
||||
// this.map = new HashMap<>();
|
||||
// this.map.put(key, value);
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public Map<String, Object> getMap() {
|
||||
// return this.map;
|
||||
// }
|
||||
//
|
||||
// public ResultBean<T> setMap(Map<String, Object> map) {
|
||||
// this.map = map;
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public ResultBean<T> putAll(Map<String, Object> map) {
|
||||
// if (this.map == null)
|
||||
// this.map = new HashMap<>();
|
||||
// this.map.putAll(map);
|
||||
// return this;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 设置返回code及msg
|
||||
*
|
||||
* @param codeMsg Code和Msg的枚举
|
||||
* @return
|
||||
*/
|
||||
public ResultBean<T> setCode(IResultCodeMsg codeMsg) {
|
||||
this.code = codeMsg.getCode();
|
||||
this.msg = codeMsg.getMsg();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回失败信息,并指定结果code
|
||||
* @param codeMsg Code和Msg的枚举
|
||||
* @return
|
||||
*/
|
||||
public ResultBean<T> fail(IResultCodeMsg codeMsg) {
|
||||
this.setSuccess(false);
|
||||
this.code = codeMsg.getCode();
|
||||
this.msg = codeMsg.getMsg();
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,332 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.result;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Project: yxt-common-core <br/>
|
||||
* File: ResultBean.java <br/>
|
||||
* Class: com.yxt.common.core.result.ResultBean <br/>
|
||||
* Description: 通过接口、Rest、逻辑处理执行后的结果信息. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/8/4 0:51 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@ApiModel(description = "返回结果")
|
||||
public class ResultBeanOfEnum<T> implements Serializable {
|
||||
private static final long serialVersionUID = 4529658978692424234L;
|
||||
|
||||
// @SuppressWarnings("unchecked")
|
||||
// private Class<T> clazz() {
|
||||
// Class<T> targetClass = (Class<T>) ((ParameterizedType) this.getClass().getGenericSuperclass())
|
||||
// .getActualTypeArguments()[0];
|
||||
//// if(targetClass==null)
|
||||
//// targetClass=Object.class;
|
||||
// return targetClass;
|
||||
// }
|
||||
//
|
||||
// @SuppressWarnings("unchecked")
|
||||
// private T obj() {
|
||||
// T instance = null;
|
||||
// Class<T> targetClass = (Class<T>) ((ParameterizedType) this.getClass().getGenericSuperclass())
|
||||
// .getActualTypeArguments()[1];
|
||||
// try {
|
||||
// instance = targetClass.newInstance();
|
||||
// } catch (InstantiationException e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// } catch (IllegalAccessException e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return instance;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty("对象创建的时间戳")
|
||||
private long timestamp = System.currentTimeMillis();
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
// 是否成功
|
||||
@ApiModelProperty("是否成功: true or false")
|
||||
private boolean success;
|
||||
|
||||
// 消息 返回结果的说明
|
||||
@ApiModelProperty("返回结果的说明")
|
||||
private String msg;
|
||||
|
||||
// 结果状态码
|
||||
@ApiModelProperty("结果状态码")
|
||||
private String code;
|
||||
|
||||
// 数据
|
||||
@ApiModelProperty("业务数据")
|
||||
private T data;
|
||||
|
||||
private String message;
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum<T> setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum() {
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum(boolean success, String msg) {
|
||||
this.success = success;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum(boolean success, String msg, String code) {
|
||||
this.success = success;
|
||||
this.msg = msg;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum(T data) {
|
||||
this.success = true;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum(String code, T data) {
|
||||
this.success = true;
|
||||
this.code = code;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum(String code, String msg, T data) {
|
||||
this.success = true;
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public boolean getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum<T> setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum<T> setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum<T> setCode(String code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum<T> setCode(CodeMsg codeMsg) {
|
||||
// this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
// if (this.data == null && this.map != null && !this.map.isEmpty()) {
|
||||
//// Object t = new Object();
|
||||
//// Object r = (Object)this.map;map
|
||||
//// BeanUtil.fillBeanWithMap(this.map, t, false);
|
||||
// this.data = obj();
|
||||
// BeanUtil.copyProperties(this.map, this.data, true);
|
||||
//// this.data = (T) t;
|
||||
//// return t;
|
||||
// }
|
||||
return data;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum<T> setData(T data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
public ResultBeanOfEnum<T> successOne() {
|
||||
this.setSuccess(true);
|
||||
this.setCode("0");
|
||||
this.setMessage("成功!");
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum<T> failOne() {
|
||||
this.setSuccess(false);
|
||||
this.setCode(String.valueOf(HttpStatus.ERROR));
|
||||
this.setMessage("操作失败!");
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum<T> success() {
|
||||
this.setSuccess(true);
|
||||
this.setCode(String.valueOf(HttpStatus.SUCCESS));
|
||||
this.setMsg("操作成功!");
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultBeanOfEnum<T> fail() {
|
||||
this.setSuccess(false);
|
||||
this.setCode(String.valueOf(HttpStatus.ERROR));
|
||||
this.setMsg("操作失败!");
|
||||
return this;
|
||||
}
|
||||
|
||||
public static <T> ResultBeanOfEnum<T> fireSuccess() {
|
||||
ResultBeanOfEnum<T> rb = new ResultBeanOfEnum<T>();
|
||||
rb.setSuccess(true);
|
||||
rb.setCode(String.valueOf(HttpStatus.SUCCESS));
|
||||
rb.setMsg("操作成功!");
|
||||
return rb;
|
||||
}
|
||||
|
||||
public static <T> ResultBeanOfEnum<T> fireFail() {
|
||||
ResultBeanOfEnum<T> rb = new ResultBeanOfEnum<T>();
|
||||
rb.setSuccess(false);
|
||||
rb.setCode(String.valueOf(HttpStatus.ERROR));
|
||||
rb.setMsg("操作失败!");
|
||||
return rb;
|
||||
}
|
||||
|
||||
// @ApiModelProperty("无类型的业务数据对象")
|
||||
//// @JsonIgnore
|
||||
// private Map<String, Object> map = Collections.emptyMap();
|
||||
//
|
||||
// public ResultBean<T> clear() {
|
||||
// this.map = null;
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public Object get(String key) {
|
||||
// if (this.map == null)
|
||||
// return null;
|
||||
// return this.map.get(key);
|
||||
// }
|
||||
//
|
||||
// public ResultBean<T> remove(String key) {
|
||||
// if (this.map == null)
|
||||
// return this;
|
||||
// this.map.remove(key);
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public ResultBean<T> put(String key, Object value) {
|
||||
// if (this.map == null)
|
||||
// this.map = new HashMap<>();
|
||||
// this.map.put(key, value);
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public Map<String, Object> getMap() {
|
||||
// return this.map;
|
||||
// }
|
||||
//
|
||||
// public ResultBean<T> setMap(Map<String, Object> map) {
|
||||
// this.map = map;
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public ResultBean<T> putAll(Map<String, Object> map) {
|
||||
// if (this.map == null)
|
||||
// this.map = new HashMap<>();
|
||||
// this.map.putAll(map);
|
||||
// return this;
|
||||
// }
|
||||
|
||||
public enum CodeMsg{
|
||||
/**
|
||||
* 返回正常
|
||||
*/
|
||||
HTML200("200","返回正常"),
|
||||
|
||||
/**
|
||||
* 页面不存在
|
||||
*/
|
||||
HTML404("404","页面不存在"),
|
||||
|
||||
/**
|
||||
* 服务器错误
|
||||
*/
|
||||
HTML500("500","服务器错误");
|
||||
|
||||
private String code;
|
||||
private String msg;
|
||||
|
||||
private CodeMsg(String code,String msg){
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getMsg(){
|
||||
return msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code得到枚举实例
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public static CodeMsg byCode(String code){
|
||||
for(CodeMsg cm: CodeMsg.values()){
|
||||
if(cm.getCode().equals(code)){
|
||||
return cm;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.utils;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yyd.base.common.query.PagerQuery;
|
||||
import com.yyd.base.common.vo.PagerVo;
|
||||
import com.yyd.base.common.vo.Vo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Project: jbsc-commons <br/>
|
||||
* File: PagerUtil.java <br/>
|
||||
* Class: org.jbase.jbsc.commons.base.utils.PagerUtil <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/9/22 上午9:35 <br/>
|
||||
*
|
||||
* @author popo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
public abstract class PagerUtil {
|
||||
|
||||
public static <T> IPage<T> queryToPage(PagerQuery pq) {
|
||||
IPage<T> page = new Page<>();
|
||||
page.setSize(pq.getSize()).setCurrent(pq.getCurrent());
|
||||
return page;
|
||||
}
|
||||
|
||||
public static <V, T> PagerVo<V> pageToVo(IPage pr, PagerVo<V> pv) {
|
||||
if (pv == null)
|
||||
pv = new PagerVo<V>();
|
||||
pv.setCurrent(pr.getCurrent()).setSize(pr.getSize())
|
||||
.setTotal(pr.getTotal()).setPages(pr.getPages())
|
||||
.setRecords(pr.getRecords());
|
||||
return pv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换pagerVo
|
||||
*
|
||||
* @param soure
|
||||
* @param clazz
|
||||
* @return
|
||||
*/
|
||||
public static <S extends Vo, T extends Vo> PagerVo<T> switchPagerVo(
|
||||
PagerVo<S> soure) {
|
||||
if (soure == null)
|
||||
return null;
|
||||
|
||||
PagerVo<T> target = new PagerVo<>();
|
||||
target.setCurrent(soure.getCurrent()).setPages(soure.getPages())
|
||||
.setSize(soure.getSize()).setTotal(soure.getTotal());
|
||||
target.setRecords(new ArrayList<T>());
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
/*
|
||||
* public static <S, V> PagerVo<V> pageVoToVo(PagerVo<S> pvs, PagerVo<V>
|
||||
* pvt) { if (pvt == null) pvt = new PagerVo<V>();
|
||||
* pvt.setCurrent(pvs.getCurrent
|
||||
* ()).setSize(pvs.getSize()).setTotal(pvs.getTotal
|
||||
* ()).setPages(pvs.getPages());
|
||||
*
|
||||
* for(int i=0;i<pvs.getRecords().size();i++) { WfTaskAppVo taskAppVo=new
|
||||
* WfTaskAppVo();
|
||||
*
|
||||
* pvt.getRecords().add(taskAppVo.fromMap(pvs.getRecords().get(i).toMap()));
|
||||
* }
|
||||
*
|
||||
*
|
||||
* return pv; }
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.yyd.base.common.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ApiModel(description = "返回的分页结果")
|
||||
public class PagerVo<T> implements Serializable {
|
||||
|
||||
@ApiModelProperty("总页数")
|
||||
private long pages = 1L; //总页数
|
||||
@ApiModelProperty("总记录数")
|
||||
private long total = 0L; //总记录数
|
||||
@ApiModelProperty("每页记录数")
|
||||
private long size = 10L; //每页记录数
|
||||
@ApiModelProperty("当前页号")
|
||||
private long current = 1L; //当前页号
|
||||
|
||||
@ApiModelProperty("当前页的数据")
|
||||
private List<T> records = Collections.emptyList(); //当前页的数据
|
||||
@ApiModelProperty("统计信息")
|
||||
private String msg = "";
|
||||
@ApiModelProperty("其它信息")
|
||||
private Map<String, Object> map = Collections.emptyMap();
|
||||
|
||||
|
||||
public PagerVo() {
|
||||
this.pages = 1L; //总页数
|
||||
this.total = 0L; //总记录数
|
||||
this.size = 10L; //每页记录数
|
||||
this.current = 1L; //当前页号
|
||||
this.records = Collections.emptyList(); //当前页的数据
|
||||
}
|
||||
|
||||
public PagerVo(long current) {
|
||||
this.pages = 1L; //总页数
|
||||
this.total = 0L; //总记录数
|
||||
this.size = 10L; //每页记录数
|
||||
this.current = current; //当前页号
|
||||
this.records = Collections.emptyList(); //当前页的数据
|
||||
}
|
||||
|
||||
public long getPages() {
|
||||
return pages;
|
||||
}
|
||||
|
||||
public PagerVo<T> setPages(long pages) {
|
||||
this.pages = pages;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public PagerVo<T> setTotal(long total) {
|
||||
this.total = total;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public PagerVo<T> setSize(long size) {
|
||||
this.size = size;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getCurrent() {
|
||||
return current;
|
||||
}
|
||||
|
||||
public PagerVo<T> setCurrent(long current) {
|
||||
this.current = current;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<T> getRecords() {
|
||||
return records;
|
||||
}
|
||||
|
||||
public PagerVo<T> setRecords(List<T> records) {
|
||||
this.records = records;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public Map<String, Object> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
public void setMap(Map<String, Object> map) {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Project: jbsc-commons <br/>
|
||||
* File: Tail.java <br/>
|
||||
* Class: org.jbase.jbsc.commons.core.vo.Tail <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/9/21 下午3:22 <br/>
|
||||
*
|
||||
* @author popo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
public interface Tail extends Serializable {
|
||||
public Object get(String key);
|
||||
public void set(String key,Object value);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.vo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Project: jbsc-commons <br/>
|
||||
* File: TailBean.java <br/>
|
||||
* Class: org.jbase.jbsc.commons.core.vo.TailBean <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/9/21 下午3:22 <br/>
|
||||
*
|
||||
* @author popo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
public class TailBean implements Tail {
|
||||
|
||||
protected Map<String, Object> extMap = new HashMap<String, Object>();
|
||||
|
||||
public Object get(String key) {
|
||||
return extMap.get(key);
|
||||
}
|
||||
|
||||
public void set(String key, Object value) {
|
||||
this.extMap.put(key, value);
|
||||
}
|
||||
|
||||
public Map<String, Object> getTails() {
|
||||
return extMap;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yyd.base.common.vo;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.yyd.base.common.domain.Entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Project: jbsc-commons <br/>
|
||||
* File: Vo.java <br/>
|
||||
* Class: org.jbase.jbsc.commons.core.vo.Vo <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/9/18 0:03 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
public interface Vo extends Serializable {
|
||||
|
||||
default Map<String, Object> toMap() {
|
||||
return BeanUtil.beanToMap(this);
|
||||
}
|
||||
|
||||
default <V extends Vo> V fromMap(Map<String, Object> map) {
|
||||
return (V) BeanUtil.fillBeanWithMap(map, this, false);
|
||||
}
|
||||
default <E extends Entity> void fromEntity(E e) {
|
||||
BeanUtil.copyProperties(e, this);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user