diff --git a/biz/dao/dao_scene_node.go b/biz/dao/dao_scene_node.go index 2228fcc..a4a9bd4 100644 --- a/biz/dao/dao_scene_node.go +++ b/biz/dao/dao_scene_node.go @@ -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 } diff --git a/biz/model/dto/level.go b/biz/model/dto/level.go index 43b156b..dea1a7b 100644 --- a/biz/model/dto/level.go +++ b/biz/model/dto/level.go @@ -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"` diff --git a/biz/model/entity/entity_scene_node.go b/biz/model/entity/entity_scene_node.go index b8dd597..d0bce2e 100644 --- a/biz/model/entity/entity_scene_node.go +++ b/biz/model/entity/entity_scene_node.go @@ -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"` diff --git a/biz/service/level.go b/biz/service/level.go index 19f46ac..315ab19 100644 --- a/biz/service/level.go +++ b/biz/service/level.go @@ -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(), }