更新库pkg

This commit is contained in:
ayflying
2025-03-14 14:26:07 +08:00
parent 4963780a32
commit 5fbe4d5dcf
18 changed files with 443 additions and 12 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/ayflying/utility_go/internal/model/entity"
"github.com/ayflying/utility_go/package/aycache"
"github.com/ayflying/utility_go/pgk"
"github.com/ayflying/utility_go/pkg"
service2 "github.com/ayflying/utility_go/service"
"github.com/ayflying/utility_go/tools"
"github.com/gogf/gf/v2/container/gset"
@@ -70,8 +71,8 @@ func (s *sGameAct) Info(uid int64, actId int) (data *g.Var, err error) {
// 将查询到的活动信息保存到Redis缓存中
_, err = g.Redis().Set(ctx, keyCache, data)
var ActUidUpdateTimeCacheKey = fmt.Sprintf("act:update:%d", uid)
aycache.New("redis").Set(ctx, ActUidUpdateTimeCacheKey, uid, time.Hour*24*3)
var CacheKey = fmt.Sprintf("act:update:%d", uid)
pkg.Cache("redis").Set(ctx, CacheKey, uid, time.Hour*24*3)
return
}
@@ -148,9 +149,9 @@ func (s *sGameAct) Save(actId int) (err error) {
continue
}
var ActUidUpdateTimeCacheKey = fmt.Sprintf("act:update:%d", uid)
var CacheKey = fmt.Sprintf("act:update:%d", uid)
//如果有活跃,跳过持久化
if getBool, _ := aycache.New("redis").Contains(ctx, ActUidUpdateTimeCacheKey); getBool {
if getBool, _ := aycache.New("redis").Contains(ctx, CacheKey); getBool {
continue
}

View File

@@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
v1 "github.com/ayflying/utility_go/api/pgk/v1"
"github.com/ayflying/utility_go/pgk/notice"
"github.com/ayflying/utility_go/pkg/notice"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/gclient"
)