程序包 cool.scx.mvc.vo
类 Result
java.lang.Object
cool.scx.mvc.vo.Result
- 所有已实现的接口:
ScxConsumer<io.vertx.ext.web.RoutingContext,,Exception> BaseVo
- 直接已知子类:
Result.ResultOfData,Result.ResultOfMap
Json 格式的返回值 (注意和
Json 区分, 此格式适合传递单个参数)- 版本:
- 1.9.5
- 作者:
- scx567888
-
嵌套类概要
嵌套类修饰符和类型类说明static final recordstatic classstatic class -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaccept(io.vertx.ext.web.RoutingContext context) protected abstract Result.Body<?>body()static Result.ResultOfMapfail()操作失败static Result.ResultOfMap返回操作失败的 Json 带有消息static Result.ResultOfMapok()操作成功static Result.ResultOfDatatoJson()将内部的 JsonBody 转换为 json 字符串atoXml()
-
构造器详细资料
-
Result
public Result()
-
-
方法详细资料
-
ok
操作成功- 返回:
- json
-
ok
-
fail
操作失败- 返回:
- json
-
fail
返回操作失败的 Json 带有消息- 参数:
failMessage- 自定义的错误信息- 返回:
- json
-
accept
public void accept(io.vertx.ext.web.RoutingContext context) sendToClient
- 指定者:
accept在接口中ScxConsumer<io.vertx.ext.web.RoutingContext,Exception>
-
body
-
toJson
将内部的 JsonBody 转换为 json 字符串- 返回:
- r
- 抛出:
com.fasterxml.jackson.core.JsonProcessingException- 转换失败
-
toXml
- 抛出:
com.fasterxml.jackson.core.JsonProcessingException
-
toJson
a- 参数:
defaultValue- a- 返回:
- a
-
toXml
-