#59 GanjoorPage: index for FullUrl
This commit is contained in:
parent
8952cbdeea
commit
7af46975e3
@ -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);
|
||||
|
||||
@ -80,6 +80,9 @@ namespace RMuseum.DbContext
|
||||
builder.Entity<GanjoorPoem>()
|
||||
.HasIndex(c => c.FullUrl);
|
||||
|
||||
builder.Entity<GanjoorPage>()
|
||||
.HasIndex(c => c.FullUrl);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
1734
RMuseum/Migrations/20210107144826_GanjoorPageFullUrlIndex.Designer.cs
generated
Normal file
1734
RMuseum/Migrations/20210107144826_GanjoorPageFullUrlIndex.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
38
RMuseum/Migrations/20210107144826_GanjoorPageFullUrlIndex.cs
Normal file
38
RMuseum/Migrations/20210107144826_GanjoorPageFullUrlIndex.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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");
|
||||
|
||||
@ -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)">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user