feat: manually mirror opencoze's code from bytedance

Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
fanlv
2025-07-20 17:36:12 +08:00
commit 890153324f
14811 changed files with 1923430 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
struct DocTableSheet {
1: i64 id; // sheet 的编号
2: string sheet_name; // sheet 名
3: i64 total_row; // 总行数
}
enum ColumnType {
Unknown = 0
Text = 1 // 文本
Number = 2 // 数字
Date = 3 // 时间
Float = 4 // float
Boolean = 5 // bool
Image = 6 // 图片
}
// 表格的列信息
struct DocTableColumn {
1: i64 id(agw.js_conv="str", api.js_conv="true", api.body="id"); // 列 id
2: string column_name; // 列名
3: bool is_semantic; // 是否为语义匹配列
4: i64 sequence(agw.js_conv="str", api.js_conv="true", api.body="sequence"); // 列原本在 excel 的序号
5: optional ColumnType column_type; // 列类型
6: optional bool contains_empty_value
7: optional string desc; // 描述
}

View File

@@ -0,0 +1,33 @@
include "../../../base.thrift"
include "common.thrift"
namespace go knowledge.document
// 获取表格结构、预览数据
struct GetDocumentTableInfoRequest {
2: optional string tos_uri; // 如果为第一次本地文件上传的表格,传递该值
3: optional i64 document_id(agw.js_conv="str", api.js_conv="true", api.body="document_id"); // 如果为已有 document 的表格,传递该值
4: i64 creator_id; // 创建人[http接口不需要传递]
255: optional base.Base Base
}
struct GetDocumentTableInfoResponse {
1: i32 code
2: string msg
3: list<common.DocTableSheet> sheet_list
4: map<string, list<common.DocTableColumn>> table_meta(api.body="table_meta") // key: sheet_id -> list<common.DocTableColumn>
5: map<string, list<map<string,string>>> preview_data(api.body="preview_data") // key: sheet_id -> list_preview_data
255: required base.BaseResp BaseResp(api.none="true")
}
struct GetTableSchemaInfoResponse {
1: i32 code
2: string msg
3: list<common.DocTableSheet> sheet_list
4: list<common.DocTableColumn> table_meta // 选中的 sheet 的 schema, 不选择默认返回第一个 sheet
5: list<map<i64,string>> preview_data(agw.js_conv="str", agw.key="preview_data") // knowledge table 场景中会返回
255: optional base.BaseResp BaseResp(api.none="true")
}