most mivan
This commit is contained in:
parent
0dd529e36d
commit
5970cfb0a0
|
|
@ -32,6 +32,7 @@ public static class AuctionDefaults
|
|||
public static string TestPageRouteName => "Plugin.Misc.AuctionPlugin.TestPage";
|
||||
public static string BidNotificationRouteName => "Plugin.Misc.AuctionPlugin.BidNotification";
|
||||
public static string RefreshAuctionWidgetRouteName => "Plugin.Misc.AuctionPlugin.RefreshAuctionWidget";
|
||||
public static string AssignProductToAuction => "Plugin.Misc.AuctionPlugin.AssignProductToAuction";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of autosuggest component
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@ namespace Nop.Plugin.Misc.AuctionPlugin.Infrastructure
|
|||
endpointRouteBuilder.MapControllerRoute(name: AuctionDefaults.RefreshAuctionWidgetRouteName,
|
||||
pattern: "Auction/RefreshAuctionWidget",
|
||||
defaults: new { controller = "Auction", action = "RefreshAuctionWidget" });
|
||||
|
||||
endpointRouteBuilder.MapControllerRoute(name: AuctionDefaults.AssignProductToAuction,
|
||||
pattern: "Admin/Auction/AssignProductToAuction",
|
||||
defaults: new { controller = "AuctionPluginAdmin", action = "AssignProductToAuction" });
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class ProductToAuctionMappingBuilder : NopEntityBuilder<ProductToAuctionM
|
|||
/// <param name="table">Create table expression builder</param>
|
||||
public override void MapEntity(CreateTableExpressionBuilder table)
|
||||
{
|
||||
table.WithColumn(nameof(ProductToAuctionMapping.Id)).AsInt32().PrimaryKey()
|
||||
table.WithColumn(nameof(ProductToAuctionMapping.Id)).AsInt32().PrimaryKey().Identity()
|
||||
|
||||
.WithColumn(nameof(ProductToAuctionMapping.AuctionId)).AsInt32().ForeignKey<Auction>(onDelete: Rule.None) //Rule.Cascade??
|
||||
.WithColumn(nameof(ProductToAuctionMapping.ProductId)).AsInt32().ForeignKey<Product>(onDelete: Rule.None) //Rule.Cascade??
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Nop.Plugin.Misc.AuctionPlugin.Models
|
||||
{
|
||||
public class AssignAuctionRequestModel
|
||||
{
|
||||
|
||||
public string ProductId { get; set; }
|
||||
public string StartingPrice { get; set; }
|
||||
public string BidPrice { get; set; }
|
||||
public string AuctionId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using Nop.Core;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Domains;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Dtos;
|
||||
using Nop.Plugin.Misc.AuctionPlugin.Domains.Entities;
|
||||
|
||||
namespace Nop.Plugin.Misc.AuctionPlugin.Services;
|
||||
|
|
@ -34,5 +35,13 @@ public interface IAuctionService
|
|||
|
||||
Task<IList<Auction>> GetAllAuctionsAsync();
|
||||
|
||||
Task<bool> AssignProductToAuctionAsync(int productId, int auctionId);
|
||||
Task<AuctionDto> GetAuctionDtoByIdAsync(int auctionId);
|
||||
|
||||
Task<AuctionDto> GetAuctionDtoWithProductByIdAsync(int auctionId, int productId);
|
||||
|
||||
Task<ProductToAuctionDto> GetProductToAuctionDtoByIdAsync(int productToAuctionId);
|
||||
|
||||
Task<AuctionBidDto> GetAuctionBidDtoByIdAsync(int auctionBidId);
|
||||
|
||||
Task<bool> AssignProductToAuctionAsync(int productId, decimal startingPrice, decimal bidPrice, int auctionId);
|
||||
}
|
||||
Loading…
Reference in New Issue