i18n翻译

This commit is contained in:
hu xiaotong
2025-07-11 17:09:24 +08:00
parent 9293db3809
commit 4ac2072fce
9 changed files with 733 additions and 48 deletions

28
internal/util/cache.go Normal file
View File

@@ -0,0 +1,28 @@
package util
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gcache"
)
var RedisCache = func() *gcache.Cache {
cache := gcache.New()
cache.SetAdapter(gcache.NewAdapterRedis(g.Redis()))
return cache
}()
// Info 全局Info日志
func Info(ctx context.Context, args ...interface{}) {
g.Log().Info(ctx, args...)
}
// Debug 全局Debug日志
func Debug(ctx context.Context, args ...interface{}) {
g.Log().Debug(ctx, args...)
}
// Error 全局Error日志
func Error(ctx context.Context, args ...interface{}) {
g.Log().Error(ctx, args...)
}