'合并分支'

This commit is contained in:
lxyer 2019-05-01 11:45:16 +08:00
parent 15ee570d7b
commit 1edf4abdf9
59 changed files with 90 additions and 111 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,90 @@
package net.tccn.base;
import java.util.HashMap;
import java.util.Map;
/**
* Created by liangxianyou
*/
public class JBean<T> /*extends RetResult*/ {
private int retcode;
private String retinfo = "";
private T result;
private Map<String, Object> attach;
public JBean(int retcode) {
this.retcode = retcode;
}
public JBean(int retcode, String retinfo) {
this.retcode = retcode;
this.retinfo = retinfo;
}
public static JBean by(int retcode, String retinfo){
JBean jBean = new JBean(retcode, retinfo);
return jBean;
}
public static JBean by(int retcode, String retinfo, Object t){
JBean jBean = new JBean(retcode, retinfo);
jBean.setResult(t);
return jBean;
}
public JBean(T result) {
this.result = result;
}
public int getRetcode() {
return retcode;
}
public void setRetcode(int retcode) {
this.retcode = retcode;
}
public String getRetinfo() {
return retinfo;
}
public void setRetinfo(String retinfo) {
this.retinfo = retinfo;
}
public T getResult() {
return result;
}
public void setResult(T result) {
this.result = result;
}
public Map<String, Object> getAttach() {
return attach;
}
public void setAttach(Map<String, Object> attach) {
this.attach = attach;
}
public JBean attach(String key, Object object){
if (attach == null)
attach = new HashMap<>();
attach.put(key, object);
return this;
}
private static final JBean ok = new JBean(0);
public static JBean ok(){
return ok;
}
public static JBean faild(String retinfo){
return new JBean(-1, retinfo);
}
public static JBean by(Object object) {
return new JBean(object);
}
}