seed/data Seeder Blogs
This commit is contained in:
parent
7c9934f56e
commit
3db82df964
6 changed files with 149 additions and 192 deletions
|
|
@ -1169,7 +1169,7 @@ soneklerini alır.
|
|||
| **Public › Home / About / Services / Contact** | `App.Home` · `App.About` · `App.Services` · `App.Contact` — `/admin/public/{ad}/designer` | `Sas_H_Home` · `Sas_H_About` · `Sas_H_Service` · `Sas_H_Contact` | host | Genel siteye açık sayfalar; tasarımcıdan düzenlenir. Public sayfa isteği kod değil bu tasarımcıdır. |
|
||||
| **Public › Products / Payment Methods / Installment Options** | `App.Orders.Products` · `.PaymentMethods` · `.InstallmentOptions` | `Sas_H_Product` · `Sas_H_PaymentMethod` · `Sas_H_InstallmentOption` | host | Ürün, ödeme yöntemi (`Commission`), taksit — satış/abonelik ekranlarının lookup kaynağı. |
|
||||
| **Public › Sales Orders** | `App.Orders.SalesOrders` | `Sas_H_Order` + `Sas_H_OrderItem` | host | **Onay akışı + alt kalem + toplam + diyalog** birlikte kullanılan tam örnek (§12.6). |
|
||||
| **Public › Blog Category / Posts** | `App.BlogManagement.Category` · `.Posts` | `Sas_H_BlogCategory` · `Sas_H_BlogPost` | host | Çok dilli içerik (`ContentTr`/`ContentEn`), slug, yayın durumu, sayaç alanları. |
|
||||
| **Public › Blog Category / Posts** | `App.BlogManagement.Category` · `.Posts` | `Sas_H_BlogCategory` · `Sas_H_BlogPost` | host | Çok dilli içerik (`ContentTr`/`ContentEn`), slug, yayın durumu, sayaç alanları. Veri `configs/seeds/host/data/App.BlogManagement.Category.json` ve `App.BlogManagement.Posts.json` dosyalarından seed edilir. |
|
||||
| **Public › Demos** | `App.Demos` | `Sas_H_Demo` | host | Siteden gelen demo talepleri — public form → tablo akışının örneği. |
|
||||
| **Dev Requests** | `App.DevRequests` | `Sas_H_DevRequest` | host | **Kanban/Todo düzeninin** referansı: `Status`, `Priority`, `SortOrder`, `Tags`, `Assignees`, `SubTasks`, `Timesheets`. |
|
||||
| **Setting Definitions** | `App.SettingDefinitions` | `Sas_H_SettingDefinition` | host | Yeni uygulama ayarı: `Code`, `MainGroupKey`/`SubGroupKey`, `DataType`, `SelectOptions`, `DefaultValue`, `Providers`, `RequiredPermissionName`, `IsEncrypted`, `IsVisibleToClients`. Ayarlanabilir olması gereken değeri koda gömme. |
|
||||
|
|
|
|||
|
|
@ -8917,6 +8917,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
ColumnOptionJson = DefaultColumnOptionJson(),
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.BlogCategory)),
|
||||
SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName),
|
||||
SeedSyncInsert = false,
|
||||
SeedSyncUpdate = false,
|
||||
SeedSyncDelete = false,
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 550, true, true, true, true, false),
|
||||
|
|
@ -9135,6 +9139,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
ColumnOptionJson = DefaultColumnOptionJson(),
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.BlogPost)),
|
||||
SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName),
|
||||
SeedSyncInsert = false,
|
||||
SeedSyncUpdate = false,
|
||||
SeedSyncDelete = false,
|
||||
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(),
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 1000, 700, true, true, true, true, false),
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -41,8 +41,6 @@ public class TenantSeederDto
|
|||
public List<ServiceSeedDto> Services { get; set; }
|
||||
public List<PaymentMethodSeedDto> PaymentMethods { get; set; }
|
||||
public List<InstallmentOptionSeedDto> InstallmentOptions { get; set; }
|
||||
public List<BlogCategorySeedDto> BlogCategories { get; set; }
|
||||
public List<BlogPostSeedDto> BlogPosts { get; set; }
|
||||
public List<ProductSeedDto> Products { get; set; }
|
||||
public List<ContactSeedDto> Contacts { get; set; }
|
||||
|
||||
|
|
@ -271,30 +269,6 @@ public class SkillLevelSeedDto
|
|||
public string SkillTypeName { get; set; }
|
||||
}
|
||||
|
||||
public class BlogCategorySeedDto
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Slug { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int DisplayOrder { get; set; }
|
||||
public int PostCount { get; set; }
|
||||
}
|
||||
|
||||
public class BlogPostSeedDto
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string Slug { get; set; }
|
||||
public string ContentTr { get; set; }
|
||||
public string ContentEn { get; set; }
|
||||
public string ReadTime { get; set; }
|
||||
public string Summary { get; set; }
|
||||
public string CoverImage { get; set; }
|
||||
public string CategoryName { get; set; }
|
||||
public string Author { get; set; }
|
||||
public bool IsPublished { get; set; }
|
||||
public DateTime PublishedAt { get; set; }
|
||||
}
|
||||
|
||||
public class ForumCategorySeedDto
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
|
@ -465,8 +439,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
private readonly IRepository<PaymentMethod, Guid> _paymentMethodRepository;
|
||||
private readonly IRepository<InstallmentOption, Guid> _installmentOptionRepository;
|
||||
private readonly IRepository<Service, Guid> _servicesRepository;
|
||||
private readonly IRepository<BlogCategory, Guid> _blogCategoryRepository;
|
||||
private readonly IRepository<BlogPost, Guid> _blogPostsRepository;
|
||||
private readonly IRepository<Contact, Guid> _contactRepository;
|
||||
private readonly IRepository<SkillType, string> _skillTypeRepository;
|
||||
private readonly IRepository<Skill, string> _skillRepository;
|
||||
|
|
@ -514,8 +486,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
IRepository<Product, Guid> productRepository,
|
||||
IRepository<PaymentMethod, Guid> paymentMethodRepository,
|
||||
IRepository<InstallmentOption, Guid> installmentOptionRepository,
|
||||
IRepository<BlogCategory, Guid> blogCategoryRepository,
|
||||
IRepository<BlogPost, Guid> blogPostsRepository,
|
||||
IRepository<Contact, Guid> contactRepository,
|
||||
IRepository<WorkHour, Guid> workHourRepository,
|
||||
IRepository<ForumCategory, Guid> forumCategoryRepository,
|
||||
|
|
@ -546,8 +516,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
_skillTypeRepository = skillTypeRepository;
|
||||
_skillRepository = skillRepository;
|
||||
_skillLevelRepository = skillLevelRepository;
|
||||
_blogCategoryRepository = blogCategoryRepository;
|
||||
_blogPostsRepository = blogPostsRepository;
|
||||
_customEndpointRepository = customEndpointRepository;
|
||||
_productRepository = productRepository;
|
||||
_paymentMethodRepository = paymentMethodRepository;
|
||||
|
|
@ -886,53 +854,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
}
|
||||
}
|
||||
|
||||
foreach (var item in items.BlogCategories)
|
||||
{
|
||||
var exists = await _blogCategoryRepository.AnyAsync(x => x.Name == item.Name);
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
var newCategory = new BlogCategory
|
||||
{
|
||||
Name = item.Name,
|
||||
Slug = item.Slug,
|
||||
Description = item.Description,
|
||||
DisplayOrder = item.DisplayOrder,
|
||||
PostCount = item.PostCount
|
||||
};
|
||||
|
||||
await _blogCategoryRepository.InsertAsync(newCategory, autoSave: true);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in items.BlogPosts)
|
||||
{
|
||||
var exists = await _blogPostsRepository.AnyAsync(x => x.Title == item.Title);
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
var category = await _blogCategoryRepository.FirstOrDefaultAsync(x => x.Name == item.CategoryName);
|
||||
|
||||
if (category != null)
|
||||
{
|
||||
await _blogPostsRepository.InsertAsync(new BlogPost
|
||||
{
|
||||
Title = item.Title,
|
||||
Slug = item.Slug,
|
||||
ContentTr = item.ContentTr,
|
||||
ContentEn = item.ContentEn,
|
||||
Summary = item.Summary,
|
||||
CoverImage = item.CoverImage,
|
||||
ReadTime = item.ReadTime,
|
||||
CategoryId = category.Id,
|
||||
Author = item.Author,
|
||||
IsPublished = true,
|
||||
PublishedAt = DateTime.Now
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in items.ReportTemplates)
|
||||
{
|
||||
var exists = await _reportTemplatesRepository.AnyAsync(x => x.Name == item.Name);
|
||||
|
|
|
|||
61
configs/seeds/host/data/App.BlogManagement.Category.json
Normal file
61
configs/seeds/host/data/App.BlogManagement.Category.json
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"ListFormCode": "App.BlogManagement.Category",
|
||||
"KeyFieldName": "Id",
|
||||
"GeneratedAt": "2026-09-04T00:00:00Z",
|
||||
"Rows": [
|
||||
{
|
||||
"Id": "20294789-3472-5326-843d-4c80a9a0b740",
|
||||
"Name": "App.BlogCategories.Technology",
|
||||
"Slug": "ai-ve-gelecegi",
|
||||
"Description": "App.PostsAi.Excerpt",
|
||||
"Icon": "",
|
||||
"DisplayOrder": 1,
|
||||
"IsActive": true
|
||||
},
|
||||
{
|
||||
"Id": "29997b64-a21d-5e04-a392-d6246c6cf766",
|
||||
"Name": "App.BlogCategories.Webdev",
|
||||
"Slug": "web-gelistirmede-son-trendler",
|
||||
"Description": "App.PostsWeb.Excerpt",
|
||||
"Icon": "",
|
||||
"DisplayOrder": 2,
|
||||
"IsActive": true
|
||||
},
|
||||
{
|
||||
"Id": "748a96c1-eba8-53a7-9c3d-7317f12ec627",
|
||||
"Name": "App.BlogCategories.Security",
|
||||
"Slug": "siber-guvenlik-tehditleri-ve-korunma-yollari",
|
||||
"Description": "App.PostsSecurity.Excerpt",
|
||||
"Icon": "",
|
||||
"DisplayOrder": 3,
|
||||
"IsActive": true
|
||||
},
|
||||
{
|
||||
"Id": "f282699d-8dda-5d0a-bd11-9e9b40a10161",
|
||||
"Name": "App.BlogCategories.Mobile",
|
||||
"Slug": "mobil-uygulama-gelistirmede-cross-platform-cozumler",
|
||||
"Description": "App.PostsMobile.Excerpt",
|
||||
"Icon": "",
|
||||
"DisplayOrder": 4,
|
||||
"IsActive": true
|
||||
},
|
||||
{
|
||||
"Id": "63dcbcec-e47f-5859-9de0-5bd46106ffb5",
|
||||
"Name": "App.BlogCategories.Database",
|
||||
"Slug": "veritabani-yonetim-sistemleri-karsilastirmasi",
|
||||
"Description": "App.PostsDatabase.Excerpt",
|
||||
"Icon": "",
|
||||
"DisplayOrder": 5,
|
||||
"IsActive": true
|
||||
},
|
||||
{
|
||||
"Id": "89a1ed95-dbf9-54f1-a5a8-41dddae7a9d2",
|
||||
"Name": "App.BlogCategories.Digital",
|
||||
"Slug": "dijital-pazarlamada-veri-analizi",
|
||||
"Description": "App.PostsDigital.Excerpt",
|
||||
"Icon": "",
|
||||
"DisplayOrder": 6,
|
||||
"IsActive": true
|
||||
}
|
||||
]
|
||||
}
|
||||
79
configs/seeds/host/data/App.BlogManagement.Posts.json
Normal file
79
configs/seeds/host/data/App.BlogManagement.Posts.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue