还原到标准service

This commit is contained in:
ayflying
2025-02-28 12:17:17 +08:00
parent e9540d0971
commit e45e8c7572
7 changed files with 12 additions and 12 deletions

View File

@@ -3,7 +3,7 @@
gfcli: gfcli:
gen: gen:
service: service:
dstFolder: "service2" dstFolder: "service"
pb: pb:
path: "manifest/protobuf" path: "manifest/protobuf"
api: "api" api: "api"

View File

@@ -3,7 +3,7 @@ package act
import ( import (
"fmt" "fmt"
"github.com/ayflying/utility_go/aycache" "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/container/gvar"
"github.com/gogf/gf/v2/os/gctx" "github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/os/gtime" "github.com/gogf/gf/v2/os/gtime"
@@ -24,7 +24,7 @@ func GetCacheKey(uid int64, actId int) string {
func RefreshCache(uid int64, actId int) { func RefreshCache(uid int64, actId int) {
Cache.Remove(gctx.New(), GetCacheKey(uid, actId)) Cache.Remove(gctx.New(), GetCacheKey(uid, actId))
service2.GameAct().RefreshGetRedDotCache(uid) service.GameAct().RefreshGetRedDotCache(uid)
} }
func GetRedDot(uid int64, actId int) *gvar.Var { func GetRedDot(uid int64, actId int) *gvar.Var {

View File

@@ -6,7 +6,7 @@ import (
"github.com/ayflying/utility_go/internal/game/act" "github.com/ayflying/utility_go/internal/game/act"
"github.com/ayflying/utility_go/internal/model/do" "github.com/ayflying/utility_go/internal/model/do"
"github.com/ayflying/utility_go/internal/model/entity" "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/ayflying/utility_go/tools"
"github.com/gogf/gf/v2/container/gset" "github.com/gogf/gf/v2/container/gset"
"github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/frame/g"

View File

@@ -3,7 +3,7 @@ package systemCron
import ( import (
"context" "context"
"github.com/ayflying/utility_go/api/system/v1" "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/frame/g"
"github.com/gogf/gf/v2/os/gcron" "github.com/gogf/gf/v2/os/gcron"
"github.com/gogf/gf/v2/os/gctx" "github.com/gogf/gf/v2/os/gctx"
@@ -57,7 +57,7 @@ func New() *sSystemCron {
} }
func init() { func init() {
service2.RegisterSystemCron(New()) service.RegisterSystemCron(New())
} }
// AddCron 添加一个定时任务到相应的调度列表中。 // AddCron 添加一个定时任务到相应的调度列表中。

View File

@@ -3,7 +3,7 @@
// You can delete these comments if you wish manually maintain this interface file. // You can delete these comments if you wish manually maintain this interface file.
// ================================================================================ // ================================================================================
package service2 package service
import ( import (
"github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/frame/g"

View File

@@ -3,7 +3,7 @@
// You can delete these comments if you wish manually maintain this interface file. // You can delete these comments if you wish manually maintain this interface file.
// ================================================================================ // ================================================================================
package service2 package service
import ( import (
v1 "github.com/ayflying/utility_go/api/system/v1" v1 "github.com/ayflying/utility_go/api/system/v1"

View File

@@ -3,7 +3,7 @@ package utility_go
import ( import (
v1 "github.com/ayflying/utility_go/api/system/v1" v1 "github.com/ayflying/utility_go/api/system/v1"
_ "github.com/ayflying/utility_go/internal/logic" _ "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" "github.com/ayflying/utility_go/config"
) )
@@ -13,11 +13,11 @@ var (
) )
func init() { func init() {
service2.SystemCron().StartCron() service.SystemCron().StartCron()
//用户活动持久化 //用户活动持久化
service2.SystemCron().AddCron(v1.CronType_DAILY, func() error { service.SystemCron().AddCron(v1.CronType_DAILY, func() error {
service2.GameAct().Saves() service.GameAct().Saves()
return nil return nil
}) })
} }