Compare commits
2 Commits
f19c76066c
...
0249727d32
Author | SHA1 | Date |
---|---|---|
|
0249727d32 | |
|
f880d72d07 |
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"ConnectionStrings": {
|
||||
"PostgresServer": "User ID=postgres;Password=root;Host=localhost;Port=5432;Database=iGarsonDB;",
|
||||
"Postgres": "Host=pg-0;Username=vesmmehAgent;Password=g05CTjK358Vx3Eoc9satsWyVwo+15UmsA2dnCrZRUYh1pLTe;Database=NetinaShopDB;Application Name=NetinaShopApi",
|
||||
"MartenDB": "Host=pg-0;Username=vesmmehAgent;Password=g05CTjK358Vx3Eoc9satsWyVwo+15UmsA2dnCrZRUYh1pLTe;Database=NetinaShopMartenDB;"
|
||||
"Postgres": "Host=pg-0;Username=visabarterAgent;Password=xHTpBf4wC+bPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=HamyanDB;Application Name=HamyanApi",
|
||||
"MartenDB": "Host=pg-0;Username=visabarterAgent;Password=xHTpBf4wC+bPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=HamyanMartenDB;"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
|
@ -17,38 +17,38 @@
|
|||
"TaxesFee": 9
|
||||
},
|
||||
"SiteSettings": {
|
||||
"BaseUrl": "https://api.vesmeh.com",
|
||||
"WebSiteUrl": "https://vesmeh.com",
|
||||
"AdminPanelBaseUrl": "https://admin.vesmeh.com",
|
||||
"StorageBaseUrl": "https://storage.vesmeh.com",
|
||||
"BaseUrl": "https://api.hamyan.visabartar.com",
|
||||
"WebSiteUrl": "https://hamyan.visabartar.com",
|
||||
"AdminPanelBaseUrl": "https://admin.hamyan.visabartar.com",
|
||||
"StorageBaseUrl": "https://storage.visabartar.com",
|
||||
"KaveNegarApiKey": "3735494B4143727A794346457461576A2B4B6668414973424E333561505A694B",
|
||||
"UserSetting": {
|
||||
"Username": "09214802813",
|
||||
"Email": "avvampier@gmail.com",
|
||||
"Password": "eF79o4P4BopCUbUK",
|
||||
"Password": "2Tsr87RWRn5T",
|
||||
"Phone": "09214802813",
|
||||
"RoleName": "RootAdmin",
|
||||
"FirstName": "همه کاره",
|
||||
"LastName": "سیستم"
|
||||
},
|
||||
"Manager": {
|
||||
"Username": "09128387004",
|
||||
"Email": "mahanmasiha6@gmail.com",
|
||||
"Password": "eF79o4P4BopCUbUK",
|
||||
"Username": "09122171024",
|
||||
"Email": "kamran_mirzayi@gmail.com",
|
||||
"Password": "YAWEheKEi7gh",
|
||||
"Phone": "09128387004",
|
||||
"RoleName": "Manager",
|
||||
"FirstName": "ماهان",
|
||||
"LastName": ""
|
||||
"FirstName": "کامران",
|
||||
"LastName": "میرزایی"
|
||||
},
|
||||
"StorageSetting": {
|
||||
"AccessKey": "979313b7-30fb-40ff-94d8-d0390d3fa876",
|
||||
"SecretKey": "d37a1cc6acfea3a6f92c538ef0f6601f1edcdc9143942b6470e5d1032aa6bfe2",
|
||||
"BucketKey": "vesmeh-content"
|
||||
"AccessKey": "de129835-b43a-4552-8ed4-865e2635ab3d",
|
||||
"SecretKey": "f00197a766336e818023f90408ba3b88b4fdc86d0e7180f74f199d9f03db7575",
|
||||
"BucketKey": "hamyan-content"
|
||||
},
|
||||
"JwtSettings": {
|
||||
"SecretKey": "YAEMAMZAMAN_KHODET_NEGAHDAR_IN_KEY_BASH_nw+8E0EABj0Wg8c4mHg/bDBf5qGMhmBPb6u16DVe9/MzYva1e+/J1zImyIoQX2Lmra2kvzsIjGiwP7r3Znd_YA_JADE_NASABE_v+Ro/CDixScDv6EkpZnkBv9MFdPnSmFXNGMH9gA1BzQUoC1iSX9Aq+pMIw/cMKXI9WA==_YA_HUSEIN_SEYED_SHOHADA_BE_OMID_KHODET",
|
||||
"Issuer": "Brizco",
|
||||
"Audience": "Brizco",
|
||||
"SecretKey": "YAEMAMZAMAN_KHODET_NEGAHDAR_IN_KEY_BASH_Co0F8AlDfth0PmBuY/0xZQX25iKGQsro5HNkm+gGto4ijSm3hJQ7SViLmR2/BtHN_YA_JADE_NASABE_MSwIOzaxUqn8awSbMx02MSwIOzaxUqn8awSbMx02_EegU4lf9LB5LOyZWXLzLCyXtAp0moUh0_YA_HUSEIN_SEYED_SHOHADA_BE_OMID_KHODET",
|
||||
"Issuer": "Hamyan",
|
||||
"Audience": "Hamyan",
|
||||
"ExpireAddDay": "15"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -17,15 +17,15 @@
|
|||
"TaxesFee": 9
|
||||
},
|
||||
"SiteSettings": {
|
||||
"BaseUrl": "http://localhost:32770",
|
||||
"WebSiteUrl": "https://hamyanedalat.com",
|
||||
"AdminPanelBaseUrl": "https://admin.hamyanedalat.com",
|
||||
"StorageBaseUrl": "https://storage.hamyanedalat.com",
|
||||
"BaseUrl": "https://api.hamyan.visabartar.com",
|
||||
"WebSiteUrl": "https://hamyan.visabartar.com",
|
||||
"AdminPanelBaseUrl": "https://admin.hamyan.visabartar.com",
|
||||
"StorageBaseUrl": "https://storage.visabartar.com",
|
||||
"KaveNegarApiKey": "3735494B4143727A794346457461576A2B4B6668414973424E333561505A694B",
|
||||
"UserSetting": {
|
||||
"Username": "09214802813",
|
||||
"Email": "avvampier@gmail.com",
|
||||
"Password": "eF79o4P4BopCUbUK",
|
||||
"Password": "2Tsr87RWRn5T",
|
||||
"Phone": "09214802813",
|
||||
"RoleName": "RootAdmin",
|
||||
"FirstName": "همه کاره",
|
||||
|
@ -33,9 +33,9 @@
|
|||
},
|
||||
"Manager": {
|
||||
"Username": "09122171024",
|
||||
"Email": "info@hamyanedalat.com",
|
||||
"Password": "eF79o4P4BopCUbUK",
|
||||
"Phone": "09122171024",
|
||||
"Email": "kamran_mirzayi@gmail.com",
|
||||
"Password": "YAWEheKEi7gh",
|
||||
"Phone": "09128387004",
|
||||
"RoleName": "Manager",
|
||||
"FirstName": "کامران",
|
||||
"LastName": "میرزایی"
|
||||
|
@ -46,9 +46,9 @@
|
|||
"BucketKey": "hamyan-content"
|
||||
},
|
||||
"JwtSettings": {
|
||||
"SecretKey": "YAEMAMZAMAN_KHODET_NEGAHDAR_IN_KEY_BASH_nw+8E0EABj0Wg8c4mHg/bDBf5qGMhmBPb6u16DVe9/MzYva1e+/J1zImyIoQX2Lmra2kvzsIjGiwP7r3Znd_YA_JADE_NASABE_v+Ro/CDixScDv6EkpZnkBv9MFdPnSmFXNGMH9gA1BzQUoC1iSX9Aq+pMIw/cMKXI9WA==_YA_HUSEIN_SEYED_SHOHADA_BE_OMID_KHODET",
|
||||
"Issuer": "HamaynEdalat",
|
||||
"Audience": "HamaynEdalat",
|
||||
"SecretKey": "YAEMAMZAMAN_KHODET_NEGAHDAR_IN_KEY_BASH_Co0F8AlDfth0PmBuY/0xZQX25iKGQsro5HNkm+gGto4ijSm3hJQ7SViLmR2/BtHN_YA_JADE_NASABE_MSwIOzaxUqn8awSbMx02MSwIOzaxUqn8awSbMx02_EegU4lf9LB5LOyZWXLzLCyXtAp0moUh0_YA_HUSEIN_SEYED_SHOHADA_BE_OMID_KHODET",
|
||||
"Issuer": "Hamyan",
|
||||
"Audience": "Hamyan",
|
||||
"ExpireAddDay": "15"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"ConnectionStrings": {
|
||||
"PostgresServer": "User ID=postgres;Password=root;Host=localhost;Port=5432;Database=iGarsonDB;",
|
||||
"PostgresServer": "Host=185.220.227.88;Username=vesmmehAgent;Password=g05CTjK358Vx3Eoc9satsWyVwo+15UmsA2dnCrZRUYh1pLTe;Database=NetinaShopDB;Application Name=NetinaShopApi",
|
||||
"Postgres": "Host=pg-0,pg-1;Username=igarsonAgent;Password=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=NetinaShopDB;Load Balance Hosts=true;Target Session Attributes=primary;Application Name=iGLS",
|
||||
"MartenDB": "Host=pg-0,pg-1;Username=igarsonAgent;Password=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=NetinaShopMartenDB;"
|
||||
},
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Blogs;
|
||||
using Netina.Domain.Models.Claims;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
using Netina.Domain.Entities.Blogs;
|
||||
|
||||
namespace Netina.Api.Controller;
|
||||
|
||||
|
@ -41,7 +37,7 @@ public class BlogCategoryController : ICarterModule
|
|||
if (page != null)
|
||||
{
|
||||
return TypedResults.Ok(await repositoryWrapper.SetRepository<BlogCategory>().TableNoTracking
|
||||
.OrderByDescending(b => b.CreatedAt).Skip(page.Value * 10).Take(10)
|
||||
.OrderByDescending(b => b.Name).Skip(page.Value * 10).Take(10)
|
||||
.Select(BlogCategoryMapper.ProjectToSDto)
|
||||
.ToListAsync(cancellationToken));
|
||||
}
|
||||
|
@ -49,7 +45,7 @@ public class BlogCategoryController : ICarterModule
|
|||
{
|
||||
|
||||
return TypedResults.Ok(await repositoryWrapper.SetRepository<BlogCategory>().TableNoTracking
|
||||
.OrderByDescending(b => b.CreatedAt)
|
||||
.OrderByDescending(b => b.Name)
|
||||
.Select(BlogCategoryMapper.ProjectToSDto)
|
||||
.ToListAsync(cancellationToken));
|
||||
}
|
||||
|
|
|
@ -23,24 +23,27 @@ public class BlogController : ICarterModule
|
|||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapPost("", Post)
|
||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageBlogs))
|
||||
.RequireAuthorization(builder =>
|
||||
builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser()
|
||||
.RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageBlogs))
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapPut("", Put)
|
||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageBlogs))
|
||||
.RequireAuthorization(builder =>
|
||||
builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser()
|
||||
.RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageBlogs))
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapDelete("{id}", Delete)
|
||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser().RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageBlogs))
|
||||
.RequireAuthorization(builder =>
|
||||
builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser()
|
||||
.RequireClaim(CustomClaimType.Permission, ApplicationPermission.ManageBlogs))
|
||||
.HasApiVersion(1.0);
|
||||
}
|
||||
|
||||
// GET:Get All Entity
|
||||
public async Task<IResult> GetAllAsync([FromQuery] int page, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await repositoryWrapper.SetRepository<Blog>().TableNoTracking
|
||||
.OrderByDescending(b=>b.CreatedAt)
|
||||
.Skip(page*10).Take(10)
|
||||
.Select(BlogMapper.ProjectToSDto).ToListAsync(cancellationToken));
|
||||
public async Task<IResult> GetAllAsync([FromQuery] int page, [FromQuery] Guid? blogCategoryId, IMediator mediator, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await mediator.Send(new GetBlogsQuery(page, CategoryId: blogCategoryId), cancellationToken));
|
||||
|
||||
// GET:Get An Entity By Id
|
||||
public async Task<IResult> GetAsync(Guid id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
|
|
|
@ -34,7 +34,7 @@ public class SeedController : ICarterModule
|
|||
.WithDisplayName("SeedBlogsAsync")
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapPost("blog/categories", SeedBlogCategoriesAsync)
|
||||
group.MapPost("blog/categories", SeedBlogCategoriesSlugAsync)
|
||||
.WithDisplayName("SeedBlogCategoriesAsync")
|
||||
.HasApiVersion(1.0);
|
||||
}
|
||||
|
@ -105,7 +105,15 @@ public class SeedController : ICarterModule
|
|||
throw new AppException("Key is not valid", ApiResultStatusCode.UnAuthorized);
|
||||
foreach (var seedBlogRequestDto in request)
|
||||
{
|
||||
var ent = Blog.Create(seedBlogRequestDto.Title, seedBlogRequestDto.Content, seedBlogRequestDto.Tags, seedBlogRequestDto.ReadingTime,
|
||||
if (seedBlogRequestDto.CategoryId == default)
|
||||
{
|
||||
var noCategory = await repositoryWrapper.SetRepository<BlogCategory>()
|
||||
.TableNoTracking
|
||||
.FirstOrDefaultAsync(bc => bc.Name == "دسته بندی نشده", cancellationToken);
|
||||
if(noCategory != null)
|
||||
seedBlogRequestDto.CategoryId = noCategory.Id;
|
||||
}
|
||||
var ent = Blog.Create(seedBlogRequestDto.Title,seedBlogRequestDto.Slug, seedBlogRequestDto.Content, seedBlogRequestDto.Tags, seedBlogRequestDto.ReadingTime,
|
||||
seedBlogRequestDto.Summery, seedBlogRequestDto.IsSuggested, seedBlogRequestDto.CategoryId);
|
||||
|
||||
foreach (var storageFileSDto in seedBlogRequestDto.Files)
|
||||
|
@ -133,12 +141,34 @@ public class SeedController : ICarterModule
|
|||
categories.Add(0, baseCategory.Id);
|
||||
foreach (var requestDto in request)
|
||||
{
|
||||
var ent = BlogCategory.Create(requestDto.Name, requestDto.Description);
|
||||
var ent = BlogCategory.Create(requestDto.Name,requestDto.Slug, requestDto.Description);
|
||||
repositoryWrapper.SetRepository<BlogCategory>().Add(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
categories.Add(requestDto.BaseCategoryId, ent.Id);
|
||||
}
|
||||
|
||||
return TypedResults.Ok(categories);
|
||||
}
|
||||
public async Task<IResult> SeedBlogCategoriesSlugAsync([FromBody] List<SeedBlogCategoryRequestDto> request, [FromQuery] string key, [FromServices] IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
if (key != "kKAYskyG8xPxKnJrHkuYxub4Ao2bnz7AOmNtwDT0RaqzaG7ZvbvaP29tCrC8wJ823RczJFXOIQT2bDOec4F38A==")
|
||||
throw new AppException("Key is not valid", ApiResultStatusCode.UnAuthorized);
|
||||
|
||||
Dictionary<int, Guid> categories = new Dictionary<int, Guid>();
|
||||
foreach (var requestDto in request)
|
||||
{
|
||||
var ent = await repositoryWrapper.SetRepository<BlogCategory>()
|
||||
.TableNoTracking
|
||||
.FirstOrDefaultAsync(bc=>bc.Name==requestDto.Name,cancellationToken);
|
||||
if (ent == null)
|
||||
continue;
|
||||
ent.Slug = requestDto.Slug;
|
||||
repositoryWrapper.SetRepository<BlogCategory>().Update(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
categories.Add(requestDto.BaseCategoryId, ent.Id);
|
||||
}
|
||||
|
||||
return TypedResults.Ok(categories);
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.4" />
|
||||
|
||||
<PackageReference Include="Asp.Versioning.Http" Version="8.1.0" />
|
||||
<PackageReference Include="Ben.BlockingDetector" Version="0.0.4" />
|
||||
|
@ -19,25 +19,25 @@
|
|||
<PackageReference Include="FluentValidation" Version="11.9.0" />
|
||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.9.0" />
|
||||
<PackageReference Include="MediatR.Extensions.Autofac.DependencyInjection" Version="12.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.3" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.3">
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.3">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Autofac" Version="8.0.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
|
||||
<PackageReference Include="Elmah.Io.AspNetCore.Serilog" Version="5.0.17" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
|
||||
<PackageReference Include="Sentry.Serilog" Version="4.2.1" />
|
||||
<PackageReference Include="Sentry.Serilog" Version="4.4.0" />
|
||||
<PackageReference Include="Serilog" Version="3.1.1" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
|
||||
|
@ -52,7 +52,7 @@
|
|||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.1" />
|
||||
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="8.0.3" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="8.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -6,7 +6,7 @@ builder.Host.UseSerilog();
|
|||
LoggerConfig.ConfigureSerilog();
|
||||
string env = builder.Environment.IsDevelopment() == true ? "Development" : "Production";
|
||||
builder.Host.UseContentRoot(Directory.GetCurrentDirectory());
|
||||
string projectName = "Hamyan";
|
||||
string projectName = "Vesmeh";
|
||||
if (builder.Environment.IsDevelopment())
|
||||
builder.Configuration.AddJsonFile($"AppSettings/appsettings.json").AddJsonFile($"AppSettings/appsettings.{env}{projectName}.json");
|
||||
|
||||
|
@ -17,7 +17,6 @@ var siteSetting = configuration.GetSection(nameof(SiteSettings)).Get<SiteSetting
|
|||
builder.Services.Configure<SiteSettings>(configuration.GetSection(nameof(SiteSettings)));
|
||||
|
||||
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddControllers();
|
||||
|
|
|
@ -1,14 +1,29 @@
|
|||
using Marten;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Domain.Models.Settings;
|
||||
using Netina.Repository.Extensions;
|
||||
using Netina.Repository.Models;
|
||||
using Autofac.Extras.Quartz;
|
||||
using Marten;
|
||||
using System.Collections.Specialized;
|
||||
using Netina.Core.QuartzServices;
|
||||
using Weasel.Core;
|
||||
|
||||
namespace Netina.Api.WebFramework.Configurations;
|
||||
|
||||
public static class ServiceExtensions
|
||||
{
|
||||
public static void AddSchedulerToAutoFac(this ContainerBuilder builder)
|
||||
{
|
||||
// configure and register Quartz
|
||||
var schedulerConfig = new NameValueCollection {
|
||||
{"quartz.threadPool.threadCount", "3"},
|
||||
{"quartz.scheduler.threadName", "BrizCo_Scheduler"}
|
||||
};
|
||||
|
||||
builder.RegisterModule(new QuartzAutofacFactoryModule
|
||||
{
|
||||
ConfigurationProvider = c => schedulerConfig
|
||||
});
|
||||
|
||||
builder.RegisterModule(new QuartzAutofacJobsModule(typeof(JobScheduler).Assembly));
|
||||
builder.RegisterType<JobScheduler>().AsSelf();
|
||||
}
|
||||
public static void AddIpRateLimit(this IServiceCollection services, IConfigurationRoot configuration)
|
||||
{
|
||||
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
namespace Netina.Common.Extensions
|
||||
using System.Web;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Netina.Common.Extensions
|
||||
{
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static string GetSlug(string title)
|
||||
{
|
||||
return HttpUtility.UrlEncode(title.Replace(' ', '-'));
|
||||
}
|
||||
public static string ToPriceWhitPriceType(this long price, string priceType)
|
||||
{
|
||||
return price.ToString("N0") + " " + priceType;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<PackageReference Include="MD.PersianDateTime.Standard" Version="2.5.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.4.1" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.5.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--<PropertyGroup>
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
using System.IO.Compression;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Core.Abstracts;
|
||||
using Netina.Core.BaseServices.Abstracts;
|
||||
using Netina.Core.Models;
|
||||
using Netina.Domain.Entities.Blogs;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Domain.Models.Settings;
|
||||
using Netina.Repository.Repositories.Base.Contracts;
|
||||
|
||||
namespace Netina.Core.BaseServices;
|
||||
|
||||
|
@ -190,7 +185,7 @@ public class SiteMapService : ISiteMapService
|
|||
foreach (var product in group)
|
||||
{
|
||||
|
||||
var productUrl = $"{_siteSetting.WebSiteUrl}/products/{product.Id}/{HttpUtility.UrlEncode(product.PersianName.Replace(' ', '-'))}";
|
||||
var productUrl = $"{_siteSetting.WebSiteUrl}/products/{product.Id}/{product.Slug}";
|
||||
XmlElement urlElement = doc.CreateElement("url", doc.DocumentElement?.NamespaceURI);
|
||||
root.AppendChild(urlElement);
|
||||
|
||||
|
@ -284,7 +279,7 @@ public class SiteMapService : ISiteMapService
|
|||
root.AppendChild(urlElement);
|
||||
|
||||
XmlElement loc = doc.CreateElement("loc", doc.DocumentElement?.NamespaceURI);
|
||||
loc.InnerText = Path.Combine(blog.Title);
|
||||
loc.InnerText = Path.Combine($"{_siteSetting.WebSiteUrl}/blogs/{blog.Id}/{blog.Slug}");
|
||||
urlElement.AppendChild(loc);
|
||||
|
||||
XmlElement lastmod = doc.CreateElement("lastmod", doc.DocumentElement?.NamespaceURI);
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
<PackageReference Include="AspNetCoreRateLimit.Redis" Version="2.0.0" />
|
||||
<PackageReference Include="Autofac.Extras.Quartz" Version="10.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.3" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
|
||||
<PackageReference Include="Quartz" Version="3.8.1" />
|
||||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="24.1.41" />
|
||||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="25.1.40" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
using Microsoft.Extensions.Logging;
|
||||
using Quartz;
|
||||
|
||||
namespace Netina.Core.QuartzServices;
|
||||
|
||||
public class JobScheduler
|
||||
{
|
||||
private readonly IScheduler _scheduler;
|
||||
private readonly ILogger<JobScheduler> _logger;
|
||||
|
||||
public JobScheduler(IScheduler scheduler, ILogger<JobScheduler> logger)
|
||||
{
|
||||
_scheduler = scheduler;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
_scheduler.Start();
|
||||
|
||||
IJobDetail job = JobBuilder.Create<SiteMapScheduledJob>()
|
||||
.WithIdentity("SiteMapJob", "admin")
|
||||
.Build();
|
||||
ITrigger trigger = TriggerBuilder.Create()
|
||||
.WithIdentity("SiteMapJobTrigger", "admin")
|
||||
.WithSchedule(CronScheduleBuilder.AtHourAndMinuteOnGivenDaysOfWeek(3, 0,
|
||||
DayOfWeek.Saturday,
|
||||
DayOfWeek.Sunday,
|
||||
DayOfWeek.Monday,
|
||||
DayOfWeek.Tuesday,
|
||||
DayOfWeek.Wednesday,
|
||||
DayOfWeek.Thursday,
|
||||
DayOfWeek.Friday))
|
||||
.StartNow()
|
||||
.Build();
|
||||
var offset = _scheduler.ScheduleJob(job, trigger);
|
||||
|
||||
|
||||
_logger.LogInformation($"======== Table Schedulers Set For {offset.Result.ToString()} IN {DateTime.Now.ToString()} ===========");
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
using Microsoft.Extensions.Logging;
|
||||
using Quartz;
|
||||
|
||||
namespace Netina.Core.QuartzServices;
|
||||
|
||||
public class SiteMapScheduledJob : IJob
|
||||
{
|
||||
private readonly ILogger<SiteMapScheduledJob> _logger;
|
||||
private readonly ISiteMapService _siteMapService;
|
||||
|
||||
public SiteMapScheduledJob(ILogger<SiteMapScheduledJob> logger,ISiteMapService siteMapService)
|
||||
{
|
||||
_logger = logger;
|
||||
_siteMapService = siteMapService;
|
||||
}
|
||||
|
||||
public async Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
await _siteMapService.CreateSiteMapAsync();
|
||||
_logger.LogInformation($"Site Map Job Done At : {DateTime.Now}");
|
||||
}
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateBrandCommand(string PersianName,string EnglishName, string Description , bool HasSpecialPage , string PageUrl, List<StorageFileSDto> Files) : IRequest<BrandSDto>;
|
||||
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateDiscountCommand(string Code,
|
||||
string Description,
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Netina.Domain.Dtos.RequestDtos;
|
||||
using Netina.Domain.Dtos.ResponseDtos;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateOrderCommand(string DiscountCode, List<OrderProductSDto> OrderProducts, OrderDeliverySDto OrderDelivery) : IRequest<OrderSDto>;
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateBaseOrderCommand(Guid UserId) : IRequest<Order>;
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateOrUpdatePaymentCommand(Guid? Id,string FactorNumber, double Amount, string Description, string TransactionCode, string CardPan, string Authority, PaymentType Type, PaymentStatus Status, Guid OrderId, Guid UserId) : IRequest<bool>;
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateProductCategoryCommand(
|
||||
string Name,
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateProductCommand(
|
||||
string PersianName,
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateReviewCommand(string Title, string Comment, float Rate, bool IsBuyer, Guid ProductId, Guid UserId) : IRequest<ReviewSDto>;
|
||||
public sealed record UpdateReviewCommand(Guid Id,string Title, string Comment, float Rate, bool IsBuyer, Guid ProductId, Guid UserId): IRequest<bool>;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
namespace Netina.Domain.CommandQueries.Commands;
|
||||
|
||||
public sealed record CreateShippingCommand (
|
||||
string Name,
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetAddressesQuery():IRequest<List<UserAddressSDto>>;
|
||||
public sealed record GetUserAddressesQuery(Guid? UserId) : IRequest<List<UserAddressSDto>>;
|
|
@ -0,0 +1,4 @@
|
|||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
|
||||
public record GetBlogsQuery(int Page, Guid? CategoryId) : IRequest<GetBlogsResponseDto>;
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public record GetBrandQuery(Guid Id) : IRequest<BrandLDto>;
|
||||
public record GetBrandsQuery(int? Page, string? BrandName , Guid CategoryId) : IRequest<List<BrandSDto>>;
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetDiscountQuery(Guid Id) : IRequest<DiscountLDto>;
|
||||
public sealed record GetDiscountsQuery(int Page = 0) : IRequest<List<DiscountSDto>>;
|
|
@ -1,5 +1,3 @@
|
|||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetNewsletterMembersQuery(int Page = 0) : IRequest<List<NewsletterMemberSDto>>;
|
|
@ -1,5 +1,3 @@
|
|||
using Netina.Domain.Entities.Orders;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public record GetUserOrderBagQuery() : IRequest<Order>;
|
|
@ -1,9 +1,4 @@
|
|||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetOrderLDtoQuery(Guid Id) : IRequest<OrderLDto>;
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetPaymentQuery(Guid Id = default , string? Authority = null) : IRequest<PaymentSDto>;
|
||||
public sealed record GetPaymentsQuery(int Page = 0) : IRequest<List<PaymentSDto>>;
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public record GetProductCategoryQuery(Guid Id) : IRequest<ProductCategoryLDto>;
|
||||
public record GetProductCategoriesQuery(int? Page , bool? SortByMain, string? CategoryName) : IRequest<List<ProductCategorySDto>>;
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Dtos.ResponseDtos;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
|
||||
public sealed record GetProductQuery(Guid Id) : IRequest<GetProductResponseDto>;
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Dtos.LargDtos;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public record GetReviewsQuery(int Page = 0) : IRequest<List<ReviewSDto>>;
|
||||
public record GetReviewQuery(Guid Id) : IRequest<ReviewLDto>;
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
namespace Netina.Domain.CommandQueries.Queries;
|
||||
|
||||
public sealed record GetShippingsQuery(int Page = 0) : IRequest<List<ShippingSDto>>;
|
||||
public sealed record GetShippingQuery(Guid Id) : IRequest<ShippingSDto>;
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.FilterDtos;
|
||||
namespace Netina.Domain.Dtos.FilterDtos;
|
||||
|
||||
public class BaseFilterDto
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.FilterDtos;
|
||||
namespace Netina.Domain.Dtos.FilterDtos;
|
||||
|
||||
public class ExpressDeliveryFilter : BaseFilterDto
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.FilterDtos;
|
||||
namespace Netina.Domain.Dtos.FilterDtos;
|
||||
|
||||
public class PriceFilterDto : BaseFilterDto
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Blogs;
|
||||
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
|
||||
public class BlogCategoryLDto : BaseDto<BlogCategoryLDto, BlogCategory>
|
||||
{
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Blogs;
|
||||
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
|
||||
public class BlogLDto : BaseDto<BlogLDto , Blog>
|
||||
{
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Content { get; set; } = string.Empty;
|
||||
public string Tags { get; set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public int ReadingTime { get; set; }
|
||||
public string Summery { get; set; } = string.Empty;
|
||||
public bool IsSuggested { get; set; }
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Brands;
|
||||
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
|
||||
public class BrandLDto : BaseDto<BrandLDto,Brand>
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Discounts;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
|
||||
public class DiscountLDto : BaseDto<DiscountLDto,Discount>
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
|
||||
public class ProductCategoryLDto : BaseDto<ProductCategoryLDto, ProductCategory>
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
using Netina.Domain.Entities.Products;
|
||||
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
|
||||
public class ProductLDto : BaseDto<ProductLDto,Product>
|
||||
{
|
||||
|
@ -11,6 +7,7 @@ public class ProductLDto : BaseDto<ProductLDto,Product>
|
|||
public string Summery { get; set; } = string.Empty;
|
||||
public string ExpertCheck { get; set; } = string.Empty;
|
||||
public string Tags { get; set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public string Warranty { get; set; } = string.Empty;
|
||||
public double CostWithDiscount { get; set; }
|
||||
public double DiscountPercent { get; set; }
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Products;
|
||||
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
namespace Netina.Domain.Dtos.LargDtos;
|
||||
|
||||
public class ReviewLDto : BaseDto<ReviewLDto,Review>
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@ public class SeedBlogRequestDto
|
|||
public string Summery { get; set; } = string.Empty;
|
||||
public bool IsSuggested { get; set; }
|
||||
public Guid CategoryId { get; set; }
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public List<StorageFileSDto> Files { get; set; } = new();
|
||||
}
|
||||
|
||||
|
@ -16,5 +17,6 @@ public class SeedBlogCategoryRequestDto
|
|||
{
|
||||
public int BaseCategoryId { get; set; }
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.RequestDtos;
|
||||
namespace Netina.Domain.Dtos.RequestDtos;
|
||||
|
||||
public class UserActionRequestDto
|
||||
{
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
namespace Netina.Domain.Dtos.ResponseDtos;
|
||||
|
||||
public class GetBlogsResponseDto
|
||||
{
|
||||
public List<BlogSDto> Blogs { get; set; } = new List<BlogSDto>();
|
||||
|
||||
public PagerResponseDto Pager { get; set; } = new PagerResponseDto();
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Dtos.LargDtos;
|
||||
|
||||
namespace Netina.Domain.Dtos.ResponseDtos;
|
||||
namespace Netina.Domain.Dtos.ResponseDtos;
|
||||
|
||||
public class GetProductResponseDto
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Netina.Domain.Dtos.FilterDtos;
|
||||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.Dtos.ResponseDtos;
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
namespace Netina.Domain.Dtos.ResponseDtos;
|
||||
namespace Netina.Domain.Dtos.ResponseDtos;
|
||||
|
||||
public class ProfileResponseDto
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.ResponseDtos;
|
||||
namespace Netina.Domain.Dtos.ResponseDtos;
|
||||
|
||||
public class VerifyCodeResponseDto
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Netina.Common.Extensions;
|
||||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class ApplicationUserSDto : BaseDto<ApplicationUserSDto, ApplicationUser>
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.MartenEntities.Pages;
|
||||
using Netina.Domain.MartenEntities.Pages;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Blogs;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class BlogCategorySDto : BaseDto<BlogCategorySDto , BlogCategory>
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public int BlogCount { get; set; }
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
|
@ -1,12 +1,9 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Blogs;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class BlogSDto : BaseDto<BlogSDto , Blog>
|
||||
{
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Content { get; set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public string Tags { get; set; } = string.Empty;
|
||||
public int ReadingTime { get; set; }
|
||||
public string Summery { get; set; } = string.Empty;
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Brands;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class BrandSDto : BaseDto<BrandSDto , Brand>
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Netina.Common.Extensions;
|
||||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class CustomerSDto : BaseDto<CustomerSDto, Customer>
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Discounts;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class DiscountSDto : BaseDto<DiscountSDto,Discount>
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Netina.Common.Extensions;
|
||||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class ManagerSDto : BaseDto<ManagerSDto, Manager>
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Netina.Common.Extensions;
|
||||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class MarketerSDto : BaseDto<MarketerSDto, Marketer>
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Users;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class NewsletterMemberSDto : BaseDto<NewsletterMemberSDto,NewsletterMember>
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class OrderDeliverySDto : BaseDto<OrderDeliverySDto, OrderDelivery>
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class OrderProductSDto : BaseDto<OrderProductSDto, OrderProduct>
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
public class OrderSDto : BaseDto<OrderSDto, Order>
|
||||
{
|
||||
public double TotalPrice { get; set; }
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class ProductCategorySDto : BaseDto<ProductCategorySDto , ProductCategory>
|
||||
{
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Products;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class ProductSDto : BaseDto<ProductSDto, Product>
|
||||
{
|
||||
|
||||
public string PersianName { get; set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public string EnglishName { get; set; } = string.Empty;
|
||||
public string Summery { get; set; } = string.Empty;
|
||||
public string ExpertCheck { get; set; } = string.Empty;
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Products;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class ReviewSDto : BaseDto<ReviewSDto, Review>
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Warehouses;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class ShippingSDto : BaseDto<ShippingSDto,Shipping>
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Products;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class SpecificationSDto : BaseDto<SpecificationSDto,Specification>
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Microsoft.IdentityModel.Tokens;
|
||||
using Netina.Common.Extensions;
|
||||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.StorageFiles;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Mapper;
|
||||
using Netina.Domain.Entities.Users;
|
||||
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
namespace Netina.Domain.Dtos.SmallDtos;
|
||||
|
||||
public class UserAddressSDto : BaseDto<UserAddressSDto,UserAddress>
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Accounting;
|
||||
namespace Netina.Domain.Entities.Accounting;
|
||||
|
||||
public partial class Payment
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Accounting;
|
||||
namespace Netina.Domain.Entities.Accounting;
|
||||
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
namespace Netina.Domain.Entities.Blogs;
|
||||
|
||||
|
@ -6,9 +6,16 @@ public partial class Blog
|
|||
{
|
||||
public static Blog Create(string title, string content, string tags, int readingTime, string summery, bool isSuggested, Guid categoryId)
|
||||
{
|
||||
return new Blog(title, content, tags, readingTime, summery, isSuggested, categoryId);
|
||||
var slug = StringExtensions.GetSlug(title);
|
||||
return new Blog(title, slug, content, tags, readingTime, summery, isSuggested, categoryId);
|
||||
}
|
||||
|
||||
public static Blog Create(string title, string slug, string content, string tags, int readingTime, string summery, bool isSuggested, Guid categoryId)
|
||||
{
|
||||
if (slug.IsNullOrEmpty())
|
||||
slug = StringExtensions.GetSlug(title);
|
||||
return new Blog(title, slug, content, tags, readingTime, summery, isSuggested, categoryId);
|
||||
}
|
||||
public BlogStorageFile AddFile(string name, string fileLocation, string fileName, bool isHeader, bool isPrimary, StorageFileType fileType)
|
||||
{
|
||||
var file = BlogStorageFile.Create(name, fileLocation, fileName, isHeader, isPrimary, fileType, this.Id);
|
||||
|
@ -27,8 +34,15 @@ public partial class BlogStorageFile
|
|||
|
||||
public partial class BlogCategory
|
||||
{
|
||||
public static BlogCategory Create(string name,string description)
|
||||
public static BlogCategory Create(string name, string description)
|
||||
{
|
||||
return new BlogCategory(name, description);
|
||||
var slug = StringExtensions.GetSlug(name);
|
||||
return new BlogCategory(name, slug, description);
|
||||
}
|
||||
public static BlogCategory Create(string name, string slug, string description)
|
||||
{
|
||||
if (slug.IsNullOrEmpty())
|
||||
slug = StringExtensions.GetSlug(name);
|
||||
return new BlogCategory(name, slug, description);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
|
||||
namespace Netina.Domain.Entities.Blogs;
|
||||
namespace Netina.Domain.Entities.Blogs;
|
||||
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||
|
@ -13,7 +11,7 @@ public partial class Blog : ApiEntity
|
|||
{
|
||||
|
||||
}
|
||||
public Blog(string title,string content,string tags, int readingTime,string summery, bool isSuggested, Guid categoryId)
|
||||
public Blog(string title,string slug,string content,string tags, int readingTime,string summery, bool isSuggested, Guid categoryId)
|
||||
{
|
||||
Title = title;
|
||||
Content = content;
|
||||
|
@ -22,9 +20,11 @@ public partial class Blog : ApiEntity
|
|||
Summery = summery;
|
||||
IsSuggested = isSuggested;
|
||||
CategoryId = categoryId;
|
||||
Slug = slug;
|
||||
}
|
||||
public string Title { get; internal set; } = string.Empty;
|
||||
public string Content { get; internal set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public string Tags { get; internal set; } = string.Empty;
|
||||
public int ReadingTime { get; internal set; }
|
||||
public string Summery { get; internal set; } = string.Empty;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
|
||||
namespace Netina.Domain.Entities.Blogs;
|
||||
namespace Netina.Domain.Entities.Blogs;
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||
|
@ -12,12 +10,14 @@ public partial class BlogCategory : ApiEntity
|
|||
|
||||
}
|
||||
|
||||
public BlogCategory(string name, string description)
|
||||
public BlogCategory(string name,string slug, string description)
|
||||
{
|
||||
Name = name;
|
||||
Slug = slug;
|
||||
Description = description;
|
||||
}
|
||||
public string Name { get; internal set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public string Description { get; internal set; } = string.Empty;
|
||||
public List<Blog> Blogs { get; internal set; } = new();
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Brands;
|
||||
namespace Netina.Domain.Entities.Brands;
|
||||
|
||||
public partial class Brand
|
||||
{
|
||||
public static Brand Create(string persianName, string englishName, string description, bool hasSpecialPage, string pageUrl)
|
||||
{
|
||||
return new Brand(persianName,englishName, description, hasSpecialPage, pageUrl);
|
||||
|
||||
var slug = StringExtensions.GetSlug(persianName);
|
||||
return new Brand(persianName, slug, englishName, description, hasSpecialPage, pageUrl);
|
||||
}
|
||||
|
||||
public BrandStorageFile AddFile(string name, string fileLocation, string fileName, bool isHeader, bool isPrimary, StorageFileType fileType)
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Entities.Products;
|
||||
|
||||
namespace Netina.Domain.Entities.Brands;
|
||||
namespace Netina.Domain.Entities.Brands;
|
||||
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||
|
@ -15,9 +12,10 @@ public partial class Brand : ApiEntity
|
|||
|
||||
}
|
||||
|
||||
public Brand(string persianName,string englishName, string description, bool hasSpecialPage, string pageUrl)
|
||||
public Brand(string persianName,string slug,string englishName, string description, bool hasSpecialPage, string pageUrl)
|
||||
{
|
||||
PersianName = persianName;
|
||||
Slug = slug;
|
||||
EnglishName = englishName;
|
||||
Description = description;
|
||||
HasSpecialPage = hasSpecialPage;
|
||||
|
@ -25,6 +23,7 @@ public partial class Brand : ApiEntity
|
|||
}
|
||||
public string PersianName { get; internal set; } = string.Empty;
|
||||
public string EnglishName { get; internal set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public string Description { get; internal set; } = string.Empty;
|
||||
public bool HasSpecialPage { get; internal set; }
|
||||
public string PageUrl { get; internal set; } = string.Empty;
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Entities.StorageFiles;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Brands;
|
||||
namespace Netina.Domain.Entities.Brands;
|
||||
|
||||
public partial class BrandStorageFile : StorageFile
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Entities.ProductCategories;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Discounts;
|
||||
namespace Netina.Domain.Entities.Discounts;
|
||||
|
||||
public partial class CategoryDiscount : Discount
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Discounts;
|
||||
namespace Netina.Domain.Entities.Discounts;
|
||||
|
||||
public partial class Discount
|
||||
{
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Discounts;
|
||||
namespace Netina.Domain.Entities.Discounts;
|
||||
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Discounts;
|
||||
namespace Netina.Domain.Entities.Discounts;
|
||||
|
||||
public partial class ProductDiscount : Discount
|
||||
{
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
using Netina.Common.Extensions;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Api;
|
||||
using Netina.Common.Models.Exception;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Orders;
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Entities.Accounting;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Domain.Enums;
|
||||
using Netina.Domain.Entities.Accounting;
|
||||
|
||||
namespace Netina.Domain.Entities.Orders;
|
||||
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Entities.Users;
|
||||
using Netina.Domain.Entities.Warehouses;
|
||||
|
||||
namespace Netina.Domain.Entities.Orders;
|
||||
namespace Netina.Domain.Entities.Orders;
|
||||
|
||||
public partial class OrderDelivery : ApiEntity
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Entities.Products;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Orders;
|
||||
namespace Netina.Domain.Entities.Orders;
|
||||
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
using System.Web;
|
||||
|
||||
namespace Netina.Domain.Entities.ProductCategories;
|
||||
|
||||
|
@ -6,7 +6,8 @@ public partial class ProductCategory
|
|||
{
|
||||
public static ProductCategory Create(string name, string description,bool isMain)
|
||||
{
|
||||
return new ProductCategory(name, description, isMain);
|
||||
var slug = StringExtensions.GetSlug(name);
|
||||
return new ProductCategory(name, slug, description, isMain);
|
||||
}
|
||||
|
||||
public void SetParent(Guid parentId)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Entities.Products;
|
||||
namespace Netina.Domain.Entities.ProductCategories;
|
||||
|
||||
namespace Netina.Domain.Entities.ProductCategories;
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||
|
@ -13,13 +11,15 @@ public partial class ProductCategory : ApiEntity
|
|||
|
||||
}
|
||||
|
||||
public ProductCategory(string name, string description,bool isMain)
|
||||
public ProductCategory(string name,string slug, string description,bool isMain)
|
||||
{
|
||||
Name = name;
|
||||
Slug = slug;
|
||||
Description = description;
|
||||
IsMain = isMain;
|
||||
}
|
||||
public string Name { get; internal set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public string Description { get; internal set; } = string.Empty;
|
||||
public bool IsMain { get; set; }
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Entities.StorageFiles;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.ProductCategories;
|
||||
namespace Netina.Domain.Entities.ProductCategories;
|
||||
|
||||
public partial class ProductCategoryStorageFile : StorageFile
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Netina.Domain.Enums;
|
||||
using System.Web;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Netina.Domain.Entities.Products;
|
||||
|
||||
|
@ -14,9 +15,11 @@ public partial class Product
|
|||
Guid brandId,
|
||||
Guid categoryId)
|
||||
{
|
||||
var slug = StringExtensions.GetSlug(persianName);
|
||||
return new Product(
|
||||
persianName,
|
||||
englishName,
|
||||
englishName,
|
||||
slug,
|
||||
summery,
|
||||
expertCheck,
|
||||
tags,
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Entities.Brands;
|
||||
using Netina.Domain.Entities.Orders;
|
||||
using Netina.Domain.Entities.ProductCategories;
|
||||
namespace Netina.Domain.Entities.Products;
|
||||
|
||||
namespace Netina.Domain.Entities.Products;
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget )]
|
||||
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||
|
@ -16,8 +12,10 @@ public partial class Product : ApiEntity
|
|||
|
||||
}
|
||||
|
||||
public Product(string persianName,
|
||||
public Product(
|
||||
string persianName,
|
||||
string englishName,
|
||||
string slug,
|
||||
string summery,
|
||||
string expertCheck,
|
||||
string tags,
|
||||
|
@ -34,6 +32,7 @@ public partial class Product : ApiEntity
|
|||
{
|
||||
PersianName = persianName;
|
||||
EnglishName = englishName;
|
||||
Slug = slug;
|
||||
Summery = summery;
|
||||
ExpertCheck = expertCheck;
|
||||
Tags = tags;
|
||||
|
@ -50,6 +49,7 @@ public partial class Product : ApiEntity
|
|||
}
|
||||
public string PersianName { get; internal set; } = string.Empty;
|
||||
public string EnglishName { get; internal set; } = string.Empty;
|
||||
public string Slug { get; set; } = string.Empty;
|
||||
public string Summery { get; internal set; } = string.Empty;
|
||||
public string ExpertCheck { get; internal set; } = string.Empty;
|
||||
public string Tags { get; internal set; } = string.Empty;
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Domain.Entities.StorageFiles;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Products;
|
||||
namespace Netina.Domain.Entities.Products;
|
||||
|
||||
public partial class ProductStorageFile : StorageFile
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Entities.Users;
|
||||
|
||||
namespace Netina.Domain.Entities.Products;
|
||||
namespace Netina.Domain.Entities.Products;
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
|
||||
namespace Netina.Domain.Entities.Products;
|
||||
namespace Netina.Domain.Entities.Products;
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.StorageFiles;
|
||||
namespace Netina.Domain.Entities.StorageFiles;
|
||||
|
||||
public partial class StorageFile
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using Netina.Common.Models.Entity;
|
||||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.StorageFiles;
|
||||
namespace Netina.Domain.Entities.StorageFiles;
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
|
||||
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue