1
This commit is contained in:
@@ -292,7 +292,7 @@ public class TencentDocDelayedPushServiceImpl implements ITencentDocDelayedPushS
|
||||
"AUTO",
|
||||
"DELAYED_TIMER",
|
||||
startRow,
|
||||
startRow + 199 // 与 Controller API_MAX_ROWS_PER_REQUEST=200 一致(单批最多200行)
|
||||
startRow + 499 // 与 Controller API_MAX_ROWS_PER_REQUEST=500 一致(单批最多500行)
|
||||
);
|
||||
log.info("✓ 创建批量推送记录,批次ID: {}", batchId);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@@ -344,9 +345,15 @@ public class TencentDocApiUtil {
|
||||
*/
|
||||
public static JSONObject readSheetData(String accessToken, String appId, String openId, String fileId, String sheetId, String range, String apiBaseUrl) {
|
||||
// V3版本API路径格式:/openapi/spreadsheet/v3/files/{fileId}/{sheetId}/{range}
|
||||
// range格式:A1表示法(Excel格式),如 A10:D11
|
||||
String apiUrl = String.format("%s/files/%s/%s/%s", apiBaseUrl, fileId, sheetId, range);
|
||||
log.info("读取表格数据 - fileId: {}, sheetId: {}, range: {}, apiUrl: {}", fileId, sheetId, range, apiUrl);
|
||||
// range 需 URL 编码,否则 path 中的 ":" 会导致网关/服务端报 range invalid (400001)
|
||||
String encodedRange;
|
||||
try {
|
||||
encodedRange = URLEncoder.encode(range, StandardCharsets.UTF_8.name());
|
||||
} catch (java.io.UnsupportedEncodingException e) {
|
||||
encodedRange = range.replace(":", "%3A");
|
||||
}
|
||||
String apiUrl = String.format("%s/files/%s/%s/%s", apiBaseUrl, fileId, sheetId, encodedRange);
|
||||
log.info("读取表格数据 - fileId: {}, sheetId: {}, range: {} (encoded: {}), apiUrl: {}", fileId, sheetId, range, encodedRange, apiUrl);
|
||||
return callApi(accessToken, appId, openId, apiUrl, "GET", null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user