From e45e8c75721e211a95d5a57c831ce7c69f21b6b0 Mon Sep 17 00:00:00 2001 From: ayflying Date: Fri, 28 Feb 2025 12:17:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E5=88=B0=E6=A0=87=E5=87=86se?= =?UTF-8?q?rvice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hack/config.yaml | 2 +- internal/game/act/act.go | 4 ++-- internal/logic/gameAct/gameAct.go | 2 +- internal/logic/systemCron/systemCron.go | 4 ++-- {service2 => service}/game_act.go | 2 +- {service2 => service}/system_cron.go | 2 +- utility.go | 8 ++++---- 7 files changed, 12 insertions(+), 12 deletions(-) rename {service2 => service}/game_act.go (98%) rename {service2 => service}/system_cron.go (98%) diff --git a/hack/config.yaml b/hack/config.yaml index ba85e54..58f0da2 100644 --- a/hack/config.yaml +++ b/hack/config.yaml @@ -3,7 +3,7 @@ gfcli: gen: service: - dstFolder: "service2" + dstFolder: "service" pb: path: "manifest/protobuf" api: "api" diff --git a/internal/game/act/act.go b/internal/game/act/act.go index ca856dc..983b248 100644 --- a/internal/game/act/act.go +++ b/internal/game/act/act.go @@ -3,7 +3,7 @@ package act import ( "fmt" "github.com/ayflying/utility_go/aycache" - "github.com/ayflying/utility_go/service2" + "github.com/ayflying/utility_go/service" "github.com/gogf/gf/v2/container/gvar" "github.com/gogf/gf/v2/os/gctx" "github.com/gogf/gf/v2/os/gtime" @@ -24,7 +24,7 @@ func GetCacheKey(uid int64, actId int) string { func RefreshCache(uid int64, actId int) { Cache.Remove(gctx.New(), GetCacheKey(uid, actId)) - service2.GameAct().RefreshGetRedDotCache(uid) + service.GameAct().RefreshGetRedDotCache(uid) } func GetRedDot(uid int64, actId int) *gvar.Var { diff --git a/internal/logic/gameAct/gameAct.go b/internal/logic/gameAct/gameAct.go index 27783da..acfaddc 100644 --- a/internal/logic/gameAct/gameAct.go +++ b/internal/logic/gameAct/gameAct.go @@ -6,7 +6,7 @@ import ( "github.com/ayflying/utility_go/internal/game/act" "github.com/ayflying/utility_go/internal/model/do" "github.com/ayflying/utility_go/internal/model/entity" - "github.com/ayflying/utility_go/service2" + service2 "github.com/ayflying/utility_go/service" "github.com/ayflying/utility_go/tools" "github.com/gogf/gf/v2/container/gset" "github.com/gogf/gf/v2/frame/g" diff --git a/internal/logic/systemCron/systemCron.go b/internal/logic/systemCron/systemCron.go index 06279dc..de53fa1 100644 --- a/internal/logic/systemCron/systemCron.go +++ b/internal/logic/systemCron/systemCron.go @@ -3,7 +3,7 @@ package systemCron import ( "context" "github.com/ayflying/utility_go/api/system/v1" - "github.com/ayflying/utility_go/service2" + "github.com/ayflying/utility_go/service" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/os/gcron" "github.com/gogf/gf/v2/os/gctx" @@ -57,7 +57,7 @@ func New() *sSystemCron { } func init() { - service2.RegisterSystemCron(New()) + service.RegisterSystemCron(New()) } // AddCron 添加一个定时任务到相应的调度列表中。 diff --git a/service2/game_act.go b/service/game_act.go similarity index 98% rename from service2/game_act.go rename to service/game_act.go index b62eac9..242a761 100644 --- a/service2/game_act.go +++ b/service/game_act.go @@ -3,7 +3,7 @@ // You can delete these comments if you wish manually maintain this interface file. // ================================================================================ -package service2 +package service import ( "github.com/gogf/gf/v2/frame/g" diff --git a/service2/system_cron.go b/service/system_cron.go similarity index 98% rename from service2/system_cron.go rename to service/system_cron.go index 72f91c6..ce798a5 100644 --- a/service2/system_cron.go +++ b/service/system_cron.go @@ -3,7 +3,7 @@ // You can delete these comments if you wish manually maintain this interface file. // ================================================================================ -package service2 +package service import ( v1 "github.com/ayflying/utility_go/api/system/v1" diff --git a/utility.go b/utility.go index c46a3ce..120fda2 100644 --- a/utility.go +++ b/utility.go @@ -3,7 +3,7 @@ package utility_go import ( v1 "github.com/ayflying/utility_go/api/system/v1" _ "github.com/ayflying/utility_go/internal/logic" - "github.com/ayflying/utility_go/service2" + "github.com/ayflying/utility_go/service" "github.com/ayflying/utility_go/config" ) @@ -13,11 +13,11 @@ var ( ) func init() { - service2.SystemCron().StartCron() + service.SystemCron().StartCron() //用户活动持久化 - service2.SystemCron().AddCron(v1.CronType_DAILY, func() error { - service2.GameAct().Saves() + service.SystemCron().AddCron(v1.CronType_DAILY, func() error { + service.GameAct().Saves() return nil }) }