This commit is contained in:
root
2026-01-14 20:14:57 +05:00
parent 22e681524e
commit 6da379c25e
@@ -87,6 +87,20 @@ public class MarketingController {
return unauthorizedResponse();
}
// TEMP: We use only V2 generate for now.
// Disable the legacy (v1) start endpoint to avoid creating duplicate/old-format
// analyses.
// NOTE: Keep this behind a non-constant condition to avoid "unreachable code"
// errors.
boolean legacyGenerateDisabled = true;
if (legacyGenerateDisabled) {
ErrorResponse disabledError = new ErrorResponse(
"ENDPOINT_DISABLED",
"Обычный generate временно отключен. Используйте V2: POST /api/marketing/analysis/start/v2");
return ResponseEntity.status(HttpStatus.GONE)
.body(ApiResponse.error("Обычный generate временно отключен", disabledError));
}
// Create unified analysis with all analysis types
List<MarketingAnalysis> analyses = marketingAnalysisService.startAnalysis(request, userId);
MarketingAnalysis analysis = analyses.get(0);