程序包 gateway.api

类 RetrofitUtils

java.lang.Object
gateway.api.RetrofitUtils

public abstract class RetrofitUtils extends Object
Retrofit工具类
作者:
neeker
  • 字段详细资料

    • Log

      private static final org.apache.commons.logging.Log Log
    • GetWebSpringContextMethod

      private static Method GetWebSpringContextMethod
    • GetEnvironmentMethod

      private static Method GetEnvironmentMethod
    • GetPropertyMethod

      private static Method GetPropertyMethod
  • 构造器详细资料

    • RetrofitUtils

      public RetrofitUtils()
  • 方法详细资料

    • doGetApiHelperCustomUserAgent

      private static String doGetApiHelperCustomUserAgent()
    • createRetrofit

      public static retrofit2.Retrofit createRetrofit(String apiprefix)
      不使用JWT创建Retrofit
      返回:
      Retrofit
    • createRetrofitBuilder

      public static retrofit2.Retrofit.Builder createRetrofitBuilder(String apiprefix, okhttp3.Interceptor... interceptors)
    • createRetrofitBuilder

      public static retrofit2.Retrofit.Builder createRetrofitBuilder(String apiprefix)
    • createRetrofit

      public static retrofit2.Retrofit createRetrofit(String apiprefix, String jwtAppToken, String jwtPrivateKey, okhttp3.Interceptor... interceptors)
      创建Retrofit对象并返回(JWT令牌默认存活1800秒)
      参数:
      apiprefix - 第三方接口的URL前缀
      jwtAppToken - 应用令牌(token)
      jwtPrivateKey - 应用私钥(RSA)
      apiprefix -
      jwtAppToken -
      jwtPrivateKey -
      返回:
      Retrofit
    • buildRetrofit

      public static retrofit2.Retrofit buildRetrofit(String apiprefix, String jwtAppToken, com.auth0.jwt.algorithms.Algorithm algorithm, okhttp3.Interceptor... interceptors)
    • createRetrofitBuilder

      public static retrofit2.Retrofit.Builder createRetrofitBuilder(String apiprefix, String jwtAppToken, String jwtPrivateKey)
    • buildRetrofitBuilder

      public static retrofit2.Retrofit.Builder buildRetrofitBuilder(String apiprefix, String jwtAppToken, com.auth0.jwt.algorithms.Algorithm algorithm)
    • createRetrofitBuilder

      public static retrofit2.Retrofit.Builder createRetrofitBuilder(String apiprefix, String jwtAppToken, String jwtPrivateKey, okhttp3.Interceptor... interceptors)
    • buildRetrofitBuilder

      public static retrofit2.Retrofit.Builder buildRetrofitBuilder(String apiprefix, String jwtAppToken, com.auth0.jwt.algorithms.Algorithm algorithm, okhttp3.Interceptor... interceptors)
    • createRetrofit

      public static retrofit2.Retrofit createRetrofit(String apiprefix, String jwtAppToken, String jwtPrivateKey, int jwtTokenLiveSeconds)
    • buildRetrofit

      public static retrofit2.Retrofit buildRetrofit(String apiprefix, String jwtAppToken, com.auth0.jwt.algorithms.Algorithm algorithm, int jwtTokenLiveSeconds)
    • createRetrofit

      public static retrofit2.Retrofit createRetrofit(String apiprefix, String jwtAppToken, String jwtPrivateKey, int jwtTokenLiveSeconds, okhttp3.Interceptor... interceptors)
      创建Retrofit对象并返回
      参数:
      apiprefix - 第三方接口的URL前缀
      jwtAppToken - 应用令牌(token)
      jwtPrivateKey - 应用私钥(RSA)
      jwtTokenLiveSeconds - 有效时间(秒)
      返回:
      Retrofit
    • buildRetrofit

      public static retrofit2.Retrofit buildRetrofit(String apiprefix, String jwtAppToken, com.auth0.jwt.algorithms.Algorithm algorithm, int jwtTokenLiveSeconds, okhttp3.Interceptor... interceptors)
    • createRetrofitBuilder

      public static retrofit2.Retrofit.Builder createRetrofitBuilder(String apiprefix, String jwtAppToken, String jwtPrivateKey, int jwtTokenLiveSeconds, okhttp3.Interceptor... interceptors)
    • buildRetrofitBuilder

      public static retrofit2.Retrofit.Builder buildRetrofitBuilder(String apiprefix, String jwtAppToken, com.auth0.jwt.algorithms.Algorithm algorithm, int jwtTokenLiveSeconds, okhttp3.Interceptor... interceptors)
    • createRetrofit

      public static retrofit2.Retrofit createRetrofit(String apiprefix, String jwtAppToken, String jwtPrivateKey, int jwtTokenLiveSeconds, com.google.gson.Gson gson, String json_date_format, long timeout, TimeUnit time_unit, okhttp3.Interceptor... interceptors)
      创建Retrofit对象并返回
      参数:
      apiprefix -
      jwtAppToken -
      jwtPrivateKey -
      jwtTokenLiveSeconds -
      gson -
      json_date_format -
      timeout -
      time_unit -
      返回:
    • buildRetrofit

      public static retrofit2.Retrofit buildRetrofit(String apiprefix, String jwtAppToken, com.auth0.jwt.algorithms.Algorithm algorithm, int jwtTokenLiveSeconds, com.google.gson.Gson gson, String json_date_format, long timeout, TimeUnit time_unit, okhttp3.Interceptor... interceptors)
    • createRetrofitBuilder

      public static retrofit2.Retrofit.Builder createRetrofitBuilder(String apiprefix, String jwtAppToken, String jwtPrivateKey, int jwtTokenLiveSeconds, com.google.gson.Gson gson, String json_date_format, long timeout, TimeUnit time_unit, okhttp3.Interceptor... interceptors)
      创建Retrofit对象并返回
      参数:
      apiprefix -
      jwtAppToken -
      jwtPrivateKey -
      jwtTokenLiveSeconds -
      gson -
      json_date_format -
      timeout -
      time_unit -
      返回:
    • buildRetrofitBuilder

      public static retrofit2.Retrofit.Builder buildRetrofitBuilder(String apiprefix, String jwtAppToken, com.auth0.jwt.algorithms.Algorithm algorithm, int jwtTokenLiveSeconds, com.google.gson.Gson gson, String json_date_format, long timeout, TimeUnit time_unit, okhttp3.Interceptor... interceptors)