Files
MemRelay/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/平台工参导出接口.md
T
memrelay d0dc3c6f45 update: 平台工参导出接口
MemRelay-Operation: memory-save:nqi-agent-poll-20261111-1
MemRelay-Resource: 84d426a9-a184-4d1c-b84c-6dba63f37777
2026-11-11 00:25:58 +08:00

52 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 平台工参导出接口
type: fact
permalink: main/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/平台工参导出接口
stable_id: 84d426a9-a184-4d1c-b84c-6dba63f37777
scope: project
memory_type: fact
project_id: d5a7f581-c442-4554-87b9-ee723b8b0258
usage_profile_id: 0c9feb46-d06e-43cd-9ef0-c5813c84a998
status: active
revision: 6
request_id: nqi-agent-poll-20261111-1
created_at: '2026-11-10T13:40:51.351339+00:00'
updated_at: '2026-11-10T16:25:56.753773+00:00'
tags:
- NQI
- OpenCode
- 轮询
- 凭据过期
---
## 来源
nqi-opencode.chlz 是 OpenCode 页面抓包,没有 pro-assistant-server 的实际请求。导出说明在会话 ses_e3a7adae3ffe4QxrqaKUPgGATq,对应脚本 download-file-all-async.py。
## 下载请求
- POST https://nqi.gmcc.net:20443/pro-assistant-server/smart/file/download
- 只有请求头 Content-Type: application/json,不发 Cookie。
- 查询参数 tickets 来自 OpenCode 运行环境的 OPENCODE_TOOL_TICKET。
- 请求体是 {"sql": "..."},响应是流式 CSV。另有查询接口 pro-assistant-server/smart/execSql,同样读这个环境变量。
- 2026-11-10 用账号池里 dwmoyingda 的 CASTGC 从线上服务器和本机请求,该路径均被 nginx 返回 403;同一会话访问即席查询正常。
## 发送指令
nqi-agent.chlz 里发给 AI 的请求是 POST /pro-opencode/dwmoyingda/session/<会话>/prompt_async,返回 204。2026-11-11 00:04:55 的正文是导出江门 4G/5G 工参,00:14:00 的正文是清理下载数据。正文只有 messageID、agent、model、parts[].text,没有票据。
## 轮询
nqi-agent.chlz 从 00:04:09 到 00:15:59,GET /pro-opencode/dwmoyingda/global/health 73 次,间隔中位数 10 秒,72 个间隔里 71 个在 8 到 12 秒。每次都带与 CASTGC 相同的 tickets,以及 oc_castgc、opencode_route、oc_locale、metabase.DEVICE。
同一时段 GET /file 104 次,密集时间隔中位数 2 秒,中间有 46 秒、193 秒、168 秒三次停顿。凭据与健康检查相同。
## 凭据
- OPENCODE_TOOL_TICKET 就是当前登录的 CASTGC,类型是 TGT。GET /pro-opencode/api/provision 的 token、跳转地址上的 tickets、prompt_async 的 tickets 与 Cookie CASTGC 完全相同。
- nqi-agent.chlz 里 236 次 tickets 都是同一个值,不是每次调用新签一张票据。
- prompt_async 同时发送 oc_castgc,另一张 TGT,长度 110,查询参数不用它;opencode_route 是 65 字符路由值;oc_locale 是 zh;metabase.DEVICE 是 36 字符设备标识。x-opencode-directory 是目录路径。没有 Authorization 头。
- 登录抓包里 CASTGC、TGC 的 Set-Cookie 只有 Path,没有 Expires 和 Max-Age。nqi-agent.chlz 只有一条 Set-Cookie:即席查询的 JSESSIONID,HttpOnly,没有 Max-Age 或 Expires。
- OpenCode 的 ses_标识是会话记录,不是登录凭据。
## 过期
导出和发送指令使用的票据都是门户登录的 CASTGC。账号登出或这张 TGT 在服务器上失效后,tickets 一起失效。没有另一套更长的 OpenCode 专用期限。
## 表
- 4G:appdbv3.a_common_cfg_lte_cellant_d,通用 LTE 工程参数_天。longitude、latitude 是 numeric(22,6)。
- 5G:appdbv3.a_common_cfg_nr_cellant_d,通用 5G 工程参数_天。
- 当前记录用 curr_flag = true,地市用 city = '江门'。这两张是平台上未脱敏的经纬度来源;即席查询结果表里的经纬度仍是脱敏值。