32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using Apimanager_backend.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Apimanager_backend.Data
|
|
{
|
|
public class SystemConfigConfig : IEntityTypeConfiguration<SystemConfig>
|
|
{
|
|
public void Configure(EntityTypeBuilder<SystemConfig> builder)
|
|
{
|
|
//主键
|
|
builder.HasKey(x => x.Id);
|
|
//自增
|
|
builder.Property(x => x.Id)
|
|
.ValueGeneratedOnAdd();
|
|
builder.HasData(
|
|
new SystemConfig(1,"SystemName", "青蓝"),
|
|
new SystemConfig(2,"SystemDescription", "描述"),
|
|
new SystemConfig(3,"LogoLocation", ""),
|
|
new SystemConfig(4,"FaviconLocation", ""),
|
|
new SystemConfig(5,"Phone","13000000000"),
|
|
new SystemConfig(6,"Email","admin@admin.com"),
|
|
new SystemConfig(
|
|
7,"RegisterConfig", JsonConvert.SerializeObject(new {RegisterOn = true,Emailvalidate = true })
|
|
)
|
|
|
|
);
|
|
}
|
|
}
|
|
}
|