类 AbstractFeishuApiService

java.lang.Object
cn.isliu.core.service.AbstractFeishuApiService
直接已知子类:
CustomCellService, CustomDataValidationService, CustomDimensionService, CustomFileService, CustomProtectedDimensionService, CustomSheetService, CustomValueService

public abstract class AbstractFeishuApiService extends Object
飞书API客户端抽象类 提供基础的HTTP请求处理和认证逻辑
  • 字段详细资料

    • feishuClient

      protected final FeishuClient feishuClient
    • httpClient

      protected final okhttp3.OkHttpClient httpClient
    • gson

      protected final com.google.gson.Gson gson
    • tokenManager

      protected final TenantTokenManager tokenManager
    • BASE_URL

      protected static final String BASE_URL
      另请参阅:
    • JSON_MEDIA_TYPE

      protected static final okhttp3.MediaType JSON_MEDIA_TYPE
  • 构造器详细资料

    • AbstractFeishuApiService

      public AbstractFeishuApiService(FeishuClient feishuClient)
      构造函数
      参数:
      feishuClient - 飞书客户端
  • 方法详细资料

    • getTenantAccessToken

      protected String getTenantAccessToken() throws IOException
      获取租户访问令牌 使用TenantTokenManager进行智能的token管理,包括缓存、过期检测和自动刷新。
      返回:
      访问令牌
      抛出:
      IOException - 请求异常
    • createAuthenticatedRequest

      protected okhttp3.Request.Builder createAuthenticatedRequest(String url, String method, okhttp3.RequestBody body) throws IOException
      构建带认证的请求
      参数:
      url - 请求URL
      method - HTTP方法
      body - 请求体
      返回:
      请求构建器
      抛出:
      IOException - 认证异常
    • executeRequest

      protected <T> T executeRequest(okhttp3.Request request, Class<T> responseClass) throws IOException
      执行请求并处理响应
      类型参数:
      T - 响应类型
      参数:
      request - 请求对象
      responseClass - 响应类型
      返回:
      响应对象
      抛出:
      IOException - 请求异常