# -*- coding: utf-8 -*- """票 05 侦查 v2:修正合并(doc-truth 后写覆盖)后打印 (b)/关键端点 response 全文。""" from __future__ import annotations import io import json import sys from pathlib import Path sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') SP = Path('.scratch/customer-integration-ready') merged: dict[str, dict] = {} for name in ['specimens-core-r3.json', 'specimens-heavy-r3.json', 'specimens-incr-r3.json', 'specimens-graph-r3.json', 'specimens-doc-truth.json']: for k, v in json.loads((SP / name).read_text(encoding='utf-8')).items(): e = merged.setdefault(k, {'src': []}) e['src'].append(name.replace('specimens-', '').replace('-r3.json', '').replace('.json', '')) e['v'] = v # 后写覆盖 → doc-truth 优先 FULL = [ 'POST /api/customer/transfer/assign', 'GET /api/customer/contact/graph/detail', 'POST /api/customer/contact/quickAdd', 'POST /api/customer/contact/batchEdit', 'POST /api/customer/quick-create', 'POST /api/customer/assign-batch', 'POST /api/customer/release-pool-batch', 'POST /api/customer/claim-batch', 'GET /api/customer/import/failures', 'GET /api/customer/transfer/assignable', ] for k in FULL: if k not in merged: print(f'=== {k} : ❌ 无') continue e = merged[k] body = json.dumps(e['v'].get('response'), ensure_ascii=False) print(f'=== {k} : src={e["src"]} len={len(body)}') if len(body) > 900: print(' ', body[:600].replace('\n', ' ')) print(' ...(截)') else: print(' ', body.replace('\n', ' '))