From a930267709dfb0e677252910f3d4b02a5ed434c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=8C?= <259278618@qq.com> Date: Thu, 13 Aug 2026 15:58:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20scene=5Fnode=20=E6=96=B0=E5=A2=9E=20scr?= =?UTF-8?q?ipt=20=E5=89=A7=E6=9C=AC=E5=88=97=E5=B9=B6=E9=80=8F=E5=87=BA=20?= =?UTF-8?q?NodeVO=EF=BC=88v2=20=E5=89=A7=E6=83=85=E6=BC=94=E7=BB=8E?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B1=82=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- biz/dao/dao_scene_node.go | 2 ++ biz/model/dto/level.go | 1 + biz/model/entity/entity_scene_node.go | 1 + biz/service/level.go | 2 ++ 4 files changed, 6 insertions(+) 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(), }