comparison of usage stats of a selected word among all poets #471
This commit is contained in:
parent
7d7bcc130f
commit
b7c2c480ca
@ -4388,13 +4388,38 @@ namespace RMuseum.Controllers
|
||||
if (!string.IsNullOrEmpty(pagedResult.ExceptionString))
|
||||
return BadRequest(pagedResult.ExceptionString);
|
||||
|
||||
var wordCountResult = await _ganjoorService.GetCategoryWordCountByTermAsync(term, catId, poetId);
|
||||
if(!string.IsNullOrEmpty(wordCountResult.ExceptionString))
|
||||
return BadRequest(wordCountResult.ExceptionString);
|
||||
|
||||
// Paging Header
|
||||
HttpContext.Response.Headers.Append("paging-headers", JsonConvert.SerializeObject(pagedResult.Result.PagingMeta));
|
||||
HttpContext.Response.Headers.Append("items-count", JsonConvert.SerializeObject(wordCountResult.Result.Count));
|
||||
|
||||
return Ok(pagedResult.Result.Items);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CategoryWordCount for a specific term in a category
|
||||
/// </summary>
|
||||
/// <param name="term"></param>
|
||||
/// <param name="catId"></param>
|
||||
/// <param name="poetId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("wordcounts/bycat/count")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(CategoryWordCount))]
|
||||
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
|
||||
|
||||
public async Task<IActionResult> GetCategoryWordCountByTermAsync(string term, int? catId, int? poetId)
|
||||
{
|
||||
var countResult = await _ganjoorService.GetCategoryWordCountByTermAsync(term, catId, poetId);
|
||||
if (!string.IsNullOrEmpty(countResult.ExceptionString))
|
||||
return BadRequest(countResult.ExceptionString);
|
||||
|
||||
return Ok(countResult.Result);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -2355,6 +2355,15 @@
|
||||
<param name="poetId">is not necessary unless you mean a specific poet and do not provide catId</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.GanjoorController.GetCategoryWordCountByTermAsync(System.String,System.Nullable{System.Int32},System.Nullable{System.Int32})">
|
||||
<summary>
|
||||
CategoryWordCount for a specific term in a category
|
||||
</summary>
|
||||
<param name="term"></param>
|
||||
<param name="catId"></param>
|
||||
<param name="poetId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.GanjoorController.GetTajikPoetsAsync">
|
||||
<summary>
|
||||
tajik poets
|
||||
@ -19289,7 +19298,7 @@
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.Implementation.GanjoorService.GetCategoryWordCountByTermAsync(System.String,System.Nullable{System.Int32},System.Nullable{System.Int32})">
|
||||
<summary>
|
||||
get CategoryWordCount for a specific term in a category
|
||||
CategoryWordCount for a specific term in a category
|
||||
</summary>
|
||||
<param name="term"></param>
|
||||
<param name="catId"></param>
|
||||
|
||||
@ -113,7 +113,7 @@ namespace RMuseum.Services.Implementation
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get CategoryWordCount for a specific term in a category
|
||||
/// CategoryWordCount for a specific term in a category
|
||||
/// </summary>
|
||||
/// <param name="term"></param>
|
||||
/// <param name="catId"></param>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user