docs: #352 API methods for poem geo tags CRUD

This commit is contained in:
Hamid Reza Mohammadi 2022-08-01 22:44:52 +04:30
parent 2142c12a71
commit eba5e0bc1b
2 changed files with 134 additions and 0 deletions

View File

@ -3228,6 +3228,84 @@ namespace RMuseum.Controllers
return Ok();
}
/// <summary>
/// get poem tags ordered by LunarDateTotalNumber then by Id
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("poem/{id}/geotag")]
[AllowAnonymous]
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<PoemGeoDateTag>))]
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public async Task<IActionResult> GetPoemGeoDateTagsAsync(int id)
{
var res =
await _ganjoorService.GetPoemGeoDateTagsAsync(id);
if (!string.IsNullOrEmpty(res.ExceptionString))
return BadRequest(res.ExceptionString);
return Ok(res.Result);
}
/// <summary>
/// add poem geo tag
/// </summary>
/// <param name="tag"></param>
/// <returns></returns>
[HttpPost]
[Route("poem/geotag")]
[Authorize(Policy = RMuseumSecurableItem.GanjoorEntityShortName + ":" + SecurableItem.ModifyOperationShortName)]
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(PoemGeoDateTag))]
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
public async Task<IActionResult> AddPoemGeoDateTagAsync([FromBody] PoemGeoDateTag tag)
{
RServiceResult<PoemGeoDateTag> res =
await _ganjoorService.AddPoemGeoDateTagAsync(tag);
if (!string.IsNullOrEmpty(res.ExceptionString))
return BadRequest(res.ExceptionString);
return Ok(res.Result);
}
/// <summary>
/// update poem tag
/// </summary>
/// <param name="tag"></param>
/// <returns></returns>
[HttpPut]
[Route("poem/geotag")]
[Authorize(Policy = RMuseumSecurableItem.GanjoorEntityShortName + ":" + SecurableItem.ModifyOperationShortName)]
[ProducesResponseType((int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
public async Task<IActionResult> UpdatePoemGeoDateTagAsync([FromBody] PoemGeoDateTag tag)
{
RServiceResult<bool> res =
await _ganjoorService.UpdatePoemGeoDateTagAsync(tag);
if (!string.IsNullOrEmpty(res.ExceptionString))
return BadRequest(res.ExceptionString);
return Ok();
}
/// <summary>
/// delete poem tag
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpDelete]
[Route("poem/geotag/{id}")]
[Authorize(Policy = RMuseumSecurableItem.GanjoorEntityShortName + ":" + SecurableItem.ModifyOperationShortName)]
[ProducesResponseType((int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
public async Task<IActionResult> DeletePoemGeoDateTagAsync(int id)
{
RServiceResult<bool> res =
await _ganjoorService.DeletePoemGeoDateTagAsync(id);
if (!string.IsNullOrEmpty(res.ExceptionString))
return BadRequest(res.ExceptionString);
return Ok();
}

View File

@ -1839,6 +1839,34 @@
<param name="destId"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.GanjoorController.GetPoemGeoDateTagsAsync(System.Int32)">
<summary>
get poem tags ordered by LunarDateTotalNumber then by Id
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.GanjoorController.AddPoemGeoDateTagAsync(RMuseum.Models.Ganjoor.PoemGeoDateTag)">
<summary>
add poem geo tag
</summary>
<param name="tag"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.GanjoorController.UpdatePoemGeoDateTagAsync(RMuseum.Models.Ganjoor.PoemGeoDateTag)">
<summary>
update poem tag
</summary>
<param name="tag"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.GanjoorController.DeletePoemGeoDateTagAsync(System.Int32)">
<summary>
delete poem tag
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="P:RMuseum.Controllers.GanjoorController.ReadOnlyMode">
<summary>
readonly mode
@ -12917,6 +12945,34 @@
<param name="destMeterId"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Services.IGanjoorService.AddPoemGeoDateTagAsync(RMuseum.Models.Ganjoor.PoemGeoDateTag)">
<summary>
add poem geo tag
</summary>
<param name="tag"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Services.IGanjoorService.UpdatePoemGeoDateTagAsync(RMuseum.Models.Ganjoor.PoemGeoDateTag)">
<summary>
update poem tag
</summary>
<param name="tag"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Services.IGanjoorService.DeletePoemGeoDateTagAsync(System.Int32)">
<summary>
delete poem tag
</summary>
<param name="id"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Services.IGanjoorService.GetPoemGeoDateTagsAsync(System.Int32)">
<summary>
get poem tags ordered by LunarDateTotalNumber then by Id
</summary>
<param name="poemId"></param>
<returns></returns>
</member>
<member name="T:RMuseum.Services.IGanjoorTranslationService">
<summary>
translation service implementation