#400 get author by id
This commit is contained in:
parent
9989e37027
commit
6ee19b8eca
@ -510,6 +510,32 @@ namespace RMuseum.Controllers
|
||||
return Ok(authorsRes.Result.Authors);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get author by id
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("author/{id}")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(Author))]
|
||||
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
|
||||
|
||||
public async Task<IActionResult> GetAuthorByIdAsync(int id)
|
||||
{
|
||||
var authorsRes = await _pdfService.GetAuthorByIdAsync(id);
|
||||
if (!string.IsNullOrEmpty(authorsRes.ExceptionString))
|
||||
{
|
||||
return BadRequest(authorsRes.ExceptionString);
|
||||
}
|
||||
|
||||
if(authorsRes.Result == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return Ok(authorsRes.Result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// add a new author
|
||||
/// </summary>
|
||||
|
||||
@ -2454,6 +2454,13 @@
|
||||
<param name="authorName"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.PDFLibraryController.GetAuthorByIdAsync(System.Int32)">
|
||||
<summary>
|
||||
get author by id
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.PDFLibraryController.AddAuthorAsync(RMuseum.Models.PDFLibrary.Author)">
|
||||
<summary>
|
||||
add a new author
|
||||
|
||||
Loading…
Reference in New Issue
Block a user