29 lines
958 B
C#
29 lines
958 B
C#
using DramaLing.Api.Models.DTOs;
|
|
using DramaLing.Api.Services.AI.Generation;
|
|
|
|
namespace DramaLing.Api.Services;
|
|
|
|
public class ImageGenerationOrchestrator : IImageGenerationOrchestrator
|
|
{
|
|
private readonly IImageGenerationWorkflow _workflow;
|
|
|
|
public ImageGenerationOrchestrator(IImageGenerationWorkflow workflow)
|
|
{
|
|
_workflow = workflow ?? throw new ArgumentNullException(nameof(workflow));
|
|
}
|
|
|
|
public async Task<GenerationRequestResult> StartGenerationAsync(Guid flashcardId, GenerationRequest request)
|
|
{
|
|
return await _workflow.StartGenerationAsync(flashcardId, request);
|
|
}
|
|
|
|
public async Task<GenerationStatusResponse> GetGenerationStatusAsync(Guid requestId)
|
|
{
|
|
return await _workflow.GetGenerationStatusAsync(requestId);
|
|
}
|
|
|
|
public async Task<bool> CancelGenerationAsync(Guid requestId)
|
|
{
|
|
return await _workflow.CancelGenerationAsync(requestId);
|
|
}
|
|
} |