ganjoor museum: add an item to an existing book #457

This commit is contained in:
Hamid Reza Mohammadi 2025-01-10 11:31:40 +03:30
parent e7d50a52b0
commit cbc14aa78d
2 changed files with 45 additions and 0 deletions

View File

@ -2279,6 +2279,25 @@ namespace RMuseum.Controllers
}
}
/// <summary>
/// add a new item to an artifact
/// </summary>
/// <param name="artifactId"></param>
/// <param name="jpeg"></param>
/// <returns></returns>
[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<IActionResult> 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);
}
/// <summary>
/// readonly mode
/// </summary>

View File

@ -674,6 +674,14 @@
</summary>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.ArtifactController.AddItemToArtifactAsync(System.Guid,Microsoft.AspNetCore.Http.IFormFile)">
<summary>
add a new item to an artifact
</summary>
<param name="artifactId"></param>
<param name="jpeg"></param>
<returns></returns>
</member>
<member name="P:RMuseum.Controllers.ArtifactController.ReadOnlyMode">
<summary>
readonly mode
@ -15339,6 +15347,15 @@
create images for ganjoor - offline
</summary>
</member>
<member name="M:RMuseum.Services.IArtifactService.AddItemToArtifactAsync(System.Guid,Microsoft.AspNetCore.Http.IFormFile,System.IO.Stream)">
<summary>
add item to an artifact
</summary>
<param name="artifactId"></param>
<param name="file"></param>
<param name="jpegStream"></param>
<returns></returns>
</member>
<member name="T:RMuseum.Services.IDonationService">
<summary>
donation service
@ -18021,6 +18038,15 @@
<param name="term"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Services.Implementation.ArtifactService.AddItemToArtifactAsync(System.Guid,Microsoft.AspNetCore.Http.IFormFile,System.IO.Stream)">
<summary>
add item to an artifact
</summary>
<param name="artifactId"></param>
<param name="file"></param>
<param name="jpegStream"></param>
<returns></returns>
</member>
<member name="F:RMuseum.Services.Implementation.ArtifactService._context">
<summary>
Database Contetxt