1 line
9.1 KiB
XML
1 line
9.1 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" width="920" height="772" viewBox="0 0 920 772"><rect x="0" y="0" width="920" height="772" fill="#ffffff"/><defs><marker id="ah" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#8c959f"/></marker></defs><rect x="24" y="24" width="872" height="184" rx="8" ry="8" fill="#f6f8fa" stroke="#d0d7de" stroke-width="1.2"/><rect x="24" y="24" width="5" height="184" rx="2.5" fill="#0969da"/><text x="48" y="54" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="15" fill="#1f2328" font-weight="600">pytest 用例层<tspan dx="10" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" fill="#0550ae">(case/)</tspan></text><text x="56" y="92" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="13" fill="#0550ae" font-weight="400" text-anchor="start">test_order_freeze.py</text><text x="300" y="92" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">下单冻结保证金(三重校验,正例/负例数据驱动)</text><text x="56" y="117" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="13" fill="#0550ae" font-weight="400" text-anchor="start">test_cancel_order.py</text><text x="300" y="117" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">撤单解冻(状态机/参数/无副作用)</text><text x="56" y="142" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="13" fill="#0550ae" font-weight="400" text-anchor="start">test_position_open.py</text><text x="300" y="142" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">市价开仓成交(仓位/资金/流水/缓存四面对账)</text><text x="56" y="167" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="13" fill="#0550ae" font-weight="400" text-anchor="start">test_liquidation.py</text><text x="300" y="167" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">强平触发校验(行情驱动到强平价,风险基金流水)</text><text x="56" y="192" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="13" fill="#0550ae" font-weight="400" text-anchor="start">test_formula.py</text><text x="300" y="192" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">合约公式层纯函数单测(期望值手算写死防自证)</text><line x1="228" y1="208" x2="228" y2="258" stroke="#8c959f" stroke-width="1.4" marker-end="url(#ah)"/><text x="240" y="237" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="12.5" fill="#57606a" font-weight="400" text-anchor="start">YAML 数据驱动</text><line x1="692" y1="208" x2="692" y2="258" stroke="#8c959f" stroke-width="1.4" marker-end="url(#ah)"/><text x="704" y="237" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="12.5" fill="#57606a" font-weight="400" text-anchor="start">期望值</text><rect x="24" y="258" width="420" height="96" rx="8" ry="8" fill="#f6f8fa" stroke="#d0d7de" stroke-width="1.2"/><text x="46" y="288" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14" fill="#0550ae" font-weight="600" text-anchor="start">data/*.yml</text><text x="46" y="314" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">addOrder.yml / liquidation.yml</text><text x="46" y="338" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">cancelOrder.yml / formula.yml</text><rect x="476" y="258" width="420" height="96" rx="8" ry="8" fill="#f6f8fa" stroke="#d0d7de" stroke-width="1.2"/><text x="498" y="288" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14" fill="#0550ae" font-weight="600" text-anchor="start">formula/contract_formula</text><text x="498" y="314" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">冻结保证金 / 强平价 / 破产价</text><text x="498" y="338" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">未实现盈亏 / 爆仓判断</text><line x1="234" y1="354" x2="234" y2="412" stroke="#8c959f" stroke-width="1.4" marker-end="url(#ah)"/><text x="246" y="387" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="12.5" fill="#57606a" font-weight="400" text-anchor="start">HTTP 调用(用例不直接拼 URL)</text><line x1="686" y1="354" x2="686" y2="412" stroke="#8c959f" stroke-width="1.4" marker-end="url(#ah)"/><text x="698" y="387" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="12.5" fill="#57606a" font-weight="400" text-anchor="start">期望值 vs 实际值</text><rect x="24" y="412" width="872" height="78" rx="8" ry="8" fill="#f6f8fa" stroke="#d0d7de" stroke-width="1.2"/><text x="48" y="442" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="15" fill="#1f2328" font-weight="600">接口封装层<tspan dx="10" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" fill="#0550ae">(api/order_api.py)</tspan></text><text x="48" y="470" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">下单 / 撤单 / 划转 / 标记价 / 风控接口的二次封装</text><line x1="460" y1="490" x2="460" y2="546" stroke="#8c959f" stroke-width="1.4" marker-end="url(#ah)"/><text x="472" y="522" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="12.5" fill="#57606a" font-weight="400" text-anchor="start">requests(HTTP)</text><rect x="24" y="546" width="872" height="202" rx="8" ry="8" fill="#f6f8fa" stroke="#d0d7de" stroke-width="1.2"/><text x="48" y="576" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="15" fill="#1f2328" font-weight="600">被测系统<tspan dx="10" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" fill="#0550ae">(mock/)</tspan></text><text x="48" y="604" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="13" fill="#0550ae" font-weight="400" text-anchor="start">server.py</text><text x="140" y="604" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">wsgiref HTTP 服务(随机端口,conftest 会话级启动)</text><text x="48" y="628" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="13" fill="#0550ae" font-weight="400" text-anchor="start">engine.py</text><text x="140" y="628" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">撮合引擎:下单冻结 / 市价成交 / 撤单解冻 / 标记价 / 强平风控</text><text x="140" y="652" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#57606a" font-weight="400" text-anchor="start">(内部资金计算独立实现,刻意不复用 formula 包)</text><rect x="48" y="668" width="824" height="68" rx="6" ry="6" fill="#eef4fb" stroke="#b6c2cf" stroke-width="1" stroke-dasharray="4 3"/><text x="66" y="692" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="13" fill="#1f2328" font-weight="600" text-anchor="start">校验面(数据面)</text><text x="66" y="716" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="12.5" fill="#57606a" font-weight="400" text-anchor="start">fake_db.py 内存 MySQL:futures_account / order / account_flow</text><text x="66" y="736" font-family="-apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif" font-size="12.5" fill="#57606a" font-weight="400" text-anchor="start">fake_cache.py 内存 Redis:冻结键值 / 资金镜像 / 仓位缓存</text></svg> |