style: 修改聚合跟类命名
This commit is contained in:
@@ -14,8 +14,8 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
{
|
||||
public class BannerDataSeed : IDataSeedContributor, ITransientDependency
|
||||
{
|
||||
private ISqlSugarRepository<BannerEntity> _repository;
|
||||
public BannerDataSeed(ISqlSugarRepository<BannerEntity> repository)
|
||||
private ISqlSugarRepository<BannerAggregateRoot> _repository;
|
||||
public BannerDataSeed(ISqlSugarRepository<BannerAggregateRoot> repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
@@ -26,18 +26,18 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
await _repository.InsertManyAsync(GetSeedData());
|
||||
}
|
||||
}
|
||||
public List<BannerEntity> GetSeedData()
|
||||
public List<BannerAggregateRoot> GetSeedData()
|
||||
{
|
||||
//这里临时使用了图床,图床地址:https://mjj.today/
|
||||
List<BannerEntity> entities = new List<BannerEntity>()
|
||||
List<BannerAggregateRoot> entities = new List<BannerAggregateRoot>()
|
||||
{
|
||||
new BannerEntity{
|
||||
new BannerAggregateRoot{
|
||||
Name="欢迎",
|
||||
Logo="https://i.miji.bid/2023/12/15/e6478d5d15a4b941077e336790c414f6.png",
|
||||
Color=""
|
||||
|
||||
},
|
||||
new BannerEntity{
|
||||
new BannerAggregateRoot{
|
||||
Name="前端",
|
||||
Logo="https://i.miji.bid/2023/12/15/07e9291c9311889a31a2b433d4decca0.jpeg",
|
||||
Color=""
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
public class BbsMenuDataSeed : IDataSeedContributor, ITransientDependency
|
||||
{
|
||||
private IGuidGenerator _guidGenerator;
|
||||
private ISqlSugarRepository<MenuEntity, Guid> _repository;
|
||||
public BbsMenuDataSeed(ISqlSugarRepository<MenuEntity,Guid> repository, IGuidGenerator guidGenerator)
|
||||
private ISqlSugarRepository<MenuAggregateRoot, Guid> _repository;
|
||||
public BbsMenuDataSeed(ISqlSugarRepository<MenuAggregateRoot,Guid> repository, IGuidGenerator guidGenerator)
|
||||
{
|
||||
_repository=repository;
|
||||
_guidGenerator=guidGenerator;
|
||||
@@ -30,11 +30,11 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
}
|
||||
}
|
||||
|
||||
public List<MenuEntity> GetSeedData()
|
||||
public List<MenuAggregateRoot> GetSeedData()
|
||||
{
|
||||
List<MenuEntity> entities = new List<MenuEntity>();
|
||||
List<MenuAggregateRoot> entities = new List<MenuAggregateRoot>();
|
||||
//BBS
|
||||
MenuEntity bbs = new MenuEntity(_guidGenerator.Create())
|
||||
MenuAggregateRoot bbs = new MenuAggregateRoot(_guidGenerator.Create())
|
||||
{
|
||||
MenuName = "BBS",
|
||||
MenuType = MenuTypeEnum.Catalogue,
|
||||
@@ -50,7 +50,7 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
|
||||
|
||||
//板块管理
|
||||
MenuEntity plate = new MenuEntity(_guidGenerator.Create())
|
||||
MenuAggregateRoot plate = new MenuAggregateRoot(_guidGenerator.Create())
|
||||
{
|
||||
|
||||
MenuName = "板块管理",
|
||||
@@ -69,7 +69,7 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
entities.Add(plate);
|
||||
|
||||
//文章管理
|
||||
MenuEntity article = new MenuEntity(_guidGenerator.Create())
|
||||
MenuAggregateRoot article = new MenuAggregateRoot(_guidGenerator.Create())
|
||||
{
|
||||
|
||||
MenuName = "文章管理",
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
public class BbsUserInfoDataSeed : IDataSeedContributor, ITransientDependency
|
||||
{
|
||||
private ISqlSugarRepository<BbsUserExtraInfoEntity> _repository;
|
||||
private ISqlSugarRepository<UserEntity> _userRepository;
|
||||
public BbsUserInfoDataSeed(ISqlSugarRepository<BbsUserExtraInfoEntity> repository, ISqlSugarRepository<UserEntity> userReponse)
|
||||
private ISqlSugarRepository<UserAggregateRoot> _userRepository;
|
||||
public BbsUserInfoDataSeed(ISqlSugarRepository<BbsUserExtraInfoEntity> repository, ISqlSugarRepository<UserAggregateRoot> userReponse)
|
||||
{
|
||||
_repository = repository;
|
||||
_userRepository = userReponse;
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
{
|
||||
public class ConfigDataSeed : IDataSeedContributor, ITransientDependency
|
||||
{
|
||||
private ISqlSugarRepository<ConfigEntity> _repository;
|
||||
public ConfigDataSeed(ISqlSugarRepository<ConfigEntity> repository)
|
||||
private ISqlSugarRepository<ConfigAggregateRoot> _repository;
|
||||
public ConfigDataSeed(ISqlSugarRepository<ConfigAggregateRoot> repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
@@ -27,10 +27,10 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
await _repository.InsertManyAsync(GetSeedData());
|
||||
}
|
||||
}
|
||||
public List<ConfigEntity> GetSeedData()
|
||||
public List<ConfigAggregateRoot> GetSeedData()
|
||||
{
|
||||
List<ConfigEntity> entities = new List<ConfigEntity>();
|
||||
ConfigEntity config1 = new ConfigEntity()
|
||||
List<ConfigAggregateRoot> entities = new List<ConfigAggregateRoot>();
|
||||
ConfigAggregateRoot config1 = new ConfigAggregateRoot()
|
||||
{
|
||||
ConfigKey = "bbs.site.name",
|
||||
ConfigName = "站点名称",
|
||||
@@ -38,7 +38,7 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
};
|
||||
entities.Add(config1);
|
||||
|
||||
ConfigEntity config2 = new ConfigEntity()
|
||||
ConfigAggregateRoot config2 = new ConfigAggregateRoot()
|
||||
{
|
||||
ConfigKey = "bbs.site.author",
|
||||
ConfigName = "站点作者",
|
||||
@@ -46,7 +46,7 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
};
|
||||
entities.Add(config2);
|
||||
|
||||
ConfigEntity config3 = new ConfigEntity()
|
||||
ConfigAggregateRoot config3 = new ConfigAggregateRoot()
|
||||
{
|
||||
ConfigKey = "bbs.site.icp",
|
||||
ConfigName = "站点Icp备案",
|
||||
@@ -55,7 +55,7 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
entities.Add(config3);
|
||||
|
||||
|
||||
ConfigEntity config4 = new ConfigEntity()
|
||||
ConfigAggregateRoot config4 = new ConfigAggregateRoot()
|
||||
{
|
||||
ConfigKey = "bbs.site.bottom",
|
||||
ConfigName = "站点底部信息",
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
{
|
||||
public class LevelDataSeed : IDataSeedContributor, ITransientDependency
|
||||
{
|
||||
private ISqlSugarRepository<LevelEntity> _repository;
|
||||
public LevelDataSeed(ISqlSugarRepository<LevelEntity> repository)
|
||||
private ISqlSugarRepository<LevelAggregateRoot> _repository;
|
||||
public LevelDataSeed(ISqlSugarRepository<LevelAggregateRoot> repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
@@ -19,20 +19,20 @@ namespace Yi.Framework.Bbs.SqlSugarCore.DataSeeds
|
||||
await _repository.InsertManyAsync(GetSeedData());
|
||||
}
|
||||
}
|
||||
public List<LevelEntity> GetSeedData()
|
||||
public List<LevelAggregateRoot> GetSeedData()
|
||||
{
|
||||
List<LevelEntity> entities = new List<LevelEntity>()
|
||||
List<LevelAggregateRoot> entities = new List<LevelAggregateRoot>()
|
||||
{
|
||||
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),
|
||||
new LevelAggregateRoot(1,"小白",10),
|
||||
new LevelAggregateRoot(2,"中白",30),
|
||||
new LevelAggregateRoot(3,"大白",100),
|
||||
new LevelAggregateRoot(4,"精英",300),
|
||||
new LevelAggregateRoot(5,"熟练",600),
|
||||
new LevelAggregateRoot(6,"高手",1000),
|
||||
new LevelAggregateRoot(7,"老手",1500),
|
||||
new LevelAggregateRoot(8,"大佬",2000),
|
||||
new LevelAggregateRoot(9,"巨佬",2500),
|
||||
new LevelAggregateRoot(10,"大神",3000),
|
||||
};
|
||||
|
||||
return entities;
|
||||
|
||||
@@ -7,13 +7,13 @@ using Yi.Framework.SqlSugarCore.Repositories;
|
||||
|
||||
namespace Yi.Framework.Bbs.SqlSugarCore.Repositories
|
||||
{
|
||||
public class ArticleRepository : SqlSugarRepository<ArticleEntity,Guid>, IArticleRepository,ITransientDependency
|
||||
public class ArticleRepository : SqlSugarRepository<ArticleAggregateRoot,Guid>, IArticleRepository,ITransientDependency
|
||||
{
|
||||
public ArticleRepository(ISugarDbContextProvider<ISqlSugarDbContext> sugarDbContextProvider) : base(sugarDbContextProvider)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<List<ArticleEntity>> GetTreeAsync(Expression<Func<ArticleEntity, bool>> where)
|
||||
public async Task<List<ArticleAggregateRoot>> GetTreeAsync(Expression<Func<ArticleAggregateRoot, bool>> where)
|
||||
{
|
||||
return await _DbQueryable.Where(where).OrderBy(x=>x.OrderNum).OrderBy(x=>x.CreationTime).ToTreeAsync(x => x.Children, x => x.ParentId, Guid.Empty);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user