类 AbstractFeishuApiService
java.lang.Object
cn.isliu.core.service.AbstractFeishuApiService
- 直接已知子类:
CustomCellService,CustomDataValidationService,CustomDimensionService,CustomFileService,CustomProtectedDimensionService,CustomSheetService,CustomValueService
飞书API客户端抽象类 提供基础的HTTP请求处理和认证逻辑
-
字段概要
字段修饰符和类型字段说明protected static final Stringprotected final FeishuClientprotected final com.google.gson.Gsonprotected final okhttp3.OkHttpClientprotected static final okhttp3.MediaTypeprotected final TenantTokenManager -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected okhttp3.Request.BuildercreateAuthenticatedRequest(String url, String method, okhttp3.RequestBody body) 构建带认证的请求protected <T> TexecuteRequest(okhttp3.Request request, Class<T> responseClass) 执行请求并处理响应protected String获取租户访问令牌 使用TenantTokenManager进行智能的token管理,包括缓存、过期检测和自动刷新。
-
字段详细资料
-
feishuClient
-
httpClient
protected final okhttp3.OkHttpClient httpClient -
gson
protected final com.google.gson.Gson gson -
tokenManager
-
BASE_URL
- 另请参阅:
-
JSON_MEDIA_TYPE
protected static final okhttp3.MediaType JSON_MEDIA_TYPE
-
-
构造器详细资料
-
AbstractFeishuApiService
构造函数- 参数:
feishuClient- 飞书客户端
-
-
方法详细资料
-
getTenantAccessToken
获取租户访问令牌 使用TenantTokenManager进行智能的token管理,包括缓存、过期检测和自动刷新。- 返回:
- 访问令牌
- 抛出:
IOException- 请求异常
-
createAuthenticatedRequest
protected okhttp3.Request.Builder createAuthenticatedRequest(String url, String method, okhttp3.RequestBody body) throws IOException 构建带认证的请求- 参数:
url- 请求URLmethod- HTTP方法body- 请求体- 返回:
- 请求构建器
- 抛出:
IOException- 认证异常
-
executeRequest
执行请求并处理响应- 类型参数:
T- 响应类型- 参数:
request- 请求对象responseClass- 响应类型- 返回:
- 响应对象
- 抛出:
IOException- 请求异常
-