#59 GanjoorPage: index for FullUrl

This commit is contained in:
Hamid Reza Mohammadi 2021-01-07 18:22:32 +03:30
parent 8952cbdeea
commit 7af46975e3
6 changed files with 1781 additions and 4 deletions

View File

@ -130,7 +130,7 @@ namespace RMuseum.Controllers
/// page by url
/// </summary>
/// <param name="url"></param>
/// <param name="poems"></param>
/// <param name="catPoems"></param>
/// <returns></returns>
[HttpGet]
[Route("page")]
@ -138,7 +138,7 @@ namespace RMuseum.Controllers
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(GanjoorPageCompleteViewModel))]
[ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public async Task<IActionResult> GetPageByUrl(string url, bool catPoems = true)
public async Task<IActionResult> GetPageByUrl(string url, bool catPoems = false)
{
RServiceResult<GanjoorPageCompleteViewModel> res =
await _ganjoorService.GetPageByUrl(url, catPoems);

View File

@ -80,6 +80,9 @@ namespace RMuseum.DbContext
builder.Entity<GanjoorPoem>()
.HasIndex(c => c.FullUrl);
builder.Entity<GanjoorPage>()
.HasIndex(c => c.FullUrl);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace RMuseum.Migrations
{
public partial class GanjoorPageFullUrlIndex : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "FullUrl",
table: "GanjoorPages",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.CreateIndex(
name: "IX_GanjoorPages_FullUrl",
table: "GanjoorPages",
column: "FullUrl");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_GanjoorPages_FullUrl",
table: "GanjoorPages");
migrationBuilder.AlterColumn<string>(
name: "FullUrl",
table: "GanjoorPages",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldNullable: true);
}
}
}

View File

@ -379,7 +379,7 @@ namespace RMuseum.Migrations
.HasColumnType("nvarchar(max)");
b.Property<string>("FullUrl")
.HasColumnType("nvarchar(max)");
.HasColumnType("nvarchar(450)");
b.Property<int>("GanjoorPageType")
.HasColumnType("int");
@ -418,6 +418,8 @@ namespace RMuseum.Migrations
b.HasIndex("CatId");
b.HasIndex("FullUrl");
b.HasIndex("ParentId");
b.HasIndex("PoemId");

View File

@ -658,7 +658,7 @@
page by url
</summary>
<param name="url"></param>
<param name="poems"></param>
<param name="catPoems"></param>
<returns></returns>
</member>
<member name="M:RMuseum.Controllers.GanjoorController.GetPoemById(System.Int32,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean)">