12 Commits

Author SHA1 Message Date
3096190f6d feat: product模型添加providerid字段 + 导入改为增量模式
- product.json: 添加providerid字段(供应商ID)
- core.py: import_categories_and_products改为增量模式
  已有产品跳过不再更新, 仅创建新资源对应的产品
  创建产品时自动设置providerid为资源模块返回的值
2026-07-13 14:53:53 +08:00
5f277949ae feat: product_org_auth model; product_list queries authorized products via product_org_auth 2026-07-10 15:38:29 +08:00
Hermes Agent
1438de9d58 refactor: 删除 product_type_config(运营商产品类型配置)功能
- 删除 models/product_type_config.json
- 删除 json/product_type_config_list.json (CRUD定义)
- 删除 wwwroot/product_type_config_manage.ui 和 product_type_config_list/ 目录
- 删除 wwwroot/api/product_type_config_{create,update,delete}.dspy
- core.py: 移除 get_operator_config/set_operator_config 方法
- core.py: get_product_detail 不再查询 operator_config
- __init__.py: 移除 wrapper 函数和 env 注册
- product_detail.dspy: 移除 operator_config 查询逻辑
- scripts/load_path.py: 移除所有 product_type_config 权限路径
- menu.ui: 移除"运营商配置"菜单项
- index.ui: 移除"运营商配置"卡片,更新标题描述
- README.md: 移除相关文档
2026-06-24 10:34:48 +08:00
Hermes Agent
038162b5d9 refactor: dispatch resource_ref_id to resource module interfaces
- product.json: add resource_ref_id field
- core.py: _get_ref_id() helper extracts resource_ref_id from product
- All dispatch methods pass resource_ref_id instead of product_code
- Resource modules no longer need product_code→internal_id mapping
2026-06-23 15:38:35 +08:00
Hermes Agent
0f321b8185 feat: add resource_module field and import sub-categories/products tool
- Add resource_module field to product_category model (stores module name like 'llmage')
- Add resource_module appcode with llmage/supplychain entries to init/data.json
- Add '添加子产品类和产品导入' toolbar tool to tree CRUD (json + generated index.ui)
- Create import_category_products.dspy API endpoint
- Add import_categories_and_products() generic import engine to core.py
- Register import function on ServerEnv
- Update load_path.py with new API endpoint
2026-06-23 13:47:05 +08:00
Hermes Agent
e8f836ba2d 移除临时文件,添加/更新.gitignore 2026-06-22 15:00:30 +08:00
Hermes Agent
f05eea19e5 fix: remove parent_id default '0' from product_category model - Root nodes should have parent_id=NULL, not '0' - Tree query already checks 'parent_id IS NULL' - Revert direct edits to generated dspy files 2026-06-22 14:03:41 +08:00
Hermes Agent
24605f88e8 fix: datetime->timestamp for audit fields + fix sor.U/sor.I misuse in core.py and API dspy
- All 7 models: created_at/updated_at changed from datetime to timestamp type
  (DDL template auto-generates DEFAULT CURRENT_TIMESTAMP for timestamp type)
- core.py: fix all sor.U() calls passing 3 args (id must be in data dict)
- core.py: fix sor.I() misuse for INSERT (should be sor.C())
- API dspy updates: fix sor.U() 3-arg bug in category/product/type_config/resource/subscription/supplier
- product_resource_supplier_update.dspy: add missing updated_at field
2026-06-22 11:04:46 +08:00
Hermes Agent
e8860401bc feat: 产品模块完整功能实现 — 资源绑定/多供应商路由/包月订购/消耗引擎/成本计算
新增模型: 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 完整架构规范
2026-06-20 12:10:32 +08:00
Hermes Agent
1bb7c948d6 fix: codes段cond条件改用parentid替代id 2026-06-17 17:35:33 +08:00
4fd136bf53 refactor: reseller org_id isolation for product_management module
- product_category: org_id scoped tree, product_table_name -> product_type
- product: org_id scoped, added extra_json for custom attributes, product_type field
- product_type_config: org_id + operator_id dual isolation, unique key on (org_id, operator_id, category_id, config_name)
- All 18 API endpoints enforce org_id filtering via ServerEnv
- core.py: all methods accept optional org_id, default to current user's org
- CRUD definitions: logined_userorgid set to org_id on all lists
- init/data.json: removed hardcoded global categories (managed per reseller)
- Rebuilt mysql.ddl.sql and all CRUD UI files
2026-05-25 17:03:08 +08:00
d1ceed9cb9 feat: initial product_management module - category tree, product registry, operator config, standardized API 2026-05-25 17:03:08 +08:00