Files
flatrender/services/content/FlatRender.ContentSvc/Controllers/ProjectDuplicateController.cs
T
soroush.asadi ee670552a8
Build backend images / build content-svc (push) Failing after 1s
Build backend images / build file-svc (push) Failing after 0s
Build backend images / build gateway (push) Failing after 0s
Build backend images / build identity-svc (push) Failing after 0s
Build backend images / build notification-svc (push) Failing after 1s
Build backend images / build render-svc (push) Failing after 2s
Build backend images / build studio-svc (push) Failing after 0s
feat: cross-aspect project duplication + AEP convention/rule-engine spec
- content-svc: DuplicateProjectAsync clones full scene/element/colour graph
  (identical keys, new dimensions/aspect; AEP intentionally not copied;
  starts unpublished) + POST /v1/projects/{id}/duplicate.
- admin: «تکثیر» button + modal on each project row; aspects reduced to
  supported 16:9/1:1/9:16; free fps default 21 (clamped 1-60).
- docs/aep-template-convention.md: versioned (v1/v2) convention + rule-engine
  spec — modes, scene types, flatrender assembly, duration/fade model,
  fit-box, input types, expression-driven data flow, output spec.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 16:59:23 +03:30

18 lines
737 B
C#

using FlatRender.ContentSvc.Application.Services;
using FlatRender.ContentSvc.Models.Requests;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace FlatRender.ContentSvc.Controllers;
/// <summary>Duplicate a project to another aspect ratio (same scene/element structure, new size).</summary>
[ApiController]
[Route("v1/projects")]
public class ProjectDuplicateController(TemplateService svc) : ControllerBase
{
[Authorize(Roles = "Admin")]
[HttpPost("{id:guid}/duplicate")]
public async Task<IActionResult> Duplicate(Guid id, [FromBody] DuplicateProjectRequest req)
=> Ok(await svc.DuplicateProjectAsync(id, req ?? new DuplicateProjectRequest(null, null, null, null, null, null)));
}