workweixin
workweixin copied to clipboard
suite cache key 如何获取?或者说 suite ticket 如何获取
定义了redis,但这里要如何获取
type DcsAppSuiteTicketByRedis struct{}
var _ apis.DcsAppSuiteTicket = DcsAppSuiteTicketByRedis{}
func (DcsAppSuiteTicketByRedis) Get(cacheKey string) string {
suiteTicket, err := cache.Rdb.Get(ctx, cacheKey).Result()
if err != nil {
return ""
}
return suiteTicket
}
func (DcsAppSuiteTicketByRedis) Set(cacheKey, suiteTicket string, ttl time.Duration) {
err := cache.Rdb.Set(ctx, cacheKey, suiteTicket, ttl).Err()
if err != nil {
log.Println("保存 suite_ticket 失败:", err)
}
}
看到有方法 workweixin.Sdk.DcsAppSuiteTicket.Get() ,但需要传参cachekey