From 3588e5bb93d4bfd6878d7fbb3fc485276c795e6e Mon Sep 17 00:00:00 2001 From: xiaoban Date: Thu, 4 Jun 2026 19:09:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(export-user-data):=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=BB=B4=E5=BA=A6=E5=AF=BC=E5=87=BA=E5=BF=AB?= =?UTF-8?q?=E9=80=9F=E6=9F=A5c=5Ftype=E6=96=B9=E6=B3=95=E5=92=8C=E7=9C=8B?= =?UTF-8?q?=E5=9B=BE=E8=AF=B4=E8=AF=9D=E5=AE=9E=E9=99=85=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skills/export-user-data/SKILL.md | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/skills/export-user-data/SKILL.md b/skills/export-user-data/SKILL.md index fc811b2..95b0e28 100644 --- a/skills/export-user-data/SKILL.md +++ b/skills/export-user-data/SKILL.md @@ -161,6 +161,42 @@ cd /root/.openclaw/workspace-xiaoban --- +## 快速查组件类型 + +如果只知道 `c_id` 不知道 `c_type`,先查 MySQL: + +```bash +cd /root/.openclaw/workspace-xiaoban +source scripts/export_component_records.sh --help # 仅加载环境变量 +python3 -c " +import pymysql, os +conn = pymysql.connect( + host=os.getenv('MYSQL_HOST'), user=os.getenv('MYSQL_USERNAME'), + password=os.getenv('MYSQL_PASSWORD'), database='vala_test', + port=int(os.getenv('MYSQL_PORT',3306)), charset='utf8mb4') +for t in ['middle_interaction_component','core_interaction_component']: + cur = conn.cursor() + cur.execute(f'SELECT c_id,c_type,title FROM {t} WHERE c_id=%s', ('',)) + for r in cur.fetchall(): + print(f'{t}: c_id={r[0]} c_type={r[1]} title={r[2]}') + cur.close() +conn.close() +" +``` + +## 实际用例 + +### 导出"看图说话"组件 1000516 的所有学习记录 + +```bash +cd /root/.openclaw/workspace-xiaoban +./scripts/export_component_records.sh --c-type core_speaking_image --c-id 1000516 +``` + +输出:`output/组件_口语图片_1000516_导出时间_YYYYMMDD.xlsx` + +包含字段:user_id、session_id、play_result(判定结果)、音频URL、朗读内容(ASR文本识别)、发音评分、user_behavior_info(完整行为数据)等,按 updated_at 倒序排列。 + ## 完成后 如果是从飞书对话触发的导出,导出完成后通过 `lark-send-message-as-bot` 技能将文件发送给请求用户。