From cbc14aa78d4faaee139b1379fd59eba0fa744ced Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Fri, 10 Jan 2025 11:31:40 +0330 Subject: [PATCH] ganjoor museum: add an item to an existing book #457 --- RMuseum/Controllers/ArtifactController.cs | 19 +++++++++++++++++ RMuseum/RMuseum.xml | 26 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/RMuseum/Controllers/ArtifactController.cs b/RMuseum/Controllers/ArtifactController.cs index 2c408774..7ee0057d 100644 --- a/RMuseum/Controllers/ArtifactController.cs +++ b/RMuseum/Controllers/ArtifactController.cs @@ -2279,6 +2279,25 @@ namespace RMuseum.Controllers } } + /// + /// add a new item to an artifact + /// + /// + /// + /// + [HttpPut("item/{artifactId}")] + [Authorize(Policy = RMuseumSecurableItem.ArtifactEntityShortName + ":" + SecurableItem.ModifyOperationShortName)] + [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(RArtifactItemRecord))] + [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] + [ProducesResponseType((int)HttpStatusCode.Unauthorized)] + public async Task AddItemToArtifactAsync(Guid artifactId, IFormFile jpeg) + { + var res = await _artifactService.AddItemToArtifactAsync(artifactId, jpeg, null); + if (!string.IsNullOrEmpty(res.ExceptionString)) + return BadRequest(res.ExceptionString); + return Ok(res.Result); + } + /// /// readonly mode /// diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml index a73a3943..1c26ac0c 100644 --- a/RMuseum/RMuseum.xml +++ b/RMuseum/RMuseum.xml @@ -674,6 +674,14 @@ + + + add a new item to an artifact + + + + + readonly mode @@ -15339,6 +15347,15 @@ create images for ganjoor - offline + + + add item to an artifact + + + + + + donation service @@ -18021,6 +18038,15 @@ + + + add item to an artifact + + + + + + Database Contetxt