From 0f1f8a03c2f3cf454a641e4761768af40dd55e47 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Fri, 15 Nov 2024 16:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=88=BF=E5=A5=96=E5=93=81?= =?UTF-8?q?=E4=BB=B7=E5=80=BC=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/rpc/svc/servicecontext.go | 4 ++-- statistics/main.go | 8 ++++---- util/{ => viperx}/viper.go | 2 +- worldsrv/customroommgr.go | 2 ++ 4 files changed, 9 insertions(+), 7 deletions(-) rename util/{ => viperx}/viper.go (96%) diff --git a/db/rpc/svc/servicecontext.go b/db/rpc/svc/servicecontext.go index 3a54cee..7f11e8c 100644 --- a/db/rpc/svc/servicecontext.go +++ b/db/rpc/svc/servicecontext.go @@ -7,8 +7,8 @@ import ( "go.mongodb.org/mongo-driver/mongo" - "mongo.games.com/game/common" mon "mongo.games.com/game/mongo" + "mongo.games.com/game/util/viperx" "mongo.games.com/goserver/core/logger" ) @@ -19,7 +19,7 @@ type ServiceContext struct { func NewServiceContext() *ServiceContext { - vp := common.GetViper("mgo", "json") + vp := viperx.GetViper("mgo", "json") // mongo初始化 conf := &mon.Config{} err := vp.Unmarshal(conf) diff --git a/statistics/main.go b/statistics/main.go index 56d81aa..dd5e27d 100644 --- a/statistics/main.go +++ b/statistics/main.go @@ -18,7 +18,7 @@ import ( "mongo.games.com/game/statistics/static" "mongo.games.com/game/statistics/syn" "mongo.games.com/game/statistics/tools" - "mongo.games.com/game/util" + "mongo.games.com/game/util/viperx" ) var VP *viper.Viper @@ -95,9 +95,9 @@ func DoTickPlatform(ctx context.Context, wg *sync.WaitGroup, duration time.Durat } func main() { - VP = util.GetViper("config", "yaml") + VP = viperx.GetViper("config", "yaml") // mongo - vp := util.GetViper("mongo", "yaml") + vp := viperx.GetViper("mongo", "yaml") // mongo初始化 conf := &mongo.Config{} err := vp.Unmarshal(conf) @@ -108,7 +108,7 @@ func main() { defer mongo.Close() // mysql - vp = util.GetViper("mysql", "yaml") + vp = viperx.GetViper("mysql", "yaml") myConf := &mysql.Config{} err = vp.Unmarshal(myConf) if err != nil { diff --git a/util/viper.go b/util/viperx/viper.go similarity index 96% rename from util/viper.go rename to util/viperx/viper.go index 3b695c3..73519eb 100644 --- a/util/viper.go +++ b/util/viperx/viper.go @@ -1,4 +1,4 @@ -package util +package viperx import ( "fmt" diff --git a/worldsrv/customroommgr.go b/worldsrv/customroommgr.go index d25d937..0445cf3 100644 --- a/worldsrv/customroommgr.go +++ b/worldsrv/customroommgr.go @@ -300,6 +300,8 @@ func (c *CustomRoomMgr) UpdateCreate(plt string, configId int32, mustCreate bool RoomConfigId: roomConfig.GetId(), CostType: 1, Voice: cfg.GetVoice(), + Price: roomConfig.GetPrice(), + ImageURL: roomConfig.GetImageURI(), }, RoomConfigSystem: cfg, IsRecruit: true,