f
This commit is contained in:
@@ -98,6 +98,13 @@ func (m *PDFCacheManager) GetByProduct(productID, version string) ([]byte, bool,
|
||||
return pdfBytes, hit, err
|
||||
}
|
||||
|
||||
// GetByCacheKey 通过缓存键直接获取PDF文件
|
||||
// 适用于已经持久化了缓存键(例如作为报告ID)的场景
|
||||
// 返回PDF字节流、是否命中缓存、文件创建时间、错误
|
||||
func (m *PDFCacheManager) GetByCacheKey(cacheKey string) ([]byte, bool, time.Time, error) {
|
||||
return m.getByKey(cacheKey, "", "")
|
||||
}
|
||||
|
||||
// getByKey 内部方法:根据缓存键获取文件
|
||||
func (m *PDFCacheManager) getByKey(cacheKey string, key1, key2 string) ([]byte, bool, time.Time, error) {
|
||||
cachePath := m.GetCachePath(cacheKey)
|
||||
|
||||
Reference in New Issue
Block a user