feat : add slug to blog and products , refactor domain project
parent
f19c76066c
commit
f880d72d07
|
@ -17,7 +17,7 @@
|
|||
"TaxesFee": 9
|
||||
},
|
||||
"SiteSettings": {
|
||||
"BaseUrl": "http://localhost:32770",
|
||||
"BaseUrl": "http://192.168.1.12:32770",
|
||||
"WebSiteUrl": "https://hamyanedalat.com",
|
||||
"AdminPanelBaseUrl": "https://admin.hamyanedalat.com",
|
||||
"StorageBaseUrl": "https://storage.hamyanedalat.com",
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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,5 @@
|
|||
using Netina.Domain.Enums;
|
||||
using System.Web;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
namespace Netina.Domain.Entities.Blogs;
|
||||
|
||||
|
@ -6,9 +7,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 = HttpUtility.UrlEncode(title.Replace(' ', '-'));
|
||||
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 = HttpUtility.UrlEncode(title.Replace(' ', '-'));
|
||||
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);
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Brands;
|
||||
namespace Netina.Domain.Entities.Brands;
|
||||
|
||||
public partial class Brand
|
||||
{
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.ProductCategories;
|
||||
namespace Netina.Domain.Entities.ProductCategories;
|
||||
|
||||
public partial class ProductCategory
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
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)]
|
||||
|
|
|
@ -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,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
using System.Web;
|
||||
|
||||
namespace Netina.Domain.Entities.Products;
|
||||
|
||||
|
@ -14,9 +14,11 @@ public partial class Product
|
|||
Guid brandId,
|
||||
Guid categoryId)
|
||||
{
|
||||
var slug = HttpUtility.UrlEncode(persianName.Replace(' ', '-'));
|
||||
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)]
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using Netina.Domain.Enums;
|
||||
|
||||
namespace Netina.Domain.Entities.Users;
|
||||
namespace Netina.Domain.Entities.Users;
|
||||
|
||||
[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.Users;
|
||||
namespace Netina.Domain.Entities.Users;
|
||||
|
||||
[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.Users;
|
||||
namespace Netina.Domain.Entities.Users;
|
||||
|
||||
[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.Users;
|
||||
namespace Netina.Domain.Entities.Users;
|
||||
|
||||
[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)]
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue