diff --git a/internal/domains/api/services/processors/pdfg/pdfg01gz_processor.go b/internal/domains/api/services/processors/pdfg/pdfg01gz_processor.go index 490b524..efa9b97 100644 --- a/internal/domains/api/services/processors/pdfg/pdfg01gz_processor.go +++ b/internal/domains/api/services/processors/pdfg/pdfg01gz_processor.go @@ -102,15 +102,15 @@ func ProcessPDFG01GZRequest(ctx context.Context, params []byte, deps *processors // 计算缓存键,作为报告ID(可持久化) reportID := cacheManager.GetCacheKey(paramsDto.Name, paramsDto.IDCard) - // 缓存命中,模拟慢几秒 + // 缓存命中,模拟生成耗时(约4秒) zapLogger.Info("PDF缓存命中,返回缓存文件", zap.String("name", paramsDto.Name), zap.String("id_card", paramsDto.IDCard), zap.String("report_id", reportID), zap.Time("created_at", createdAt), ) - // 模拟慢几秒(2-4秒) - time.Sleep(2 * time.Second) + // 模拟生成耗时 + time.Sleep(4 * time.Second) // 生成下载链接(基于报告ID) downloadURL := generateDownloadURL(apiDomain, reportID) @@ -118,7 +118,6 @@ func ProcessPDFG01GZRequest(ctx context.Context, params []byte, deps *processors return json.Marshal(map[string]interface{}{ "download_url": downloadURL, "report_id": reportID, - "cached": true, "created_at": createdAt.Format(time.RFC3339), "expires_at": expiresAt.Format(time.RFC3339), "ttl_seconds": int(cacheTTL.Seconds()), @@ -206,7 +205,6 @@ func ProcessPDFG01GZRequest(ctx context.Context, params []byte, deps *processors "download_url": downloadURL, "report_id": reportID, "report_number": reportNumber, - "cached": false, "expires_at": expiresAt.Format(time.RFC3339), "ttl_seconds": int(cacheTTL.Seconds()), })