提交 cac3221c 编写于 作者: 浅梦2013's avatar 浅梦2013

mica-mqtt server 完善 Result

上级 ec2b1bd6
......@@ -35,6 +35,15 @@ public final class Result {
private static final Charset UTF_8 = StandardCharsets.UTF_8;
private static final String UTF_8_NAME = UTF_8.name();
/**
* 响应成功
*
* @return HttpResponse
*/
public static HttpResponse ok() {
return ok(new HttpResponse());
}
/**
* 响应成功
*
......@@ -48,6 +57,16 @@ public final class Result {
return result(response, resultCode, json);
}
/**
* 响应成功
*
* @param data Object
* @return HttpResponse
*/
public static HttpResponse ok(Object data) {
return ok(new HttpResponse(), data);
}
/**
* 响应成功
*
......@@ -63,6 +82,16 @@ public final class Result {
return result(response, resultCode, json);
}
/**
* 响应失败
*
* @param resultCode ResultCode
* @return HttpResponse
*/
public static HttpResponse fail(ResultCode resultCode) {
return fail(new HttpResponse(), resultCode);
}
/**
* 响应失败
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册