还原到标准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

52
service/game_act.go Normal file
View File

@@ -0,0 +1,52 @@
// ================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================
package service
import (
"github.com/gogf/gf/v2/frame/g"
)
type (
IGameAct interface {
// Info 获取活动信息
//
// @Description: 根据用户ID和活动ID获取活动信息
// @receiver s *sGameAct: 代表活动操作的结构体实例
// @param uid int64: 用户ID
// @param actId int: 活动ID
// @return data *v1.Act: 返回活动信息结构体指针
// @return err error: 返回错误信息
Info(uid int64, actId int) (data *g.Var, err error)
// Set 将指定用户的活动信息存储到Redis缓存中。
//
// @Description:
// @receiver s *sGameAct: 表示sGameAct类型的实例。
// @param uid int64: 用户的唯一标识。
// @param actId int: 活动的唯一标识。
// @param data interface{}: 要存储的活动信息数据。
// @return err error: 返回错误信息如果操作成功则返回nil。
Set(uid int64, actId int, data interface{}) (err error)
Saves() (err error)
Save(actId int) (err error)
// 清空GetRedDot缓存
RefreshGetRedDotCache(uid int64)
}
)
var (
localGameAct IGameAct
)
func GameAct() IGameAct {
if localGameAct == nil {
panic("implement not found for interface IGameAct, forgot register?")
}
return localGameAct
}
func RegisterGameAct(i IGameAct) {
localGameAct = i
}

52
service/system_cron.go Normal file
View File

@@ -0,0 +1,52 @@
// ================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================
package service
import (
v1 "github.com/ayflying/utility_go/api/system/v1"
"github.com/gogf/gf/v2/net/gclient"
)
type (
ISystemCron interface {
Guardian(DingTalkWebHook string)
// DingTalk 发送钉钉消息
//
// @Description: 向指定的钉钉机器人发送消息。
// @receiver s: 系统定时任务结构体指针。
// @param value: 要发送的消息内容。
DingTalk(DingTalkWebHook string, value string) (res *gclient.Response)
ReadLog()
// AddCron 添加一个定时任务到相应的调度列表中。
//
// @Description: 根据指定的类型将函数添加到不同的任务列表中,以供后续执行。
// @receiver s: sSystemCron的实例代表一个调度系统。
// @param typ: 任务的类型,决定该任务将被添加到哪个列表中。对应不同的时间间隔。
// @param _func: 要添加的任务函数该函数执行时应该返回一个error。
AddCron(typ v1.CronType, _func func() error)
// StartCron 开始计划任务执行
//
// @Description:
// @receiver s
// @return err
StartCron() (err error)
}
)
var (
localSystemCron ISystemCron
)
func SystemCron() ISystemCron {
if localSystemCron == nil {
panic("implement not found for interface ISystemCron, forgot register?")
}
return localSystemCron
}
func RegisterSystemCron(i ISystemCron) {
localSystemCron = i
}