'合并分支'
This commit is contained in:
parent
15ee570d7b
commit
1edf4abdf9
110
apidoc.html
110
apidoc.html
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.
BIN
libs/redbbs.jar
BIN
libs/redbbs.jar
Binary file not shown.
90
src/net/tccn/bbs/base/JBean.java
Normal file
90
src/net/tccn/bbs/base/JBean.java
Normal 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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user