|
@ -44,14 +44,6 @@ public abstract class EnvelopRestEndpoint {
|
|
return envelop;
|
|
return envelop;
|
|
}
|
|
}
|
|
|
|
|
|
protected Envelop error(String message, String errorCode){
|
|
|
|
Envelop envelop = new Envelop();
|
|
|
|
envelop.setMessage(message);
|
|
|
|
envelop.setErrorCode(errorCode);
|
|
|
|
envelop.setStatus(-1);
|
|
|
|
return envelop;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected <J> ObjEnvelop<J> success(J obj){
|
|
protected <J> ObjEnvelop<J> success(J obj){
|
|
return success("success", obj);
|
|
return success("success", obj);
|
|
}
|
|
}
|
|
@ -172,6 +164,17 @@ public abstract class EnvelopRestEndpoint {
|
|
return mixEnvelop;
|
|
return mixEnvelop;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
protected Envelop failed (String message) {
|
|
|
|
return failed(message, -10000);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected Envelop failed (String message, int status) {
|
|
|
|
Envelop envelop = new Envelop();
|
|
|
|
envelop.setMessage(message);
|
|
|
|
envelop.setStatus(status);
|
|
|
|
return envelop;
|
|
|
|
}
|
|
|
|
|
|
protected <E extends Envelop> E failed(String message, Class<E> clazz) {
|
|
protected <E extends Envelop> E failed(String message, Class<E> clazz) {
|
|
return failed(message, -10000, clazz);
|
|
return failed(message, -10000, clazz);
|
|
}
|
|
}
|