product_management/models/product.json
yumoqing 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

205 lines
4.8 KiB
JSON

{
"summary": [
{
"name": "product",
"title": "产品注册表",
"primary": [
"id"
],
"catelog": "entity"
}
],
"fields": [
{
"name": "id",
"title": "主键ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "category_id",
"title": "类别ID",
"type": "str",
"length": 32,
"nullable": "no"
},
{
"name": "product_code",
"title": "产品编码",
"type": "str",
"length": 64,
"nullable": "no"
},
{
"name": "product_name",
"title": "产品名称",
"type": "str",
"length": 255,
"nullable": "no"
},
{
"name": "product_type",
"title": "产品类型标识",
"type": "str",
"length": 64,
"nullable": "no"
},
{
"name": "brief_intro",
"title": "产品简介",
"type": "text"
},
{
"name": "detail_intro",
"title": "产品详情",
"type": "text"
},
{
"name": "extra_json",
"title": "扩展属性",
"type": "text"
},
{
"name": "enabled_date",
"title": "启用日期",
"type": "date"
},
{
"name": "expired_date",
"title": "失效日期",
"type": "date"
},
{
"name": "status",
"title": "状态",
"type": "char",
"length": 1,
"default": "1"
},
{
"name": "price_type",
"title": "价格类型",
"type": "char",
"length": 1,
"default": "1"
},
{
"name": "price",
"title": "价格",
"type": "double",
"length": 15,
"dec": 2,
"default": "0.00"
},
{
"name": "currency",
"title": "货币",
"type": "char",
"length": 8,
"default": "CNY"
},
{
"name": "sort_order",
"title": "排序序号",
"type": "int",
"default": "0"
},
{
"name": "org_id",
"title": "所属机构ID",
"type": "str",
"length": 32,
"default": "0"
},
{
"name": "created_by",
"title": "创建人",
"type": "str",
"length": 32
},
{
"name": "created_at",
"title": "创建时间",
"type": "datetime",
"nullable": "no"
},
{
"name": "updated_at",
"title": "更新时间",
"type": "datetime",
"nullable": "no"
}
],
"indexes": [
{
"name": "idx_product_org_category",
"idxtype": "index",
"idxfields": [
"org_id",
"category_id"
]
},
{
"name": "idx_product_org_code",
"idxtype": "unique",
"idxfields": [
"org_id",
"product_code"
]
},
{
"name": "idx_product_org_type",
"idxtype": "index",
"idxfields": [
"org_id",
"product_type"
]
},
{
"name": "idx_product_status",
"idxtype": "index",
"idxfields": [
"status"
]
},
{
"name": "idx_product_enabled_expired",
"idxtype": "index",
"idxfields": [
"enabled_date",
"expired_date"
]
}
],
"codes": [
{
"field": "category_id",
"table": "product_category",
"valuefield": "id",
"textfield": "name",
"cond": "has_product='1' AND status='1'"
},
{
"field": "status",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "id='product_status'"
},
{
"field": "price_type",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "id='product_price_type'"
},
{
"field": "product_type",
"table": "appcodes_kv",
"valuefield": "k",
"textfield": "v",
"cond": "id='product_type'"
}
]
}