style: 修改聚合跟类命名
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Yi.Framework.Bbs.Domain.Managers.ArticleImport
|
||||
LoggerFactory = loggerFactory;
|
||||
}
|
||||
protected ILoggerFactory LoggerFactory { get; set; }
|
||||
public virtual List<ArticleEntity> Import(Guid discussId, Guid articleParentId, List<FileObject> fileObjs)
|
||||
public virtual List<ArticleAggregateRoot> Import(Guid discussId, Guid articleParentId, List<FileObject> fileObjs)
|
||||
{
|
||||
var articles = Convert(fileObjs);
|
||||
var orderNum = 0;
|
||||
@@ -29,6 +29,6 @@ namespace Yi.Framework.Bbs.Domain.Managers.ArticleImport
|
||||
});
|
||||
return articles;
|
||||
}
|
||||
public abstract List<ArticleEntity> Convert(List<FileObject> fileObjs);
|
||||
public abstract List<ArticleAggregateRoot> Convert(List<FileObject> fileObjs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Yi.Framework.Bbs.Domain.Managers.ArticleImport
|
||||
{
|
||||
internal class DefaultArticleImport : AbstractArticleImport
|
||||
{
|
||||
public override List<ArticleEntity> Convert(List<FileObject> fileObjs)
|
||||
public override List<ArticleAggregateRoot> Convert(List<FileObject> fileObjs)
|
||||
{
|
||||
return fileObjs.OrderBy(x => x.FileName).Select(x => new ArticleEntity { Name = x.FileName, Content = x.Content }).ToList();
|
||||
return fileObjs.OrderBy(x => x.FileName).Select(x => new ArticleAggregateRoot { Name = x.FileName, Content = x.Content }).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Yi.Framework.Bbs.Domain.Managers.ArticleImport
|
||||
{
|
||||
internal class VuePressArticleImport : AbstractArticleImport
|
||||
{
|
||||
public override List<ArticleEntity> Convert(List<FileObject> fileObjs)
|
||||
public override List<ArticleAggregateRoot> Convert(List<FileObject> fileObjs)
|
||||
{
|
||||
var logger = LoggerFactory.CreateLogger<VuePressArticleImport>();
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Yi.Framework.Bbs.Domain.Managers.ArticleImport
|
||||
f.Content = result;
|
||||
return f;
|
||||
});
|
||||
var output = fileContentHandler.Select(x => new ArticleEntity() { Content = x.Content, Name = x.FileName }).ToList();
|
||||
var output = fileContentHandler.Select(x => new ArticleAggregateRoot() { Content = x.Content, Name = x.FileName }).ToList();
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -15,11 +15,11 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
/// </summary>
|
||||
public class BankManager : DomainService
|
||||
{
|
||||
private ISqlSugarRepository<BankCardEntity> _repository;
|
||||
private ISqlSugarRepository<BankCardAggregateRoot> _repository;
|
||||
private ILocalEventBus _localEventBus;
|
||||
private ISqlSugarRepository<InterestRecordsEntity> _interestRepository;
|
||||
private ISqlSugarRepository<InterestRecordsAggregateRoot> _interestRepository;
|
||||
private IBankValueProvider _bankValueProvider;
|
||||
public BankManager(ISqlSugarRepository<BankCardEntity> repository, ILocalEventBus localEventBus, ISqlSugarRepository<InterestRecordsEntity> interestRepository, IBankValueProvider bankValueProvider)
|
||||
public BankManager(ISqlSugarRepository<BankCardAggregateRoot> repository, ILocalEventBus localEventBus, ISqlSugarRepository<InterestRecordsAggregateRoot> interestRepository, IBankValueProvider bankValueProvider)
|
||||
{
|
||||
_repository = repository;
|
||||
_localEventBus = localEventBus;
|
||||
@@ -72,7 +72,7 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
/// 强制创建一个记录,不管时间到没到
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<InterestRecordsEntity> CreateInterestRecordsAsync()
|
||||
public async Task<InterestRecordsAggregateRoot> CreateInterestRecordsAsync()
|
||||
{
|
||||
//获取最新的实体
|
||||
var lastEntity = await _interestRepository._DbQueryable.OrderByDescending(x => x.CreationTime).FirstAsync();
|
||||
@@ -106,7 +106,7 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
//根据上一次的老值进行变化率比较
|
||||
var currentValue = oldValue + (oldValue* changeRate);
|
||||
|
||||
var entity = new InterestRecordsEntity(lastThirdPartyStandardValue, currentValue);
|
||||
var entity = new InterestRecordsAggregateRoot(lastThirdPartyStandardValue, currentValue);
|
||||
var output = await _interestRepository.InsertReturnEntityAsync(entity);
|
||||
|
||||
return output;
|
||||
@@ -129,7 +129,7 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
/// <returns></returns>
|
||||
public async Task ApplyingBankCardAsync(Guid userId, int cardNumber)
|
||||
{
|
||||
var entities = Enumerable.Range(1, cardNumber).Select(x => new BankCardEntity(userId)).ToList();
|
||||
var entities = Enumerable.Range(1, cardNumber).Select(x => new BankCardAggregateRoot(userId)).ToList();
|
||||
await _repository.InsertManyAsync(entities);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
{
|
||||
public class BbsUserManager : DomainService
|
||||
{
|
||||
public ISqlSugarRepository<UserEntity> _userRepository;
|
||||
public ISqlSugarRepository<UserAggregateRoot> _userRepository;
|
||||
public ISqlSugarRepository<BbsUserExtraInfoEntity> _bbsUserInfoRepository;
|
||||
public Dictionary<int,LevelCacheItem> _levelCacheDic;
|
||||
public BbsUserManager(ISqlSugarRepository<UserEntity> userRepository,
|
||||
public BbsUserManager(ISqlSugarRepository<UserAggregateRoot> userRepository,
|
||||
ISqlSugarRepository<BbsUserExtraInfoEntity> bbsUserInfoRepository,
|
||||
IDistributedCache<List<LevelCacheItem>> levelCache
|
||||
)
|
||||
|
||||
@@ -14,11 +14,11 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
/// </summary>
|
||||
public class ForumManager : DomainService
|
||||
{
|
||||
public readonly ISqlSugarRepository<DiscussEntity, Guid> _discussRepository;
|
||||
public readonly ISqlSugarRepository<PlateEntity, Guid> _plateEntityRepository;
|
||||
public readonly ISqlSugarRepository<CommentEntity, Guid> _commentRepository;
|
||||
public readonly ISqlSugarRepository<ArticleEntity, Guid> _articleRepository;
|
||||
public ForumManager(ISqlSugarRepository<DiscussEntity, Guid> discussRepository, ISqlSugarRepository<PlateEntity, Guid> plateEntityRepository, ISqlSugarRepository<CommentEntity, Guid> commentRepository, ISqlSugarRepository<ArticleEntity, Guid> articleRepository)
|
||||
public readonly ISqlSugarRepository<DiscussAggregateRoot, Guid> _discussRepository;
|
||||
public readonly ISqlSugarRepository<PlateAggregateRoot, Guid> _plateEntityRepository;
|
||||
public readonly ISqlSugarRepository<CommentAggregateRoot, Guid> _commentRepository;
|
||||
public readonly ISqlSugarRepository<ArticleAggregateRoot, Guid> _articleRepository;
|
||||
public ForumManager(ISqlSugarRepository<DiscussAggregateRoot, Guid> discussRepository, ISqlSugarRepository<PlateAggregateRoot, Guid> plateEntityRepository, ISqlSugarRepository<CommentAggregateRoot, Guid> commentRepository, ISqlSugarRepository<ArticleAggregateRoot, Guid> articleRepository)
|
||||
{
|
||||
_discussRepository = discussRepository;
|
||||
_plateEntityRepository = plateEntityRepository;
|
||||
@@ -27,7 +27,7 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
}
|
||||
|
||||
//主题是不能直接创建的,需要由领域服务统一创建
|
||||
public async Task<DiscussEntity> CreateDiscussAsync(DiscussEntity entity)
|
||||
public async Task<DiscussAggregateRoot> CreateDiscussAsync(DiscussAggregateRoot entity)
|
||||
{
|
||||
entity.CreationTime = DateTime.Now;
|
||||
entity.AgreeNum = 0;
|
||||
@@ -35,9 +35,9 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
return await _discussRepository.InsertReturnEntityAsync(entity);
|
||||
}
|
||||
|
||||
public async Task<CommentEntity> CreateCommentAsync(Guid discussId, Guid parentId, Guid rootId, string content)
|
||||
public async Task<CommentAggregateRoot> CreateCommentAsync(Guid discussId, Guid parentId, Guid rootId, string content)
|
||||
{
|
||||
var entity = new CommentEntity(discussId);
|
||||
var entity = new CommentAggregateRoot(discussId);
|
||||
entity.Content = content;
|
||||
entity.ParentId = parentId;
|
||||
entity.RootId = rootId;
|
||||
|
||||
@@ -10,10 +10,10 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
{
|
||||
public class IntegralManager : DomainService
|
||||
{
|
||||
public ISqlSugarRepository<LevelEntity> _levelRepository;
|
||||
public ISqlSugarRepository<SignInEntity> _signInRepository;
|
||||
public ISqlSugarRepository<LevelAggregateRoot> _levelRepository;
|
||||
public ISqlSugarRepository<SignInAggregateRoot> _signInRepository;
|
||||
private readonly ILocalEventBus _localEventBus;
|
||||
public IntegralManager(ISqlSugarRepository<LevelEntity> levelRepository, ISqlSugarRepository<SignInEntity> signInRepository, ILocalEventBus localEventBus)
|
||||
public IntegralManager(ISqlSugarRepository<LevelAggregateRoot> levelRepository, ISqlSugarRepository<SignInAggregateRoot> signInRepository, ILocalEventBus localEventBus)
|
||||
{
|
||||
_levelRepository = levelRepository;
|
||||
_localEventBus = localEventBus;
|
||||
@@ -56,7 +56,7 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
|
||||
|
||||
//插入记录
|
||||
var entity = new SignInEntity() { ContinuousNumber = continuousNumber };
|
||||
var entity = new SignInAggregateRoot() { ContinuousNumber = continuousNumber };
|
||||
await _signInRepository.InsertAsync(entity);
|
||||
|
||||
//发布一个其他领域的事件
|
||||
@@ -112,7 +112,7 @@ namespace Yi.Framework.Bbs.Domain.Managers
|
||||
/// <summary>
|
||||
/// 获取连续次数
|
||||
/// </summary>
|
||||
private int GetContinuousNumber(SignInEntity sigInLast)
|
||||
private int GetContinuousNumber(SignInAggregateRoot sigInLast)
|
||||
{
|
||||
var continuousNumber = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user