PlotDirector/PlotLine/Controllers/RelationshipMapController.cs

20 lines
741 B
C#

using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using PlotLine.Models;
using PlotLine.Services;
namespace PlotLine.Controllers;
[Authorize]
public sealed class RelationshipMapController(IRelationshipMapService relationshipMap) : Controller
{
public async Task<IActionResult> Index(int projectId, int? bookId, int? chapterId, int? sceneId, int? focusCharacterId, bool showFullNetwork = false)
{
var position = StoryPosition.FromTimelineSelection(projectId, bookId, chapterId, sceneId);
var model = position is null
? null
: await relationshipMap.GetAsync(position, focusCharacterId, showFullNetwork);
return model is null ? NotFound() : View(model);
}
}