Compare commits
No commits in common. "314aaaa08add881ef9aebc7467499a72816f1b1f" and "c47129487120ae006b15cea2e21d4cdf7c3b0243" have entirely different histories.
314aaaa08a
...
c471294871
|
|
@ -9,7 +9,6 @@ using Nop.Web.Areas.Admin.Controllers;
|
||||||
using Nop.Web.Framework.Mvc;
|
using Nop.Web.Framework.Mvc;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Controllers
|
namespace Nop.Plugin.Misc.AuctionPlugin.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -72,7 +71,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Controllers
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
Announcement objOfAnnouncementDomain = new Announcement();
|
AnnouncementEntity objOfAnnouncementDomain = new AnnouncementEntity();
|
||||||
|
|
||||||
objOfAnnouncementDomain.Name = viewModel.Name;
|
objOfAnnouncementDomain.Name = viewModel.Name;
|
||||||
|
|
||||||
|
|
@ -80,7 +79,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Controllers
|
||||||
|
|
||||||
objOfAnnouncementDomain.IsActive = viewModel.IsActive;
|
objOfAnnouncementDomain.IsActive = viewModel.IsActive;
|
||||||
|
|
||||||
objOfAnnouncementDomain.Created = DateTime.UtcNow;
|
objOfAnnouncementDomain.CreateDate = DateTime.UtcNow;
|
||||||
|
|
||||||
await _announcementService.InsertAsync(objOfAnnouncementDomain);
|
await _announcementService.InsertAsync(objOfAnnouncementDomain);
|
||||||
|
|
||||||
|
|
@ -99,7 +98,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IActionResult> Edit(Announcement model)
|
public async Task<IActionResult> Edit(AnnouncementEntity model)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -111,7 +110,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Controllers
|
||||||
|
|
||||||
entity.IsActive = model.IsActive;
|
entity.IsActive = model.IsActive;
|
||||||
|
|
||||||
entity.Created = DateTime.UtcNow;
|
entity.CreateDate = DateTime.UtcNow;
|
||||||
|
|
||||||
await _announcementService.UpdateAsync(entity);
|
await _announcementService.UpdateAsync(entity);
|
||||||
|
|
||||||
|
|
@ -135,7 +134,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Controllers
|
||||||
|
|
||||||
var singleAnnouncement = await _announcementService.GetAnnouncementByIdAsync(Id);
|
var singleAnnouncement = await _announcementService.GetAnnouncementByIdAsync(Id);
|
||||||
|
|
||||||
var model = new Announcement();
|
var model = new AnnouncementEntity();
|
||||||
|
|
||||||
model.Id = singleAnnouncement.Id;
|
model.Id = singleAnnouncement.Id;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
using AyCode.Core.Extensions;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Services;
|
|
||||||
using Nop.Web.Areas.Admin.Controllers;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Controllers;
|
|
||||||
|
|
||||||
public class AuctionController(AuctionService _auctionService) : BaseAdminController
|
|
||||||
{
|
|
||||||
// GET
|
|
||||||
public IActionResult Index()
|
|
||||||
{
|
|
||||||
//var a = new Auction();
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
using Nop.Core;
|
||||||
|
|
||||||
|
namespace Nop.Plugin.Misc.AuctionPlugin.Domains
|
||||||
|
{
|
||||||
|
|
||||||
|
public class AnnouncementEntity : BaseEntity
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string Body { get; set; }
|
||||||
|
|
||||||
|
public bool IsActive { get; set; }
|
||||||
|
|
||||||
|
public DateTime CreateDate { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
using Nop.Core;
|
||||||
|
|
||||||
|
namespace Nop.Plugin.Misc.AuctionPlugin.Domains
|
||||||
|
{
|
||||||
|
|
||||||
|
public class BidEntity : BaseEntity
|
||||||
|
{
|
||||||
|
public int CustomerId { get; set; }
|
||||||
|
|
||||||
|
public int ProductId { get; set; }
|
||||||
|
|
||||||
|
public bool IsWinner { get; set; }
|
||||||
|
public int Value { get; set; }
|
||||||
|
|
||||||
|
public DateTime CreateDate { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
using AyCode.Interfaces.Entities;
|
|
||||||
using AyCode.Interfaces.TimeStampInfo;
|
|
||||||
using Nop.Core;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.Entities
|
|
||||||
{
|
|
||||||
|
|
||||||
public class Announcement : BaseEntity, IEntityInt, ITimeStampCreated
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
public string Body { get; set; }
|
|
||||||
|
|
||||||
public bool IsActive { get; set; }
|
|
||||||
|
|
||||||
public DateTime Created { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
using AyCode.Interfaces.Entities;
|
|
||||||
using AyCode.Interfaces.TimeStampInfo;
|
|
||||||
using Nop.Core;
|
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Enums;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
public class Auction: BaseEntity, IEntityInt, ITimeStampInfo
|
|
||||||
{
|
|
||||||
public string AuctionName { get; set; }
|
|
||||||
public AuctionType AuctionType{ get; set; }
|
|
||||||
|
|
||||||
public DateTime StartDateUtc { get; set; }
|
|
||||||
public DateTime? EndDateUtc { get; set; }
|
|
||||||
|
|
||||||
public bool Closed { get; set; }
|
|
||||||
|
|
||||||
public DateTime Created { get; set; }
|
|
||||||
public DateTime Modified { get; set; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
using AyCode.Interfaces.Entities;
|
|
||||||
using AyCode.Interfaces.TimeStampInfo;
|
|
||||||
using Nop.Core;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.Entities
|
|
||||||
{
|
|
||||||
public class AuctionBid : BaseEntity, IEntityInt, ITimeStampInfo
|
|
||||||
{
|
|
||||||
public int CustomerId { get; set; }
|
|
||||||
|
|
||||||
public int ProductId { get; set; }
|
|
||||||
|
|
||||||
public bool IsWinner { get; set; }
|
|
||||||
public int BidPrice { get; set; }
|
|
||||||
|
|
||||||
public DateTime CreateDate { get; set; }
|
|
||||||
|
|
||||||
public DateTime Created { get; set; }
|
|
||||||
public DateTime Modified { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
using AyCode.Interfaces.Entities;
|
|
||||||
using AyCode.Interfaces.TimeStampInfo;
|
|
||||||
using Nop.Core;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
public class AuctionItem : BaseEntity, IEntityInt, ITimeStampInfo
|
|
||||||
{
|
|
||||||
public DateTime Created { get; set; }
|
|
||||||
public DateTime Modified { get; set; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
using AyCode.Interfaces.Entities;
|
|
||||||
using AyCode.Interfaces.TimeStampInfo;
|
|
||||||
using Nop.Core;
|
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Enums;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
public class ProductToAuctionMapping : BaseEntity, IEntityInt, ITimeStampInfo
|
|
||||||
{
|
|
||||||
public int ProductId { get; set; }
|
|
||||||
public int AuctionId { get; set; }
|
|
||||||
|
|
||||||
public AuctionStatus AuctionStatus { get; set; } = AuctionStatus.None;
|
|
||||||
|
|
||||||
public int StartingPrice { get; set; }
|
|
||||||
public int BidPrice { get; set; }
|
|
||||||
|
|
||||||
public int BidAmount { get; set; } = 1;
|
|
||||||
public DateTime Created { get; set; }
|
|
||||||
public DateTime Modified { get; set; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.Enums;
|
|
||||||
|
|
||||||
public enum AuctionStatus : byte
|
|
||||||
{
|
|
||||||
None = 0,
|
|
||||||
Active = 5,
|
|
||||||
FirstWarning = 10,
|
|
||||||
SecondWarning = 15,
|
|
||||||
SoldOut = 20,
|
|
||||||
NotSold = 25
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Domains.Enums;
|
|
||||||
|
|
||||||
public enum AuctionType : byte
|
|
||||||
{
|
|
||||||
//TODO: átbeszélni és kitalálni - J.
|
|
||||||
Manual = 0,
|
|
||||||
AutomaticNext = 5,
|
|
||||||
}
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Infrastructure
|
||||||
|
|
||||||
//register services and interfaces
|
//register services and interfaces
|
||||||
services.AddScoped<IAnnouncementService, AnnouncementService>();
|
services.AddScoped<IAnnouncementService, AnnouncementService>();
|
||||||
services.AddScoped<IAuctionService, AuctionService>();
|
services.AddScoped<IBidService, BidService>();
|
||||||
services.AddScoped<EventConsumer>();
|
services.AddScoped<EventConsumer>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
using FluentMigrator.Builders.Create.Table;
|
using FluentMigrator.Builders.Create.Table;
|
||||||
using Nop.Data.Mapping.Builders;
|
using Nop.Data.Mapping.Builders;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Mapping;
|
namespace Nop.Plugin.Misc.AuctionPlugin.Mapping;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a pickup point entity builder
|
/// Represents a pickup point entity builder
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AnnouncementBuilder : NopEntityBuilder<Announcement>
|
public class AnnouncementBuilder : NopEntityBuilder<AnnouncementEntity>
|
||||||
{
|
{
|
||||||
#region Methods
|
#region Methods
|
||||||
|
|
||||||
|
|
@ -18,16 +17,16 @@ public class AnnouncementBuilder : NopEntityBuilder<Announcement>
|
||||||
/// <param name="table">Create table expression builder</param>
|
/// <param name="table">Create table expression builder</param>
|
||||||
public override void MapEntity(CreateTableExpressionBuilder table)
|
public override void MapEntity(CreateTableExpressionBuilder table)
|
||||||
{
|
{
|
||||||
table.WithColumn(nameof(Announcement.Id))
|
table.WithColumn(nameof(AnnouncementEntity.Id))
|
||||||
.AsInt16()
|
.AsInt16()
|
||||||
.NotNullable()
|
.NotNullable()
|
||||||
.WithColumn(nameof(Announcement.Name))
|
.WithColumn(nameof(AnnouncementEntity.Name))
|
||||||
.AsString(250)
|
.AsString(250)
|
||||||
.NotNullable()
|
.NotNullable()
|
||||||
.WithColumn(nameof(Announcement.IsActive))
|
.WithColumn(nameof(AnnouncementEntity.IsActive))
|
||||||
.AsBoolean()
|
.AsBoolean()
|
||||||
.NotNullable().WithDefault(0)
|
.NotNullable().WithDefault(0)
|
||||||
.WithColumn(nameof(Announcement.Body))
|
.WithColumn(nameof(AnnouncementEntity.Body))
|
||||||
.AsString(500)
|
.AsString(500)
|
||||||
.NotNullable();
|
.NotNullable();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
using FluentMigrator.Builders.Create.Table;
|
using FluentMigrator.Builders.Create.Table;
|
||||||
using Nop.Data.Mapping.Builders;
|
using Nop.Data.Mapping.Builders;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Mapping.Builders
|
namespace Nop.Plugin.Misc.AuctionPlugin.Mapping.Builders
|
||||||
{
|
{
|
||||||
public class PluginBuilder : NopEntityBuilder<AuctionBid>
|
public class PluginBuilder : NopEntityBuilder<BidEntity>
|
||||||
{
|
{
|
||||||
#region Methods
|
#region Methods
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
using Nop.Data.Extensions;
|
using Nop.Data.Extensions;
|
||||||
using Nop.Data.Migrations;
|
using Nop.Data.Migrations;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Migrations
|
namespace Nop.Plugin.Misc.AuctionPlugin.Migrations
|
||||||
{
|
{
|
||||||
|
|
@ -14,12 +13,8 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Migrations
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Up()
|
public override void Up()
|
||||||
{
|
{
|
||||||
Create.TableFor<Auction>();
|
Create.TableFor<BidEntity>();
|
||||||
//Create.TableFor<AuctionItem>();
|
Create.TableFor<AnnouncementEntity>();
|
||||||
Create.TableFor<ProductToAuctionMapping>();
|
|
||||||
Create.TableFor<AuctionBid>();
|
|
||||||
|
|
||||||
Create.TableFor<Announcement>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -60,11 +60,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\..\..\NopCommerce\Libraries\Nop.Core\Nop.Core.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\..\NopCommerce\Libraries\Nop.Data\Nop.Data.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\..\NopCommerce\Presentation\Nop.Web\Nop.Web.csproj" />
|
<ProjectReference Include="..\..\..\..\NopCommerce\Presentation\Nop.Web\Nop.Web.csproj" />
|
||||||
<ProjectReference Include="..\..\Libraries\Mango.Nop.Core\Mango.Nop.Core.csproj" />
|
|
||||||
<ProjectReference Include="..\..\Libraries\Mango.Nop.Services\Mango.Nop.Services.csproj" />
|
|
||||||
<ClearPluginAssemblies Include="$(MSBuildProjectDirectory)\..\..\..\..\NopCommerce\Build\ClearPluginAssemblies.proj" />
|
<ClearPluginAssemblies Include="$(MSBuildProjectDirectory)\..\..\..\..\NopCommerce\Build\ClearPluginAssemblies.proj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
@ -80,34 +76,6 @@
|
||||||
<Folder Include="Validators\" />
|
<Folder Include="Validators\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.10" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="AyCode.Core">
|
|
||||||
<HintPath>..\..\..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="AyCode.Core.Server">
|
|
||||||
<HintPath>..\..\..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Core.Server.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="AyCode.Entities">
|
|
||||||
<HintPath>..\..\..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="AyCode.Entities.Server">
|
|
||||||
<HintPath>..\..\..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Entities.Server.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="AyCode.Interfaces">
|
|
||||||
<HintPath>..\..\..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="AyCode.Interfaces.Server">
|
|
||||||
<HintPath>..\..\..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Interfaces.Server.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="AyCode.Utils">
|
|
||||||
<HintPath>..\..\..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\Debug\net8.0\AyCode.Utils.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<!-- This target execute after "Build" target -->
|
<!-- This target execute after "Build" target -->
|
||||||
<Target Name="NopTarget" AfterTargets="Build">
|
<Target Name="NopTarget" AfterTargets="Build">
|
||||||
<MSBuild Projects="@(ClearPluginAssemblies)" Properties="PluginPath=$(MSBuildProjectDirectory)\$(OutDir)" Targets="NopClear" />
|
<MSBuild Projects="@(ClearPluginAssemblies)" Properties="PluginPath=$(MSBuildProjectDirectory)\$(OutDir)" Targets="NopClear" />
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
||||||
{
|
{
|
||||||
|
|
@ -15,13 +14,13 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
||||||
{
|
{
|
||||||
#region Field
|
#region Field
|
||||||
|
|
||||||
private readonly IRepository<Announcement> _announcementRepository;
|
private readonly IRepository<AnnouncementEntity> _announcementRepository;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Ctr
|
#region Ctr
|
||||||
|
|
||||||
public AnnouncementService(IRepository<Announcement> announcementRepository)
|
public AnnouncementService(IRepository<AnnouncementEntity> announcementRepository)
|
||||||
{
|
{
|
||||||
|
|
||||||
_announcementRepository = announcementRepository;
|
_announcementRepository = announcementRepository;
|
||||||
|
|
@ -32,7 +31,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
||||||
|
|
||||||
#region Methods
|
#region Methods
|
||||||
|
|
||||||
public async Task DeleteAsync(Announcement announcement)
|
public async Task DeleteAsync(AnnouncementEntity announcement)
|
||||||
{
|
{
|
||||||
|
|
||||||
await _announcementRepository.DeleteAsync(announcement);
|
await _announcementRepository.DeleteAsync(announcement);
|
||||||
|
|
@ -41,7 +40,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<bool> UpdateAsync(Announcement announcement)
|
public async Task<bool> UpdateAsync(AnnouncementEntity announcement)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -58,7 +57,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task InsertAsync(Announcement announcement)
|
public async Task InsertAsync(AnnouncementEntity announcement)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -67,7 +66,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<IPagedList<Announcement>> GetAnnouncementsAsync(int pageIndex = 0, int pageSize = int.MaxValue)
|
public async Task<IPagedList<AnnouncementEntity>> GetAnnouncementsAsync(int pageIndex = 0, int pageSize = int.MaxValue)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -77,13 +76,13 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
||||||
|
|
||||||
var query2 = query.OrderBy(b => b.IsActive).ToList();
|
var query2 = query.OrderBy(b => b.IsActive).ToList();
|
||||||
|
|
||||||
var liveAnnouncementDomain = new PagedList<Announcement>(query2, pageIndex, pageSize);
|
var liveAnnouncementDomain = new PagedList<AnnouncementEntity>(query2, pageIndex, pageSize);
|
||||||
|
|
||||||
return liveAnnouncementDomain;
|
return liveAnnouncementDomain;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Announcement> GetAnnouncementDesignFirstAsync()
|
public async Task<AnnouncementEntity> GetAnnouncementDesignFirstAsync()
|
||||||
|
|
||||||
{
|
{
|
||||||
var result = await _announcementRepository.GetAllAsync(query =>
|
var result = await _announcementRepository.GetAllAsync(query =>
|
||||||
|
|
@ -106,7 +105,7 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Announcement> GetAnnouncementByIdAsync(int Id)
|
public async Task<AnnouncementEntity> GetAnnouncementByIdAsync(int Id)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,13 @@
|
||||||
using Nop.Core.Caching;
|
using Nop.Core.Caching;
|
||||||
using Nop.Data;
|
using Nop.Data;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Services;
|
namespace Nop.Plugin.Misc.AuctionPlugin.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Store pickup point service
|
/// Store pickup point service
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AuctionService : IAuctionService
|
public class BidService : IBidService
|
||||||
{
|
{
|
||||||
#region Constants
|
#region Constants
|
||||||
|
|
||||||
|
|
@ -26,7 +25,7 @@ public class AuctionService : IAuctionService
|
||||||
|
|
||||||
#region Fields
|
#region Fields
|
||||||
|
|
||||||
protected readonly IRepository<AuctionBid> _customerBidRepository;
|
protected readonly IRepository<BidEntity> _customerBidRepository;
|
||||||
protected readonly IShortTermCacheManager _shortTermCacheManager;
|
protected readonly IShortTermCacheManager _shortTermCacheManager;
|
||||||
protected readonly IStaticCacheManager _staticCacheManager;
|
protected readonly IStaticCacheManager _staticCacheManager;
|
||||||
|
|
||||||
|
|
@ -40,7 +39,7 @@ public class AuctionService : IAuctionService
|
||||||
/// <param name="customerBidRepository">Store pickup point repository</param>
|
/// <param name="customerBidRepository">Store pickup point repository</param>
|
||||||
/// <param name="shortTermCacheManager">Short term cache manager</param>
|
/// <param name="shortTermCacheManager">Short term cache manager</param>
|
||||||
/// <param name="staticCacheManager">Cache manager</param>
|
/// <param name="staticCacheManager">Cache manager</param>
|
||||||
public AuctionService(IRepository<AuctionBid> customerBidRepository,
|
public BidService(IRepository<BidEntity> customerBidRepository,
|
||||||
IShortTermCacheManager shortTermCacheManager,
|
IShortTermCacheManager shortTermCacheManager,
|
||||||
IStaticCacheManager staticCacheManager)
|
IStaticCacheManager staticCacheManager)
|
||||||
{
|
{
|
||||||
|
|
@ -63,9 +62,9 @@ public class AuctionService : IAuctionService
|
||||||
/// A task that represents the asynchronous operation
|
/// A task that represents the asynchronous operation
|
||||||
/// The task result contains the bids
|
/// The task result contains the bids
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public virtual async Task<IPagedList<AuctionBid>> GetAllBidsAsync(int customerId = 0, int pageIndex = 0, int pageSize = int.MaxValue)
|
public virtual async Task<IPagedList<BidEntity>> GetAllBidsAsync(int customerId = 0, int pageIndex = 0, int pageSize = int.MaxValue)
|
||||||
{
|
{
|
||||||
var rez = new List<AuctionBid>();
|
var rez = new List<BidEntity>();
|
||||||
//var rez = await _shortTermCacheManager.GetAsync(async () => await _customerBidRepository.GetAllAsync(query =>
|
//var rez = await _shortTermCacheManager.GetAsync(async () => await _customerBidRepository.GetAllAsync(query =>
|
||||||
//{
|
//{
|
||||||
// if (customerId > 0)
|
// if (customerId > 0)
|
||||||
|
|
@ -75,23 +74,23 @@ public class AuctionService : IAuctionService
|
||||||
// return query;
|
// return query;
|
||||||
//}), _pickupPointAllKey, customerId);
|
//}), _pickupPointAllKey, customerId);
|
||||||
|
|
||||||
return new PagedList<AuctionBid>(rez, pageIndex, pageSize);
|
return new PagedList<BidEntity>(rez, pageIndex, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task<AuctionBid> GetBidByIdAsync(int bidId)
|
public virtual async Task<BidEntity> GetBidByIdAsync(int bidId)
|
||||||
{
|
{
|
||||||
return await _customerBidRepository.GetByIdAsync(bidId);
|
return await _customerBidRepository.GetByIdAsync(bidId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task InsertBidAsync(AuctionBid auctionBid)
|
public virtual async Task InsertBidAsync(BidEntity bid)
|
||||||
{
|
{
|
||||||
await _customerBidRepository.InsertAsync(auctionBid, false);
|
await _customerBidRepository.InsertAsync(bid, false);
|
||||||
await _staticCacheManager.RemoveByPrefixAsync(AUCTION_PATTERN_KEY);
|
await _staticCacheManager.RemoveByPrefixAsync(AUCTION_PATTERN_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task UpdateBidAsync(AuctionBid auctionBid)
|
public virtual async Task UpdateBidAsync(BidEntity bid)
|
||||||
{
|
{
|
||||||
await _customerBidRepository.UpdateAsync(auctionBid, false);
|
await _customerBidRepository.UpdateAsync(bid, false);
|
||||||
await _staticCacheManager.RemoveByPrefixAsync(AUCTION_PATTERN_KEY);
|
await _staticCacheManager.RemoveByPrefixAsync(AUCTION_PATTERN_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,7 +99,7 @@ public class AuctionService : IAuctionService
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pickupPoint">Pickup point</param>
|
/// <param name="pickupPoint">Pickup point</param>
|
||||||
/// <returns>A task that represents the asynchronous operation</returns>
|
/// <returns>A task that represents the asynchronous operation</returns>
|
||||||
public virtual async Task DeleteBidAsync(AuctionBid pickupPoint)
|
public virtual async Task DeleteBidAsync(BidEntity pickupPoint)
|
||||||
{
|
{
|
||||||
await _customerBidRepository.DeleteAsync(pickupPoint, false);
|
await _customerBidRepository.DeleteAsync(pickupPoint, false);
|
||||||
await _staticCacheManager.RemoveByPrefixAsync(AUCTION_PATTERN_KEY);
|
await _staticCacheManager.RemoveByPrefixAsync(AUCTION_PATTERN_KEY);
|
||||||
|
|
@ -5,7 +5,6 @@ using Nop.Core;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
||||||
|
|
||||||
|
|
@ -14,17 +13,17 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Services
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
public Task DeleteAsync(Announcement announcement);
|
public Task DeleteAsync(AnnouncementEntity announcement);
|
||||||
|
|
||||||
public Task InsertAsync(Announcement announcement);
|
public Task InsertAsync(AnnouncementEntity announcement);
|
||||||
|
|
||||||
public Task<bool> UpdateAsync(Announcement announcement);
|
public Task<bool> UpdateAsync(AnnouncementEntity announcement);
|
||||||
|
|
||||||
public Task<IPagedList<Announcement>> GetAnnouncementsAsync(int pageIndex = 0, int pageSize = int.MaxValue);
|
public Task<IPagedList<AnnouncementEntity>> GetAnnouncementsAsync(int pageIndex = 0, int pageSize = int.MaxValue);
|
||||||
|
|
||||||
public Task<Announcement> GetAnnouncementDesignFirstAsync();
|
public Task<AnnouncementEntity> GetAnnouncementDesignFirstAsync();
|
||||||
|
|
||||||
public Task<Announcement> GetAnnouncementByIdAsync(int Id);
|
public Task<AnnouncementEntity> GetAnnouncementByIdAsync(int Id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
using Nop.Core;
|
using Nop.Core;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
||||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.AuctionPlugin.Services;
|
namespace Nop.Plugin.Misc.AuctionPlugin.Services;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Store pickup point service interface
|
/// Store pickup point service interface
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IAuctionService
|
public interface IBidService
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets all bids
|
/// Gets all bids
|
||||||
|
|
@ -19,17 +18,17 @@ public interface IAuctionService
|
||||||
/// A task that represents the asynchronous operation
|
/// A task that represents the asynchronous operation
|
||||||
/// The task result contains the bids
|
/// The task result contains the bids
|
||||||
/// </returns>
|
/// </returns>
|
||||||
Task<IPagedList<AuctionBid>> GetAllBidsAsync(int customerId = 0, int pageIndex = 0, int pageSize = int.MaxValue);
|
Task<IPagedList<BidEntity>> GetAllBidsAsync(int customerId = 0, int pageIndex = 0, int pageSize = int.MaxValue);
|
||||||
|
|
||||||
|
|
||||||
Task<AuctionBid> GetBidByIdAsync(int bidId);
|
Task<BidEntity> GetBidByIdAsync(int bidId);
|
||||||
|
|
||||||
|
|
||||||
Task InsertBidAsync(AuctionBid auctionBid);
|
Task InsertBidAsync(BidEntity bidEntity);
|
||||||
|
|
||||||
|
|
||||||
Task UpdateBidAsync(AuctionBid auctionBid);
|
Task UpdateBidAsync(BidEntity bid);
|
||||||
|
|
||||||
|
|
||||||
Task DeleteBidAsync(AuctionBid pickupPoint);
|
Task DeleteBidAsync(BidEntity pickupPoint);
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue