feat(admin): manually edit scene inputs (content elements)
Scene content elements (the editable Text/Media/Color/… inputs inside a scene) had no CRUD — only AEP-import created them, so admins couldn't define or edit them. Added full management: content-svc: - SceneElementsController: GET/POST/PUT/DELETE /v1/scene-elements?scene_id= - SceneColorService: Get/Create/Update/DeleteContentElementAsync - ContentElementResponse + SaveContentElementRequest (key, title, type, default_value, hint, position, text-box/font/media flags) gateway: route /v1/scene-elements/*path → content frontend: SceneColorEditor scenes tab → per-scene "ورودیها" expander with full add/edit/delete of inputs (15 element types: Text/Media/Color/Number/…) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,33 @@ public class ScenesController(SceneColorService svc) : ControllerBase
|
||||
}
|
||||
}
|
||||
|
||||
[ApiController]
|
||||
[Route("v1/scene-elements")]
|
||||
public class SceneElementsController(SceneColorService svc) : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> List([FromQuery(Name = "scene_id")] Guid sceneId) =>
|
||||
Ok(await svc.GetContentElementsAsync(sceneId));
|
||||
|
||||
[Authorize(Roles = "Admin")]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> Create([FromBody] SaveContentElementRequest req) =>
|
||||
Ok(await svc.CreateContentElementAsync(req));
|
||||
|
||||
[Authorize(Roles = "Admin")]
|
||||
[HttpPut("{id:guid}")]
|
||||
public async Task<IActionResult> Update(Guid id, [FromBody] SaveContentElementRequest req) =>
|
||||
Ok(await svc.UpdateContentElementAsync(id, req));
|
||||
|
||||
[Authorize(Roles = "Admin")]
|
||||
[HttpDelete("{id:guid}")]
|
||||
public async Task<IActionResult> Delete(Guid id)
|
||||
{
|
||||
await svc.DeleteContentElementAsync(id);
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
|
||||
[ApiController]
|
||||
[Route("v1/shared-colors")]
|
||||
public class SharedColorsController(SceneColorService svc) : ControllerBase
|
||||
|
||||
Reference in New Issue
Block a user