diff --git a/RMuseum/DbContext/RMuseumDbContext.cs b/RMuseum/DbContext/RMuseumDbContext.cs index 7c0a34d2..10bc68bf 100644 --- a/RMuseum/DbContext/RMuseumDbContext.cs +++ b/RMuseum/DbContext/RMuseumDbContext.cs @@ -12,6 +12,7 @@ using RSecurityBackend.DbContext; using RSecurityBackend.Models.Auth.Db; using System; using Dapper; +using RMuseum.Models.Ganjoor; namespace RMuseum.DbContext { @@ -149,5 +150,25 @@ namespace RMuseum.DbContext /// public DbSet UserNarrationProfiles { get; set; } + /// + /// Ganjoor Poets + /// + public DbSet GanjoorPoets { get; set; } + + /// + /// Ganjoor Categories + /// + public DbSet GanjoorCategories { get; set; } + + /// + /// Ganjoor Poems + /// + public DbSet GanjoorPoems { get; set; } + + /// + /// Ganjoor Verses + /// + public DbSet GanjoorVerses { get; set; } + } } diff --git a/RMuseum/Models/Ganjoor/GanjoorCat.cs b/RMuseum/Models/Ganjoor/GanjoorCat.cs new file mode 100644 index 00000000..4ca25bb0 --- /dev/null +++ b/RMuseum/Models/Ganjoor/GanjoorCat.cs @@ -0,0 +1,47 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace RMuseum.Models.Ganjoor +{ + /// + /// Ganjoor Category + /// + public class GanjoorCat + { + /// + /// id + /// + [Key, DatabaseGenerated(DatabaseGeneratedOption.None)] + public int Id { get; set; } + + /// + /// poet_id + /// + public int PoetId { get; set; } + + /// + /// poet + /// + public GanjoorPoet Poet { get; set; } + + /// + /// text + /// + public string Title { get; set; } + + /// + /// parent_id + /// + public int? ParentId { get; set; } + + /// + /// parent + /// + public virtual GanjoorCat Parent { get; set; } + + /// + /// url => slug + /// + public string UrlSlug { get; set; } + } +} diff --git a/RMuseum/Models/Ganjoor/GanjoorPoem.cs b/RMuseum/Models/Ganjoor/GanjoorPoem.cs new file mode 100644 index 00000000..946287c8 --- /dev/null +++ b/RMuseum/Models/Ganjoor/GanjoorPoem.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace RMuseum.Models.Ganjoor +{ + /// + /// Ganjoor Poem + /// + public class GanjoorPoem + { + /// + /// id + /// + [Key, DatabaseGenerated(DatabaseGeneratedOption.None)] + public int Id { get; set; } + + /// + /// cat-id + /// + public int CatId { get; set; } + + /// + /// cat + /// + public GanjoorCat Cat { get; set; } + + /// + /// title + /// + public string Title { get; set; } + + /// + /// cat + parent cats title + title + /// + public string FullTitle { get; set; } + + /// + /// url => slug + /// + public string UrlSlug { get; set; } + } +} diff --git a/RMuseum/Models/Ganjoor/GanjoorPoet.cs b/RMuseum/Models/Ganjoor/GanjoorPoet.cs new file mode 100644 index 00000000..bf2526bb --- /dev/null +++ b/RMuseum/Models/Ganjoor/GanjoorPoet.cs @@ -0,0 +1,32 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace RMuseum.Models.Ganjoor +{ + /// + /// Ganjoor Poet + /// + /// + /// cat_id field is removed, it is retrievable by querying + /// where == and + /// == null + /// + public class GanjoorPoet + { + /// + /// id + /// + [Key, DatabaseGenerated(DatabaseGeneratedOption.None)] + public int Id { get; set; } + + /// + /// name + /// + public string Name { get; set; } + + /// + /// description + /// + public string Description { get; set; } + } +} diff --git a/RMuseum/Models/Ganjoor/GanjoorVerse.cs b/RMuseum/Models/Ganjoor/GanjoorVerse.cs new file mode 100644 index 00000000..59529575 --- /dev/null +++ b/RMuseum/Models/Ganjoor/GanjoorVerse.cs @@ -0,0 +1,38 @@ +namespace RMuseum.Models.Ganjoor +{ + /// + /// Ganjoor Verse + /// + public class GanjoorVerse + { + /// + /// global id, auto generated (missing in Ganjoor Desktop database) + /// + public int Id { get; set; } + + /// + /// poem_id + /// + public int PoemId { get; set; } + + /// + /// poem + /// + public GanjoorPoem Poem { get; set; } + + /// + /// vorder + /// + public int VOrder { get; set; } + + /// + /// position + /// + public VersePosition VersePosition { get; set; } + + /// + /// text + /// + public string Text { get; set; } + } +} diff --git a/RMuseum/Models/Ganjoor/VersePosition.cs b/RMuseum/Models/Ganjoor/VersePosition.cs new file mode 100644 index 00000000..1bdc9913 --- /dev/null +++ b/RMuseum/Models/Ganjoor/VersePosition.cs @@ -0,0 +1,36 @@ +namespace RMuseum.Models.Ganjoor +{ + /// + /// معنی فیلد position در جدول verse با توجه به مقادیر این ساختار داده مشخص می شود. + /// + /// + /// imported from Desktop Ganjoor source + /// + public enum VersePosition + { + /// + /// First Verse in a normal Beyt + /// + Right = 0,//مصرع اول + /// + /// Second Verse in a normal Beyt + /// + Left = 1,// مصرع دوم + /// + /// First Verse or the only one in a Band Beyt + /// + CenteredVerse1 = 2,// مصرع اول یا تنهای ابیات ترجیع یا ترکیب + /// + /// Second Verse in a Band Beyt + /// + CenteredVerse2 = 3,// مصرع دوم ابیات ترجیع یا ترکیب + /// + /// Free form verse + /// + Single = 4, //مصرعهای شعرهای نیمایی یا آزاد + /// + /// Non-poem paragraph + /// + Paragraph = -1, //نثر + } +} diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml index 54f02dc3..e90ae0d0 100644 --- a/RMuseum/RMuseum.xml +++ b/RMuseum/RMuseum.xml @@ -902,6 +902,26 @@ User Narration Profiles + + + Ganjoor Poets + + + + + Ganjoor Categories + + + + + Ganjoor Poems + + + + + Ganjoor Verses + + Items or pictures status @@ -2716,6 +2736,179 @@ Captcha Value + + + Ganjoor Category + + + + + id + + + + + poet_id + + + + + poet + + + + + text + + + + + parent_id + + + + + parent + + + + + url => slug + + + + + Ganjoor Poem + + + + + id + + + + + cat-id + + + + + cat + + + + + title + + + + + cat + parent cats title + title + + + + + url => slug + + + + + Ganjoor Poet + + + cat_id field is removed, it is retrievable by querying + where == and + == null + + + + + id + + + + + name + + + + + description + + + + + Ganjoor Verse + + + + + global id, auto generated (missing in Ganjoor Desktop database) + + + + + poem_id + + + + + poem + + + + + vorder + + + + + position + + + + + text + + + + + معنی فیلد position در جدول verse با توجه به مقادیر این ساختار داده مشخص می شود. + + + imported from Desktop Ganjoor source + + + + + First Verse in a normal Beyt + + + + + Second Verse in a normal Beyt + + + + + First Verse or the only one in a Band Beyt + + + + + Second Verse in a Band Beyt + + + + + Free form verse + + + + + Non-poem paragraph + + Import Job