pbl_compiler/models/pbl_script_rule.json
2026-09-18 19:27:22 +08:00

48 lines
4.1 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"summary": [
{
"name": "pbl_script_rule",
"title": "PBL 编译产物:script_engine 规则(script_type=1,第12章 ECR 映射)",
"primary": ["id"],
"catelog": "entity"
}
],
"fields": [
{"name": "tenant_id", "title": "租户ID(多租户隔离,所有查询打头)", "type": "str", "length": 32, "nullable": "no"},
{"name": "id", "title": "主键ID", "type": "str", "length": 32, "nullable": "no"},
{"name": "blueprint_id", "title": "蓝图ID", "type": "str", "length": 32, "nullable": "no", "default": ""},
{"name": "blueprint_version", "title": "蓝图版本号", "type": "str", "length": 32, "nullable": "no", "default": ""},
{"name": "game_def_id", "title": "关联 pbl_game_definition.id", "type": "str", "length": 32, "nullable": "yes", "default": ""},
{"name": "compile_task_no", "title": "编译任务号(可追溯)", "type": "str", "length": 64, "nullable": "yes", "default": ""},
{"name": "rule_id", "title": "规则稳定ID(来源 id/event_key 或内容哈希派生)", "type": "str", "length": 64, "nullable": "no"},
{"name": "script_code", "title": "script_engine 脚本编码(幂等键,确定性派生)", "type": "str", "length": 64, "nullable": "no"},
{"name": "name", "title": "规则名称", "type": "str", "length": 128, "nullable": "yes", "default": ""},
{"name": "description", "title": "规则描述", "type": "str", "length": 512, "nullable": "yes", "default": ""},
{"name": "script_type", "title": "脚本类型(1=规则 event→condition→response)", "type": "str", "length": 16, "nullable": "no", "default": "1"},
{"name": "event_type", "title": "触发事件类型(归一后)", "type": "str", "length": 64, "nullable": "yes", "default": ""},
{"name": "priority", "title": "优先级(大者先执行)", "type": "int", "nullable": "yes", "default": "100"},
{"name": "enabled", "title": "是否启用(1启用/0停用)", "type": "str", "length": 1, "nullable": "yes", "default": "1"},
{"name": "condition_count", "title": "条件节点数", "type": "int", "nullable": "yes", "default": "0"},
{"name": "response_count", "title": "响应动作数", "type": "int", "nullable": "yes", "default": "0"},
{"name": "content", "title": "规则JSON(确定性序列化,script_engine 可直接加载)", "type": "text", "nullable": "no"},
{"name": "content_hash", "title": "规则内容指纹 sha256(幂等比对)", "type": "str", "length": 64, "nullable": "no", "default": ""},
{"name": "rules_hash", "title": "所属规则集指纹 sha256(同版本重编译相等)", "type": "str", "length": 64, "nullable": "yes", "default": ""},
{"name": "origin_json", "title": "来源追溯JSON(blueprint/sub_object/source_path)", "type": "text", "nullable": "yes"},
{"name": "script_ref", "title": "已同步的 script_engine 脚本引用JSON(table/id/code)", "type": "text", "nullable": "yes"},
{"name": "sync_status", "title": "同步状态(pending/synced/skipped/failed)", "type": "str", "length": 16, "nullable": "yes", "default": "pending"},
{"name": "compiler_version", "title": "编译器版本", "type": "str", "length": 32, "nullable": "yes", "default": ""},
{"name": "created_by", "title": "创建人", "type": "str", "length": 32, "nullable": "yes", "default": ""},
{"name": "created_at", "title": "创建时间", "type": "datetime", "nullable": "yes"},
{"name": "updated_at", "title": "更新时间", "type": "datetime", "nullable": "yes"}
],
"indexes": [
{"name": "PRIMARY", "idxtype": "unique", "idxfields": ["id"]},
{"name": "uk_psr_rule", "idxtype": "unique", "idxfields": ["tenant_id", "blueprint_id", "blueprint_version", "rule_id"]},
{"name": "uk_psr_code", "idxtype": "unique", "idxfields": ["tenant_id", "script_code"]},
{"name": "idx_psr_gd", "idxtype": "index", "idxfields": ["tenant_id", "game_def_id"]},
{"name": "idx_psr_hash", "idxtype": "index", "idxfields": ["tenant_id", "rules_hash"]},
{"name": "idx_psr_event", "idxtype": "index", "idxfields": ["tenant_id", "event_type"]}
],
"codes": []
}