T - 数据模型(泛型输入参数对象)public abstract class HttpService<T extends BaseModel> extends java.lang.Object implements BridgeListenner, ApiInterface<T>
| 限定符和类型 | 字段和说明 |
|---|---|
private WebService |
webServer
WebService实例
|
| 构造器和说明 |
|---|
HttpService(WebService webServer)
构造方法
|
| 限定符和类型 | 方法和说明 |
|---|---|
abstract void |
doService(T t,
io.vertx.ext.web.RoutingContext rc)
处理业务逻辑
|
WebService |
getWebServer()
获取WebServer对象
|
private void |
handleFormat(java.lang.String jsonStr,
io.vertx.ext.web.RoutingContext rc)
处理格式转换,把JSON格式的字符串转换成JSON对象(数据模型)。
|
private void |
handleGetRequest(io.vertx.ext.web.RoutingContext rc)
处理GET请求参数
|
static void |
handleHttpResult(ApiReturnObject result,
io.vertx.ext.web.RoutingContext rc)
处理http请求结果,返回相应的数据并关闭http连接。
|
private void |
handleRequestBody(io.vertx.ext.web.RoutingContext rc)
处理PUT,DELETE,POST请求参数。
|
boolean |
hasPriority2InvokeApi(io.vertx.ext.web.RoutingContext rc)
是否拥有接口调用的权限, 默认都拥有接口调用权限
|
private boolean |
isValidClientRequest(io.vertx.ext.web.RoutingContext rc)
是否是合法的客户端请求。
|
void |
onFail(int code,
java.lang.String errorMsg,
io.vertx.ext.web.RoutingContext rc)
错误处理方法
|
void |
onSuccess(ApiReturnObject result,
io.vertx.ext.web.RoutingContext rc)
成功处理方法
|
void |
onSuccess(java.lang.String msg,
ApiReturnObject result,
io.vertx.ext.web.RoutingContext rc)
成功处理方法
|
void |
onSuccess(java.lang.String msg,
io.vertx.ext.web.RoutingContext rc)
成功处理方法
|
private void |
routeRestfulPath()
对Restfull风格的路径做路由。
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetApiPath, getHttpMethod, logInputParameters, returnClassprivate WebService webServer
public HttpService(WebService webServer)
webServer - webServer实例public WebService getWebServer()
public void onFail(int code,
java.lang.String errorMsg,
io.vertx.ext.web.RoutingContext rc)
BridgeListenneronFail 在接口中 BridgeListennercode - 错误代码errorMsg - 错误提示信息rc - 路由上下文public void onSuccess(java.lang.String msg,
io.vertx.ext.web.RoutingContext rc)
BridgeListenneronSuccess 在接口中 BridgeListennermsg - 提示信息rc - 路由上下文public void onSuccess(ApiReturnObject result, io.vertx.ext.web.RoutingContext rc)
BridgeListenneronSuccess 在接口中 BridgeListennerresult - 返回结果rc - 路由上下文public void onSuccess(java.lang.String msg,
ApiReturnObject result,
io.vertx.ext.web.RoutingContext rc)
BridgeListenneronSuccess 在接口中 BridgeListennermsg - 提示信息result - 返回结果rc - 路由上下文public boolean hasPriority2InvokeApi(io.vertx.ext.web.RoutingContext rc)
ApiInterfacehasPriority2InvokeApi 在接口中 ApiInterface<T extends BaseModel>rc - 路由上下文public abstract void doService(T t, io.vertx.ext.web.RoutingContext rc)
t - 泛型(前端传入的参数对象)rc - 路由上下文private void routeRestfulPath()
private boolean isValidClientRequest(io.vertx.ext.web.RoutingContext rc)
rc - 路由上下文private void handleGetRequest(io.vertx.ext.web.RoutingContext rc)
rc - 路由上下文private void handleRequestBody(io.vertx.ext.web.RoutingContext rc)
rc - 路由上下文private void handleFormat(java.lang.String jsonStr,
io.vertx.ext.web.RoutingContext rc)
jsonStr - JSON格式的字符串rc - 路由上下文public static void handleHttpResult(ApiReturnObject result, io.vertx.ext.web.RoutingContext rc)
rc - 路由上下文result - 返回结果