完成种子数据模块,完成服务替换模块

This commit is contained in:
橙子
2023-01-24 13:46:22 +08:00
parent aea8b55e82
commit 4ca7b2e023
17 changed files with 173 additions and 21 deletions

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Data.DataSeeds;
using Yi.Framework.Ddd.Repositories;
using Yi.Framework.Domain.School.Entities;
namespace Yi.Framework.Domain.School.DataSeeds
{
[AppService(typeof(IDataSeed))]
public class StudentDataSeed : AbstractDataSeed<StudentEntity>
{
public StudentDataSeed(IRepository<StudentEntity> repository) : base(repository)
{
}
public override List<StudentEntity> GetSeedData()
{
return new List<StudentEntity>() { new StudentEntity { Id = SnowflakeHelper.NextId, Name = "你好", Phone = "123", Height = 188, IsDeleted = false } ,
new StudentEntity { Id = SnowflakeHelper.NextId, Name = "你好1", Phone = "123", Height = 188, IsDeleted = false },
new StudentEntity { Id = SnowflakeHelper.NextId, Name = "你好2", Phone = "123", Height = 188, IsDeleted = false }
};
}
}
}

View File

@@ -84,3 +84,8 @@
2023:01:21-22:29:30本次运行启动时间为9099毫秒
2023:01:21-22:30:38本次运行启动时间为2136毫秒
2023:01:21-23:15:24本次运行启动时间为1944毫秒
2023:01:24-13:26:35本次运行启动时间为2712毫秒
2023:01:24-13:39:09本次运行启动时间为2031毫秒
2023:01:24-13:42:17本次运行启动时间为2087毫秒
2023:01:24-13:44:55本次运行启动时间为1877毫秒
2023:01:24-13:45:55本次运行启动时间为19905毫秒

View File

@@ -27,10 +27,14 @@
]
},
//授权
"JwtTokenOptions": {
"Audience": "yi",
"Issuer": "localhost:19002",
"Subject": "yiframwork",
"ExpSecond": 3600
}
},
//开启种子数据
"EnabledDataSeed": true
}