feat: scene_node 新增 script 剧本列并透出 NodeVO(v2 剧情演绎数据层)

This commit is contained in:
2026-08-13 15:58:15 +08:00
parent c795047023
commit a930267709
4 changed files with 6 additions and 0 deletions
+2
View File
@@ -27,6 +27,7 @@ CREATE TABLE IF NOT EXISTS scene_node (
node_type INTEGER NOT NULL DEFAULT 1,
interaction_type INTEGER NOT NULL DEFAULT 1,
config TEXT,
script TEXT,
result_type INTEGER NOT NULL DEFAULT 0,
is_entry INTEGER NOT NULL DEFAULT 0,
sort_order INTEGER NOT NULL DEFAULT 1,
@@ -34,5 +35,6 @@ CREATE TABLE IF NOT EXISTS scene_node (
);
CREATE INDEX IF NOT EXISTS idx_node_level ON scene_node(level_id);`)
common.EnsureColumn(ctx, consts.TableSceneNode, "content_pinyin", "TEXT")
common.EnsureColumn(ctx, consts.TableSceneNode, "script", "TEXT")
return err
}
+1
View File
@@ -38,6 +38,7 @@ type NodeVO struct {
Character *ElementVO `json:"character"`
InteractionType int `json:"interaction_type"`
Config string `json:"config"`
Script string `json:"script"`
NodeType int `json:"node_type"`
ResultType int `json:"result_type"`
Options []OptionVO `json:"options"`
+1
View File
@@ -12,6 +12,7 @@ type SceneNode struct {
NodeType int `json:"node_type" orm:"node_type"`
InteractionType int `json:"interaction_type" orm:"interaction_type"`
Config string `json:"config" orm:"config"`
Script string `json:"script" orm:"script"`
ResultType int `json:"result_type" orm:"result_type"`
IsEntry int `json:"is_entry" orm:"is_entry"`
SortOrder int `json:"sort_order" orm:"sort_order"`
+2
View File
@@ -72,6 +72,7 @@ type Node struct {
Character *Element
InteractionType int
Config string
Script string
NodeType int
ResultType int
Options []*Option
@@ -221,6 +222,7 @@ func buildNode(nodeRec gdb.Record, optionRecs []gdb.Record, elements map[int64]*
Character: elements[nodeRec["character_id"].Int64()],
InteractionType: nodeRec["interaction_type"].Int(),
Config: nodeRec["config"].String(),
Script: nodeRec["script"].String(),
NodeType: nodeRec["node_type"].Int(),
ResultType: nodeRec["result_type"].Int(),
}