新增模型: product_resource, product_resource_supplier, product_subscription, product_usage_log 新增API: 15个.dspy端点(资源绑定/供应商管理/订购/超额/消耗/统计) 新增UI: 4个管理界面(资源绑定/供应商关联/订购管理/消费记录) 核心逻辑: ProductManager新增 bind/unbind/subscribe/product_use/check_quota 等完整业务方法 设计文档: DESIGN.md 完整架构规范
59 lines
2.4 KiB
JSON
59 lines
2.4 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "product_resource",
|
|
"title": "产品资源绑定表",
|
|
"primary": ["id"],
|
|
"catelog": "relation"
|
|
}
|
|
],
|
|
"fields": [
|
|
{"name": "id", "title": "主键ID", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "product_id", "title": "产品ID", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "resource_type", "title": "资源类型", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "resource_ref_id", "title": "资源引用ID", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "resource_ref_name", "title": "资源显示名", "type": "str", "length": 255},
|
|
{"name": "quota", "title": "配额量", "type": "double", "length": 15, "dec": 4, "default": "0"},
|
|
{"name": "quota_unit", "title": "配额单位", "type": "str", "length": 32},
|
|
{"name": "priority", "title": "优先级", "type": "int", "default": "1"},
|
|
{"name": "overflow_product_id", "title": "超额后转用产品ID", "type": "str", "length": 32},
|
|
{"name": "status", "title": "状态", "type": "char", "length": 1, "default": "1"},
|
|
{"name": "created_at", "title": "创建时间", "type": "datetime", "nullable": "no"},
|
|
{"name": "updated_at", "title": "更新时间", "type": "datetime"}
|
|
],
|
|
"indexes": [
|
|
{"name": "idx_pr_product", "idxtype": "index", "idxfields": ["product_id"]},
|
|
{"name": "idx_pr_resource", "idxtype": "index", "idxfields": ["resource_type", "resource_ref_id"]},
|
|
{"name": "idx_pr_status", "idxtype": "index", "idxfields": ["status"]}
|
|
],
|
|
"codes": [
|
|
{
|
|
"field": "product_id",
|
|
"table": "product",
|
|
"valuefield": "id",
|
|
"textfield": "product_name"
|
|
},
|
|
{
|
|
"field": "resource_type",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='resource_type'"
|
|
},
|
|
{
|
|
"field": "quota_unit",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='quota_unit'"
|
|
},
|
|
{
|
|
"field": "status",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='product_status'"
|
|
}
|
|
]
|
|
}
|