ql_apimanager_backend/Apimanager_backend/Data/PaymentConfigConfig.cs

23 lines
1.3 KiB
C#

using Apimanager_backend.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Apimanager_backend.Data
{
public class PaymentConfigConfig : IEntityTypeConfiguration<PaymentConfig>
{
public void Configure(EntityTypeBuilder<PaymentConfig> builder)
{
builder.HasKey(x => x.Id);
builder.Property(x => x.Id)
.ValueGeneratedOnAdd();
builder.HasData(
new PaymentConfig() { Id = 1, Method = PaymentType.AliPay,PayType = PayType.Official, AppId = "", SecretKey = "", PublicKey = "", NotifyUrl = "", GatewayUrl = "", IsEnabled = false },
new PaymentConfig() { Id = 2, Method = PaymentType.WxPay, PayType = PayType.Official, AppId = "", SecretKey = "", PublicKey = "", NotifyUrl = "", GatewayUrl = "", IsEnabled = false },
new PaymentConfig() { Id = 3, Method = PaymentType.QQPay, PayType = PayType.Official, AppId = "", SecretKey = "", PublicKey = "", NotifyUrl = "", GatewayUrl = "", IsEnabled = false },
new PaymentConfig() { Id = 4, Method = PaymentType.Bank, PayType = PayType.Official, AppId = "", SecretKey = "", PublicKey = "", NotifyUrl = "", GatewayUrl = "", IsEnabled = false }
);
}
}
}