签入脚本

This commit is contained in:
小蚂蚁云
2026-10-20 11:37:25 +08:00
commit 7f5e8470af
909 changed files with 4045080 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
package task
import (
"context"
"fmt"
"time"
"github.com/gogf/gf/v2/frame/g"
"easygoadmin/internal/logic"
)
func init() {
logic.RegisterJobHandler("HelloWorld", helloWorld)
}
// helloWorld 示例任务
// 仅打印日志,用于验证调度链路
func helloWorld(ctx context.Context, params string) (string, error) {
now := time.Now().Format("2006-01-02 15:04:05")
g.Log().Infof(ctx, "[定时任务] HelloWorld 执行,时间: %s,参数: %s", now, paramsText(params))
return fmt.Sprintf("Hello World! 时间: %s | 参数: %s", now, paramsText(params)), nil
}