#186 api for effective corrections for poem
This commit is contained in:
parent
161cfe952b
commit
9015b3e0d3
@ -421,7 +421,7 @@
|
||||
لطفاً توجه داشته باشید که حاشیهها برای ثبت نظرات شما راجع به <strong>همین شعر</strong> در نظر گرفته شدهاند. در صورتی که در متن ثبت شدهٔ شعر در گنجور تفاوتهایی غیر از موارد قابل ویرایش یافتید، در مورد این شعر نظر یا احساس خاصی دارید یا مطلب خاصی در مورد آن میدانید یا دوست دارید دربارهٔ آن از دیگران چیزی بپرسید یک حاشیه برای آن بنویسید. <span style="color:#f00">لطفاً از درج مطالب غیرمرتبط با متن این شعر خاص خودداری فرمایید</span> و حتیالامکان سعی کنید متن حاشیهٔ خود را با حروف فارسی درج کنید (حاشیهها بازبینی خواهند شد و موارد غیرمرتبط و ناقض این نکات حذف میشوند).
|
||||
</p>
|
||||
<p>
|
||||
<span style="color:#f00">بحثهای مذهبی و اعتقادی و ارجاع توهینآمیز نسبت به بزرگان ادیان و همینطور بحثهای قومیتی و توهین به فرهنگها و قومیتها و زبانها و بحثهای مرتبط با سیاست روز از مصادیق حاشیههای نامناسب محسوب میشوند.</span> لطفاً از هیچ قوم و مذهبی با صفات زننده صحبت نکنید و به خاطر داشته باشید که همهٔ اقوام (حتی ایرانیها) در مقاطعی از تاریخ خود نسبت به اقوام دیگر بدوی محسوب میشدهاند یا با تعدی به خاک همسایگان خود نسبت به آنها ستم روا داشتهاند.
|
||||
<span style="color:#f00">بحثهای مذهبی و اعتقادی و ارجاع توهینآمیز نسبت به بزرگان ادیان و همینطور بحثهای قومیتی و توهین به فرهنگها و قومیتها و زبانها و بحثهای مرتبط با سیاست روز از مصادیق حاشیههای نامناسب محسوب میشوند.</span> لطفاً از هیچ قوم و مذهبی با صفات زننده صحبت نکنید و به خاطر داشته باشید که همهٔ اقوام (حتی ایرانیها) در مقاطعی از تاریخ خود نسبت به اقوام دیگر بدوی محسوب میشدهاند یا با تعدی به خاک همسایگان خود نسبت به آنها ستم روا داشتهاند.
|
||||
</p>
|
||||
<p>
|
||||
<span style="color:#0a0">لطفاً در صورتی که تفاوتها را با استناد به نسخههای چاپی یا خطی گزارش میکنید این مسئله را با ذکر منبع مطرح نمایید. اشتباهات تایپی و غلطهای املایی را از طریق دکمهٔ «ویرایش» تصحیح کنید.</span>
|
||||
|
||||
@ -881,6 +881,32 @@ namespace RMuseum.Controllers
|
||||
return Ok(res.Result.Items);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effective corrections for poem
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="paging"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
[HttpGet]
|
||||
[Route("poem/{id}/corrections/effective")]
|
||||
[AllowAnonymous]
|
||||
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable<GanjoorPoemCorrectionViewModel>))]
|
||||
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
|
||||
[ProducesResponseType((int)HttpStatusCode.NotFound)]
|
||||
public async Task<IActionResult> GetPoemEffectiveCorrections(int id,[FromQuery] PagingParameterModel paging)
|
||||
{
|
||||
var res =
|
||||
await _ganjoorService.GetPoemEffectiveCorrections(id, paging);
|
||||
|
||||
// Paging Header
|
||||
HttpContext.Response.Headers.Add("paging-headers", JsonConvert.SerializeObject(res.Result.PagingMeta));
|
||||
|
||||
if (!string.IsNullOrEmpty(res.ExceptionString))
|
||||
return BadRequest(res.ExceptionString);
|
||||
return Ok(res.Result.Items);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get correction by id
|
||||
/// </summary>
|
||||
|
||||
@ -942,6 +942,14 @@
|
||||
<param name="paging"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.GanjoorController.GetPoemEffectiveCorrections(System.Int32,RSecurityBackend.Models.Generic.PagingParameterModel)">
|
||||
<summary>
|
||||
effective corrections for poem
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="paging"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Controllers.GanjoorController.GetCorrectionById(System.Int32)">
|
||||
<summary>
|
||||
get correction by id
|
||||
@ -7701,6 +7709,14 @@
|
||||
<param name="paging"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IGanjoorService.GetPoemEffectiveCorrections(System.Int32,RSecurityBackend.Models.Generic.PagingParameterModel)">
|
||||
<summary>
|
||||
effective corrections for poem
|
||||
</summary>
|
||||
<param name="poemId"></param>
|
||||
<param name="paging"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.IGanjoorService.GetCorrectionById(System.Int32)">
|
||||
<summary>
|
||||
get correction by id
|
||||
@ -9350,6 +9366,14 @@
|
||||
<param name="paging"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.Implementation.GanjoorService.GetPoemEffectiveCorrections(System.Int32,RSecurityBackend.Models.Generic.PagingParameterModel)">
|
||||
<summary>
|
||||
effective corrections for poem
|
||||
</summary>
|
||||
<param name="poemId"></param>
|
||||
<param name="paging"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:RMuseum.Services.Implementation.GanjoorService.GetCorrectionById(System.Int32)">
|
||||
<summary>
|
||||
get correction by id
|
||||
|
||||
@ -160,6 +160,14 @@ namespace RMuseum.Services
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<(PaginationMetadata PagingMeta, GanjoorPoemCorrectionViewModel[] Items)>> GetUserCorrections(Guid userId, PagingParameterModel paging);
|
||||
|
||||
/// <summary>
|
||||
/// effective corrections for poem
|
||||
/// </summary>
|
||||
/// <param name="poemId"></param>
|
||||
/// <param name="paging"></param>
|
||||
/// <returns></returns>
|
||||
Task<RServiceResult<(PaginationMetadata PagingMeta, GanjoorPoemCorrectionViewModel[] Items)>> GetPoemEffectiveCorrections(int poemId, PagingParameterModel paging);
|
||||
|
||||
/// <summary>
|
||||
/// get correction by id
|
||||
/// </summary>
|
||||
|
||||
@ -1458,6 +1458,63 @@ namespace RMuseum.Services.Implementation
|
||||
((dbPaginatedResult.PagingMeta, list.ToArray()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effective corrections for poem
|
||||
/// </summary>
|
||||
/// <param name="poemId"></param>
|
||||
/// <param name="paging"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<RServiceResult<(PaginationMetadata PagingMeta, GanjoorPoemCorrectionViewModel[] Items)>> GetPoemEffectiveCorrections(int poemId, PagingParameterModel paging)
|
||||
{
|
||||
var source = from dbCorrection in
|
||||
_context.GanjoorPoemCorrections.AsNoTracking().Include(c => c.VerseOrderText)
|
||||
where
|
||||
dbCorrection.PoemId == poemId
|
||||
&&
|
||||
dbCorrection.Reviewed == true
|
||||
&&
|
||||
(
|
||||
dbCorrection.Result == CorrectionReviewResult.Approved || dbCorrection.RhythmResult == CorrectionReviewResult.Approved
|
||||
||
|
||||
dbCorrection.VerseOrderText.Any(v => v.Result == CorrectionReviewResult.Approved)
|
||||
)
|
||||
orderby dbCorrection.Id descending
|
||||
select
|
||||
dbCorrection;
|
||||
|
||||
(PaginationMetadata PagingMeta, GanjoorPoemCorrection[] Items) dbPaginatedResult =
|
||||
await QueryablePaginator<GanjoorPoemCorrection>.Paginate(source, paging);
|
||||
|
||||
List<GanjoorPoemCorrectionViewModel> list = new List<GanjoorPoemCorrectionViewModel>();
|
||||
foreach (var dbCorrection in dbPaginatedResult.Items)
|
||||
{
|
||||
list.Add
|
||||
(
|
||||
new GanjoorPoemCorrectionViewModel()
|
||||
{
|
||||
Id = dbCorrection.Id,
|
||||
PoemId = dbCorrection.PoemId,
|
||||
UserId = dbCorrection.UserId,
|
||||
VerseOrderText = dbCorrection.VerseOrderText == null ? null : dbCorrection.VerseOrderText.ToArray(),
|
||||
Title = dbCorrection.Title,
|
||||
OriginalTitle = dbCorrection.OriginalTitle,
|
||||
Rhythm = dbCorrection.Rhythm,
|
||||
OriginalRhythm = dbCorrection.OriginalRhythm,
|
||||
Note = dbCorrection.Note,
|
||||
Date = dbCorrection.Date,
|
||||
Reviewed = dbCorrection.Reviewed,
|
||||
Result = dbCorrection.Result,
|
||||
RhythmResult = dbCorrection.RhythmResult,
|
||||
ReviewNote = dbCorrection.ReviewNote,
|
||||
ReviewDate = dbCorrection.ReviewDate,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return new RServiceResult<(PaginationMetadata, GanjoorPoemCorrectionViewModel[])>
|
||||
((dbPaginatedResult.PagingMeta, list.ToArray()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get correction by id
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user