feat:搭建积分领域

This commit is contained in:
陈淳
2024-01-11 18:51:53 +08:00
parent 3ee8419802
commit 5a65a2e49f
46 changed files with 466 additions and 80 deletions

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Yi.Framework.Bbs.Domain.Entities;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.Rbac.Domain.Entities;
using Yi.Framework.SqlSugarCore.Abstractions;

View File

@@ -0,0 +1,41 @@
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Yi.Framework.Bbs.Domain.Entities.Integral;
using Yi.Framework.SqlSugarCore.Abstractions;
namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
{
public class LevelDataSeed : IDataSeedContributor, ITransientDependency
{
private ISqlSugarRepository<LevelEntity> _repository;
public LevelDataSeed(ISqlSugarRepository<LevelEntity> repository)
{
_repository = repository;
}
public async Task SeedAsync(DataSeedContext context)
{
if (!await _repository.IsAnyAsync(x => true))
{
await _repository.InsertManyAsync(GetSeedData());
}
}
public List<LevelEntity> GetSeedData()
{
List<LevelEntity> entities = new List<LevelEntity>()
{
new LevelEntity(1,"小白",10),
new LevelEntity(2,"中白",30),
new LevelEntity(3,"大白",100),
new LevelEntity(4,"精英",300),
new LevelEntity(5,"熟练",600),
new LevelEntity(6,"高手",1000),
new LevelEntity(7,"老手",1500),
new LevelEntity(8,"大佬",2000),
new LevelEntity(9,"巨佬",2500),
new LevelEntity(10,"大神",3000),
};
return entities;
}
}
}

View File

@@ -1,6 +1,6 @@
using System.Linq.Expressions;
using Volo.Abp.DependencyInjection;
using Yi.Framework.Bbs.Domain.Entities;
using Yi.Framework.Bbs.Domain.Entities.Forum;
using Yi.Framework.Bbs.Domain.Repositories;
using Yi.Framework.SqlSugarCore.Abstractions;
using Yi.Framework.SqlSugarCore.Repositories;