This commit is contained in:
2025-11-06 12:03:48 +08:00
parent 3448cde99d
commit 4527dc0ecd
6 changed files with 618 additions and 37 deletions

View File

@@ -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 表示法为行列索引
* 例如: