接口 ApiExecute<P,V>

所有已知实现类:
AbstractApiExecute, AbstractHttpApiExecute

public interface ApiExecute<P,V>
定义http调用抽象接口,应用层可使用,并屏蔽底层http繁琐代码。
作者:
时克英
  • 方法详细资料

    • invoke

      com.walker.web.ResponseValue<V> invoke(P parameter, Class<V> responseType) throws ApiException
      抛出:
      ApiException
    • setUrl

      void setUrl(String url)
      设置访问地址,无论get或post,url地址是确定的,不带问号之后的参数。

      如:http://demo.com:8082/test/java

      参数:
      url -
    • setMethod

      void setMethod(ApiMethod apiMethod)
    • setId

      void setId(String apiInfoId)
      设置接口标识(唯一)
      参数:
      apiInfoId -
    • setTranslate

      void setTranslate(RequestTranslate requestTranslate)
      设置请求转换器对象,对输入参数或输出变换适配。
      参数:
      requestTranslate -
    • setGzip

      void setGzip(boolean responseGzip)
      设置远程服务返回结果是否使用Gzip压缩
      参数:
      responseGzip -
    • getUrl

      String getUrl()
    • getMethod

      ApiMethod getMethod()
    • getGzip

      boolean getGzip()
    • getId

      String getId()
    • getTranslate

      RequestTranslate getTranslate()
    • getApiParamList

      List<ApiParam> getApiParamList()
    • getRequestAsText

      boolean getRequestAsText()
      是否请求是get拼接字符串参数方式:true 是,false 否
      返回:
    • getResponseTypeClazz

      String getResponseTypeClazz()