1
This commit is contained in:
@@ -435,6 +435,28 @@ public class TencentDocApiUtil {
|
||||
return callApi(accessToken, appId, openId, apiUrl, "POST", requestBody.toJSONString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新表格(batchUpdate API)
|
||||
* 根据官方文档:https://docs.qq.com/open/document/app/openapi/v3/sheet/batchupdate/update.html
|
||||
*
|
||||
* @param accessToken 访问令牌
|
||||
* @param appId 应用ID
|
||||
* @param openId 开放平台用户ID
|
||||
* @param fileId 文件ID
|
||||
* @param requestBody 请求体,包含 requests 数组
|
||||
* @param apiBaseUrl API基础地址
|
||||
* @return 更新结果
|
||||
*/
|
||||
public static JSONObject batchUpdate(String accessToken, String appId, String openId, String fileId, JSONObject requestBody, String apiBaseUrl) {
|
||||
String apiUrl = String.format("%s/files/%s/batchUpdate", apiBaseUrl, fileId);
|
||||
|
||||
log.info("批量更新表格(batchUpdate)- fileId: {}, requests数量: {}",
|
||||
fileId, requestBody.getJSONArray("requests") != null ? requestBody.getJSONArray("requests").size() : 0);
|
||||
log.debug("批量更新表格 - 请求体: {}", requestBody.toJSONString());
|
||||
|
||||
return callApi(accessToken, appId, openId, apiUrl, "POST", requestBody.toJSONString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析 A1 表示法为行列索引
|
||||
* 例如:
|
||||
|
||||
Reference in New Issue
Block a user