程序包 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

public abstract class Result extends Object implements BaseVo
Json 格式的返回值 (注意和 Json 区分, 此格式适合传递单个参数)
版本:
1.9.5
作者:
scx567888
  • 构造器详细资料

    • Result

      public Result()
  • 方法详细资料

    • ok

      public static Result.ResultOfMap ok()
      操作成功
      返回:
      json
    • ok

      public static Result.ResultOfData ok(Object object)
    • fail

      public static Result.ResultOfMap fail()
      操作失败
      返回:
      json
    • fail

      public static Result.ResultOfMap fail(String failMessage)
      返回操作失败的 Json 带有消息
      参数:
      failMessage - 自定义的错误信息
      返回:
      json
    • accept

      public void accept(io.vertx.ext.web.RoutingContext context)

      sendToClient

      指定者:
      accept 在接口中 ScxConsumer<io.vertx.ext.web.RoutingContext,Exception>
    • body

      protected abstract Result.Body<?> body()
    • toJson

      public String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
      将内部的 JsonBody 转换为 json 字符串
      返回:
      r
      抛出:
      com.fasterxml.jackson.core.JsonProcessingException - 转换失败
    • toXml

      public String toXml() throws com.fasterxml.jackson.core.JsonProcessingException
      抛出:
      com.fasterxml.jackson.core.JsonProcessingException
    • toJson

      public String toJson(String defaultValue)
      a
      参数:
      defaultValue - a
      返回:
      a
    • toXml

      public String toXml(String defaultValue)