类 FsApiUtil
java.lang.Object
cn.isliu.core.utils.FsApiUtil
飞书API工具类
封装了与飞书表格API交互的各种操作方法,包括数据读取、元数据获取、单元格合并等操作
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static ObjectaddRowColumns(String sheetId, String spreadsheetToken, String type, int length, FeishuClient client) static ObjectbatchPutValues(String sheetId, String spreadsheetToken, CustomValueService.ValueRequest batchPutRequest, FeishuClient client) static StringcopySheet(String sourceSheetId, String title, FeishuClient client, String spreadsheetToken) static com.lark.oapi.service.drive.v1.model.CreateFolderFileRespBodycreateFolder(String folderName, String folderToken, FeishuClient client) static StringcreateSheet(String title, FeishuClient client, String spreadsheetToken) static com.lark.oapi.service.sheets.v3.model.CreateSpreadsheetRespBodycreateTable(String tableName, String folderToken, FeishuClient client) static voiddownloadMaterial(String fileToken, String outputPath, FeishuClient client, String extra) 下载素材static StringdownloadTmpMaterialUrl(String fileToken, FeishuClient client) static StringgetRootFolderToken(FeishuClient client) 获取根目录Tokenstatic ValuesBatchgetSheetData(String sheetId, String spreadsheetToken, String startPosition, String endPosition, FeishuClient client) 获取工作表数据static SheetgetSheetMetadata(String sheetId, FeishuClient client, String spreadsheetToken) 获取工作表元数据static ObjectgetTableInfo(String sheetId, String spreadsheetToken, FeishuClient client) static ObjectimageUpload(byte[] imageData, String fileName, String position, String sheetId, String spreadsheetToken, FeishuClient client) static voidmergeCells(CustomCellService.CellRequest cellRequest, FeishuClient client, String spreadsheetToken) static ObjectputValues(String spreadsheetToken, CustomValueService.ValueRequest putValuesBuilder, FeishuClient client) static voidremoveSheet(String sheetId, FeishuClient client, String spreadsheetToken) static voidsetCellType(String sheetId, String formatter, String startPosition, String endPosition, FeishuClient client, String spreadsheetToken) 字符串类型: formatter: "@"static voidsetDateType(String sheetId, FeishuClient client, String spreadsheetToken, String conf, Integer headLine) static voidsetOptions(String sheetId, FeishuClient client, String spreadsheetToken, boolean isMulti, String startPosition, String endPosition, List<String> result) static voidsetTableStyle(CustomCellService.StyleCellsBatchBuilder styleCellsBatchBuilder, FeishuClient client, String spreadsheetToken)
-
字段详细资料
-
DEFAULT_ROW_NUM
public static final int DEFAULT_ROW_NUM- 另请参阅:
-
-
构造器详细资料
-
FsApiUtil
public FsApiUtil()
-
-
方法详细资料
-
getSheetData
public static ValuesBatch getSheetData(String sheetId, String spreadsheetToken, String startPosition, String endPosition, FeishuClient client) 获取工作表数据从指定的飞书表格中读取指定范围的数据
- 参数:
sheetId- 工作表IDspreadsheetToken- 电子表格TokenstartPosition- 起始位置(如"A1")endPosition- 结束位置(如"Z100")client- 飞书客户端- 返回:
- 表格数据对象
-
getSheetMetadata
获取工作表元数据获取指定工作表的元数据信息,包括行列数、工作表名称等
- 参数:
sheetId- 工作表IDclient- 飞书客户端spreadsheetToken- 电子表格Token- 返回:
- 工作表对象
-
setTableStyle
public static void setTableStyle(CustomCellService.StyleCellsBatchBuilder styleCellsBatchBuilder, FeishuClient client, String spreadsheetToken) -
mergeCells
public static void mergeCells(CustomCellService.CellRequest cellRequest, FeishuClient client, String spreadsheetToken) -
getRootFolderToken
获取根目录Token调用飞书开放平台API获取当前租户的根目录token,用于后续的文件夹和文件操作 API接口: GET https://open.feishu.cn/open-apis/drive/v1/files/root_folder/meta
- 参数:
client- 飞书客户端- 返回:
- 根目录token,获取失败时抛出异常
-
createFolder
public static com.lark.oapi.service.drive.v1.model.CreateFolderFileRespBody createFolder(String folderName, String folderToken, FeishuClient client) -
createTable
public static com.lark.oapi.service.sheets.v3.model.CreateSpreadsheetRespBody createTable(String tableName, String folderToken, FeishuClient client) -
createSheet
-
copySheet
public static String copySheet(String sourceSheetId, String title, FeishuClient client, String spreadsheetToken) -
setDateType
public static void setDateType(String sheetId, FeishuClient client, String spreadsheetToken, String conf, Integer headLine) -
setOptions
-
removeSheet
-
downloadMaterial
public static void downloadMaterial(String fileToken, String outputPath, FeishuClient client, String extra) 下载素材 -
downloadTmpMaterialUrl
-
putValues
public static Object putValues(String spreadsheetToken, CustomValueService.ValueRequest putValuesBuilder, FeishuClient client) -
batchPutValues
public static Object batchPutValues(String sheetId, String spreadsheetToken, CustomValueService.ValueRequest batchPutRequest, FeishuClient client) -
addRowColumns
public static Object addRowColumns(String sheetId, String spreadsheetToken, String type, int length, FeishuClient client) -
getTableInfo
-
setCellType
public static void setCellType(String sheetId, String formatter, String startPosition, String endPosition, FeishuClient client, String spreadsheetToken) 字符串类型: formatter: "@" -
imageUpload
-