新增模型: 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 完整架构规范
84 lines
3.6 KiB
JSON
84 lines
3.6 KiB
JSON
{
|
|
"summary": [
|
|
{
|
|
"name": "product_subscription",
|
|
"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": "user_id", "title": "客户用户ID", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "user_org_id", "title": "客户机构ID", "type": "str", "length": 32, "nullable": "no"},
|
|
{"name": "subscription_type", "title": "订购类型", "type": "char", "length": 1, "nullable": "no"},
|
|
{"name": "status", "title": "状态", "type": "char", "length": 1, "nullable": "no", "default": "1"},
|
|
{"name": "start_date", "title": "生效日期", "type": "date", "nullable": "no"},
|
|
{"name": "end_date", "title": "到期日期", "type": "date", "nullable": "no"},
|
|
{"name": "quota_total", "title": "总配额", "type": "double", "length": 15, "dec": 4, "default": "0"},
|
|
{"name": "quota_used", "title": "已使用量", "type": "double", "length": 15, "dec": 4, "default": "0"},
|
|
{"name": "quota_unit", "title": "配额单位", "type": "str", "length": 32},
|
|
{"name": "overflow_mode", "title": "超额模式", "type": "char", "length": 1, "default": "1"},
|
|
{"name": "overflow_rate", "title": "超额单价", "type": "double", "length": 15, "dec": 6, "default": "0"},
|
|
{"name": "purchase_price", "title": "购买价格", "type": "double", "length": 15, "dec": 2, "default": "0"},
|
|
{"name": "purchase_currency", "title": "货币", "type": "char", "length": 8, "default": "CNY"},
|
|
{"name": "created_at", "title": "创建时间", "type": "datetime", "nullable": "no"},
|
|
{"name": "updated_at", "title": "更新时间", "type": "datetime"}
|
|
],
|
|
"indexes": [
|
|
{"name": "idx_ps_product", "idxtype": "index", "idxfields": ["product_id"]},
|
|
{"name": "idx_ps_user", "idxtype": "index", "idxfields": ["user_id", "user_org_id"]},
|
|
{"name": "idx_ps_status", "idxtype": "index", "idxfields": ["status"]},
|
|
{"name": "idx_ps_dates", "idxtype": "index", "idxfields": ["start_date", "end_date"]}
|
|
],
|
|
"codes": [
|
|
{
|
|
"field": "product_id",
|
|
"table": "product",
|
|
"valuefield": "id",
|
|
"textfield": "product_name"
|
|
},
|
|
{
|
|
"field": "user_id",
|
|
"table": "sage.users",
|
|
"valuefield": "id",
|
|
"textfield": "username"
|
|
},
|
|
{
|
|
"field": "user_org_id",
|
|
"table": "sage.organization",
|
|
"valuefield": "id",
|
|
"textfield": "orgname"
|
|
},
|
|
{
|
|
"field": "subscription_type",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='subscription_type'"
|
|
},
|
|
{
|
|
"field": "status",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='subscription_status'"
|
|
},
|
|
{
|
|
"field": "overflow_mode",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='overflow_mode'"
|
|
},
|
|
{
|
|
"field": "quota_unit",
|
|
"table": "appcodes_kv",
|
|
"valuefield": "k",
|
|
"textfield": "v",
|
|
"cond": "parentid='quota_unit'"
|
|
}
|
|
]
|
|
}
|