产线使用费(订阅制)照 account_resource/storage_resource 范式接入产品层:
- models/pipeline_pricing_map.json: pipeline_id × charge_mode(month/year) → ppid
(月付 months=1/valid_days=30;年付 months=10/valid_days=365,即月费×10 付10个月用12个月)
- pipeline_pricing.py: 定价映射 CRUD + calculate_pipeline_amount
(buffered_charging(ppid, {months}) 算原价;无定价方案/金额0 均抛异常不静默)
- product_interface.py: 7 个标准接口(load_product_category_product 导入用;
get_product_display 展示月/年双档价;execute_product_service 开订阅权益)
- init.py load_pipeline_core: 注册 env.product_interface(module_name='pipeline_core')
+ env.pipeline_pricing_map_save/get_pipeline_ppid/calculate_pipeline_amount
资源主表复用 pipelines(status='published' 才可售),不建 usage 表——
订阅购买是同步实时记账(purchase_realtime → product_accounting_generic 写 biz_order)。
用户定稿的商业模型(2026-09-06):账号免费只管并发配额;产线单独包月
(商机100/投标150/开发200,年付=月×10);模型按量加价;存储 1元/GB月。
29 lines
1.8 KiB
JSON
29 lines
1.8 KiB
JSON
{
|
||
"summary": [
|
||
{
|
||
"name": "pipeline_pricing_map",
|
||
"title": "产线计费映射(pipeline_id × charge_mode → ppid,照 acctres_pricing_map 范式)",
|
||
"primary": ["id"]
|
||
}
|
||
],
|
||
"fields": [
|
||
{"name": "id", "title": "ID", "type": "str", "length": 32, "nullable": "no"},
|
||
{"name": "pipeline_id", "title": "产线ID(pipelines.id)", "type": "str", "length": 32, "nullable": "no"},
|
||
{"name": "charge_mode", "title": "计费方式(month/year)", "type": "str", "length": 32, "nullable": "no"},
|
||
{"name": "months", "title": "计费月数(月付=1,年付=10即月费×10)", "type": "int", "nullable": "no", "default": "1"},
|
||
{"name": "valid_days", "title": "权益有效天数(月付30/年付365)", "type": "int", "nullable": "no", "default": "30"},
|
||
{"name": "ppid", "title": "定价项目ID", "type": "str", "length": 32, "nullable": "yes"},
|
||
{"name": "is_default", "title": "缺省方式", "type": "str", "length": 1, "nullable": "yes", "default": "0"},
|
||
{"name": "status", "title": "状态", "type": "str", "length": 16, "nullable": "yes", "default": "active"},
|
||
{"name": "org_id", "title": "所属机构", "type": "str", "length": 32, "nullable": "yes"},
|
||
{"name": "created_by", "title": "创建人", "type": "str", "length": 32, "nullable": "yes"},
|
||
{"name": "created_at", "title": "创建时间", "type": "timestamp", "nullable": "yes"},
|
||
{"name": "updated_at", "title": "更新时间", "type": "timestamp", "nullable": "yes"}
|
||
],
|
||
"indexes": [
|
||
{"name": "idx_ppm_pipeline", "idxtype": "index", "idxfields": ["pipeline_id"]},
|
||
{"name": "idx_ppm_mode", "idxtype": "unique", "idxfields": ["pipeline_id", "charge_mode"]},
|
||
{"name": "idx_ppm_ppid", "idxtype": "index", "idxfields": ["ppid"]}
|
||
]
|
||
}
|