package utils

import (
	"github.com/gogf/gcache-adapter/adapter"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/os/gcache"
)

// Cache 自定义缓存服务类
//使用方式
var Cache = CacheService{}

type CacheService struct {
}

func (c CacheService) New() *gcache.Cache {
	//配置缓存
	cache := gcache.New()
	myAdapter := adapter.NewRedis(g.Redis("cache"))
	cache.SetAdapter(myAdapter)
	return cache
}
