2026-10-16 08:58:10 +08:00
|
|
|
|
/* ==========================================================================
|
|
|
|
|
|
术语表(全站统一的示例命名)
|
|
|
|
|
|
tools/check-glossary.js 会按这里的规则扫描所有模块章节页,
|
|
|
|
|
|
防止「一个概念多个名字」的漂移再次出现。
|
|
|
|
|
|
|
|
|
|
|
|
规则:
|
|
|
|
|
|
canonical —— 正确写法(人工维护,供参考)
|
|
|
|
|
|
forbidden —— 正则 + 说明;命中即报错
|
|
|
|
|
|
新增规则时注意:正则区分大小写、用 \b 卡住词边界,
|
|
|
|
|
|
避免把英文散文里的普通词(例如 "orders" 作为普通名词)误伤 —— 命中后按提示改成规范名即可。
|
|
|
|
|
|
========================================================================== */
|
|
|
|
|
|
{
|
|
|
|
|
|
"canonical": {
|
|
|
|
|
|
"服务": {
|
|
|
|
|
|
"gateway": "网关,8000",
|
|
|
|
|
|
"order-api": "订单服务,8080",
|
|
|
|
|
|
"pay-api": "支付服务,8081",
|
|
|
|
|
|
"stock-api": "库存服务,8082",
|
|
|
|
|
|
"coupon-api": "优惠券服务,8083"
|
|
|
|
|
|
},
|
|
|
|
|
|
"表": {
|
|
|
|
|
|
"t_order": "订单主表:order_id, order_no, user_id, total_amount, discount_amount, freight_amount, pay_amount, status, coupon_id, create_time, pay_time, finish_time, update_time, remark",
|
|
|
|
|
|
"t_order_item": "订单明细:item_id, order_id, sku_id, sku_name, price, quantity, item_amount",
|
|
|
|
|
|
"t_pay_flow": "支付流水:flow_id, pay_no, order_id, order_no, channel, pay_amount, pay_status, pay_time",
|
|
|
|
|
|
"t_coupon": "优惠券:coupon_id, coupon_code, user_id, face_value, min_amount, discount_amount, status, order_id, use_time, expire_time",
|
|
|
|
|
|
"t_stock": "库存辅助表:sku_id, sku_code, total_qty, locked_qty, sold_qty(available_qty = total_qty - locked_qty - sold_qty,是算出来的,不落库)"
|
|
|
|
|
|
},
|
|
|
|
|
|
"状态取值": {
|
|
|
|
|
|
"t_order.status": "10 待支付 / 20 已支付 / 30 已发货 / 40 已完成 / 50 已取消 / 60 已退款",
|
|
|
|
|
|
"t_pay_flow.pay_status": "10 处理中 / 20 成功 / 30 失败",
|
|
|
|
|
|
"t_coupon.status": "10 未使用 / 20 已使用 / 30 已过期"
|
|
|
|
|
|
},
|
|
|
|
|
|
"Go": {
|
|
|
|
|
|
"示例服务 module": "mall(多包服务示例,如 mall/internal/order)",
|
2026-10-16 18:33:11 +08:00
|
|
|
|
"CLI 交付物 module": "qa/tdcheck",
|
2026-10-16 21:34:26 +08:00
|
|
|
|
"阶段 2 自动化仓库": "qa/tdauto(接口自动化框架)、qa/tdui(UI 自动化)、qa/tdmobile(移动端与小程序自动化)、qa/tdrun(阶段 2 收口的统一入口,Go 单二进制)",
|
|
|
|
|
|
"阶段 3 平台仓库": "qa/tdplat(测试平台后端,Go module 同名)、qa/tdplat-web(平台前端)"
|
|
|
|
|
|
},
|
|
|
|
|
|
"阶段 3 平台(qa/tdplat)": {
|
|
|
|
|
|
"表": {
|
|
|
|
|
|
"tp_user": "平台用户:id, username, password_hash, role, status, create_time",
|
|
|
|
|
|
"tp_env": "环境:env_id, env_name, base_url, config_json, create_time",
|
|
|
|
|
|
"tp_case": "用例:case_id, case_no, name, owner, env_id, priority, tags, status, create_time, update_time",
|
|
|
|
|
|
"tp_case_step": "用例步骤:step_id, case_id, seq, action, target, params_json, expect_json(步骤一定要拆行,不许塞进 tp_case 的大 JSON 列)",
|
|
|
|
|
|
"tp_suite": "套件:suite_id, name, owner, env_id, cron, case_count, create_time, update_time",
|
|
|
|
|
|
"tp_suite_case": "套件与用例关联:suite_id, case_id, seq, add_time",
|
|
|
|
|
|
"tp_task": "任务:task_id, task_no, suite_id, trigger_type, env_id, status, creator, create_time, start_time, finish_time",
|
|
|
|
|
|
"tp_run": "执行记录:run_id, task_id, agent_id, status, total, passed, failed, skipped, start_time, finish_time, report_path",
|
|
|
|
|
|
"tp_run_item": "结果明细:item_id, run_id, case_id, status, duration_ms, message, log_path, screenshot_path",
|
|
|
|
|
|
"tp_agent": "执行节点:agent_id, host, labels, status, last_heartbeat",
|
|
|
|
|
|
"tp_audit_log": "审计日志:id, user_id, action, target_type, target_id, detail, ip, create_time"
|
|
|
|
|
|
},
|
|
|
|
|
|
"时间字段": "平台表统一用 *_time:create_time / update_time / start_time / finish_time / add_time / archive_time",
|
|
|
|
|
|
"状态取值": {
|
|
|
|
|
|
"tp_task.status": "10 待执行 / 20 执行中 / 30 成功 / 40 失败 / 50 已取消",
|
|
|
|
|
|
"tp_run.status": "10 运行中 / 20 成功 / 30 失败 / 40 部分成功 / 50 已取消",
|
|
|
|
|
|
"tp_run_item.status": "10 通过 / 20 失败 / 30 跳过 / 40 阻塞"
|
|
|
|
|
|
},
|
|
|
|
|
|
"角色": "admin(管理员)/ maintainer(用例维护者)/ runner(执行者)/ viewer(只读);平台账号 admin、qa_zhang、qa_li",
|
|
|
|
|
|
"接口与错误码": "前缀 /api/v1;统一响应 {code,msg,data,trace_id};400xx 参数(40001)、401xx 鉴权(40101 未登录、40102 token 过期)、403xx 权限(40301)、500xx 服务端(50001)",
|
|
|
|
|
|
"端口与镜像": "tdplat-api 容器内 8080 / 宿主 9100;镜像 mall-qa/tdplat-api、mall-qa/tdplat-agent、mall-qa/tdplat-web",
|
|
|
|
|
|
"里程碑": "M1 骨架与登录 → M2 用例与套件管理 → M3 任务与执行引擎 → M4 报告中心与结果下钻"
|
2026-10-16 08:58:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
"forbidden": [
|
|
|
|
|
|
{ "re": "\\border-svc\\b", "hint": "服务名统一为 order-api" },
|
|
|
|
|
|
{ "re": "\\border-service\\b", "hint": "服务名统一为 order-api" },
|
|
|
|
|
|
{ "re": "\\borders-api\\b", "hint": "服务名统一为 order-api" },
|
|
|
|
|
|
{ "re": "\\bpay-svc\\b", "hint": "服务名统一为 pay-api" },
|
|
|
|
|
|
{ "re": "\\bstock-svc\\b", "hint": "服务名统一为 stock-api" },
|
|
|
|
|
|
{ "re": "\\bcoupon-svc\\b", "hint": "服务名统一为 coupon-api" },
|
|
|
|
|
|
{ "re": "\\binventory-svc\\b", "hint": "服务名统一为 stock-api" },
|
|
|
|
|
|
{ "re": "(?<![/\\w-])order-pay(?![-\\w])", "hint": "服务名拆成 order-api / pay-api(分支名里的 order-pay 是功能名,可加 // glossary-ok 豁免)" },
|
|
|
|
|
|
|
|
|
|
|
|
{ "re": "\\b(FROM|JOIN|INTO|UPDATE|TABLE|ON)\\s+orders\\b", "hint": "表名统一为 t_order" },
|
|
|
|
|
|
{ "re": "\\borders\\.(?!csv|json|txt|html|go|log|sql|yaml|yml|md|xlsx|sh)(\\w)", "hint": "表名统一为 t_order(字段引用写 t_order.xxx)" },
|
|
|
|
|
|
{ "re": "\\b(FROM|JOIN|INTO|UPDATE|TABLE|ON)\\s+payments\\b", "hint": "表名统一为 t_pay_flow" },
|
|
|
|
|
|
{ "re": "\\bpayments\\.(?!csv|json|txt|html|go|log|sql|yaml|yml|md|xlsx|sh)(\\w)", "hint": "表名统一为 t_pay_flow" },
|
|
|
|
|
|
{ "re": "\\b(FROM|JOIN|INTO|UPDATE|TABLE|ON)\\s+inventory\\b", "hint": "库存表统一为 t_stock(sku_id, sku_code, total_qty, locked_qty, sold_qty)" },
|
|
|
|
|
|
{ "re": "\\binventory\\s*表", "hint": "库存表统一为 t_stock" },
|
|
|
|
|
|
{ "re": "\\b(orders|payments|order_info|payment_record|coupon_usage)\\s*表", "hint": "表名统一为 t_order / t_pay_flow / t_coupon" },
|
|
|
|
|
|
{ "re": "\\border_info\\b", "hint": "表名统一为 t_order" },
|
|
|
|
|
|
{ "re": "\\bpayment_record\\b", "hint": "表名统一为 t_pay_flow" },
|
|
|
|
|
|
{ "re": "\\bcoupon_usage\\b", "hint": "券的核销状态在 t_coupon.status 与 use_time 上" },
|
|
|
|
|
|
{ "re": "\\bt_payment\\b", "hint": "表名统一为 t_pay_flow" },
|
|
|
|
|
|
{ "re": "\\bt_pay\\b(?!_flow)", "hint": "表名统一为 t_pay_flow" },
|
|
|
|
|
|
|
|
|
|
|
|
{ "re": "\\bbuyer_id\\b", "hint": "字段统一为 user_id" },
|
|
|
|
|
|
{ "re": "\\bcreated_at\\b", "hint": "字段统一为 create_time" },
|
|
|
|
|
|
{ "re": "\\bout_trade_no\\b", "hint": "字段统一为 pay_no(支付流水号)" },
|
|
|
|
|
|
|
|
|
|
|
|
{ "re": "'(PAID|PENDING|WAIT_PAY|SHIPPED|CANCELLED|CANCELED)'", "hint": "订单状态统一用数字取值(10 待支付 / 20 已支付 / 30 已发货 / 40 已完成 / 50 已取消 / 60 已退款)" },
|
|
|
|
|
|
{ "re": "'(SUCCESS|CREATED|NEW)'", "hint": "支付/订单状态统一用数字取值" },
|
|
|
|
|
|
{ "re": "status=PAID", "hint": "状态统一写 status=20(已支付)" },
|
|
|
|
|
|
|
|
|
|
|
|
{ "re": "example\\.com/qa/", "hint": "Go 示例模块路径统一为 qa/tdcheck" },
|
|
|
|
|
|
{ "re": "\\bqa/testdata\\b", "hint": "Go CLI 交付物模块路径统一为 qa/tdcheck" },
|
2026-10-16 18:33:11 +08:00
|
|
|
|
{ "re": "\\btestdev/ordercli\\b", "hint": "Go 示例模块路径统一为 qa/tdcheck" },
|
|
|
|
|
|
{ "re": "\\btdframe\\b", "hint": "阶段 2 收口的统一框架仓库统一为 qa/tdrun" },
|
2026-10-16 21:34:26 +08:00
|
|
|
|
{ "re": "\\btdrunner\\b", "hint": "阶段 2 收口的统一框架仓库统一为 qa/tdrun" },
|
|
|
|
|
|
|
|
|
|
|
|
{ "re": "\\btd[-_]?platform\\b", "hint": "阶段 3 测试平台统一叫 qa/tdplat" },
|
|
|
|
|
|
{ "re": "\\btest[-_]?platform\\b", "hint": "阶段 3 测试平台统一叫 qa/tdplat" },
|
|
|
|
|
|
{ "re": "\\b(FROM|JOIN|INTO|UPDATE|TABLE|ON)\\s+(case_info|test_case|cases)\\b", "hint": "平台用例表统一为 tp_case" },
|
|
|
|
|
|
{ "re": "\\b(FROM|JOIN|INTO|UPDATE|TABLE|ON)\\s+(suite_info|test_suite|suites)\\b", "hint": "平台套件表统一为 tp_suite" },
|
|
|
|
|
|
{ "re": "\\b(FROM|JOIN|INTO|UPDATE|TABLE|ON)\\s+(task_info|test_task|jobs)\\b", "hint": "平台任务表统一为 tp_task" },
|
|
|
|
|
|
{ "re": "\\b(run_record|exec_record|execution_record)\\b", "hint": "平台执行记录统一为 tp_run" },
|
|
|
|
|
|
{ "re": "\\b(report_detail|case_result|result_detail)\\b", "hint": "平台结果明细统一为 tp_run_item" },
|
|
|
|
|
|
{ "re": "\\b(platform_user|qa_user)\\b", "hint": "平台用户表统一为 tp_user" },
|
|
|
|
|
|
{ "re": "\\b(updated_at|started_at|finished_at|added_at|archived_at)\\b\\s+(DATETIME|TIMESTAMP|DATE|INT|BIGINT)", "hint": "平台表时间字段统一为 *_time(update_time / start_time / finish_time / add_time / archive_time)" },
|
|
|
|
|
|
{ "re": "<td>(updated_at|started_at|finished_at|added_at|archived_at)</td>", "hint": "平台表时间字段统一为 *_time(update_time / start_time / finish_time / add_time / archive_time)" }
|
2026-10-16 08:58:10 +08:00
|
|
|
|
]
|
|
|
|
|
|
}
|