- portal.data.js 新增模块 testdev(dir: 测试开发工程师)与资料 testdev-learning-path,统计取站点实测值:7 阶段 / 32 模块 / 219 知识要点 - index.html、README.md、DEPLOY.md 同步为五个板块,公网验证清单补 testdev 入口 - testdev 的 51 个页面补上 data-portal-back,返回按钮直达 #/testdev/testdev-learning-path - 自检:check-portal.js 通过(5 板块 / 7 份资料);add-back-links.js --check 通过(505 页全就绪)
74 lines
4.9 KiB
JSON
74 lines
4.9 KiB
JSON
/* ==========================================================================
|
||
术语表(全站统一的示例命名)
|
||
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)",
|
||
"CLI 交付物 module": "qa/tdcheck"
|
||
}
|
||
},
|
||
"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" },
|
||
{ "re": "\\btestdev/ordercli\\b", "hint": "Go 示例模块路径统一为 qa/tdcheck" }
|
||
]
|
||
}
|