style: 修改聚合跟类命名
This commit is contained in:
@@ -10,8 +10,8 @@ namespace Yi.Framework.Bbs.Application.Services
|
||||
{
|
||||
public class AccessLogService : ApplicationService, IAccessLogService
|
||||
{
|
||||
private readonly ISqlSugarRepository<AccessLogEntity> _repository;
|
||||
public AccessLogService(ISqlSugarRepository<AccessLogEntity> repository) { _repository = repository; }
|
||||
private readonly ISqlSugarRepository<AccessLogAggregateRoot> _repository;
|
||||
public AccessLogService(ISqlSugarRepository<AccessLogAggregateRoot> repository) { _repository = repository; }
|
||||
|
||||
public DateTime GetWeekFirst()
|
||||
{
|
||||
@@ -71,11 +71,11 @@ namespace Yi.Framework.Bbs.Application.Services
|
||||
|
||||
if (last is null || last.CreationTime.Date != DateTime.Today)
|
||||
{
|
||||
await _repository.InsertAsync(new AccessLogEntity());
|
||||
await _repository.InsertAsync(new AccessLogAggregateRoot());
|
||||
}
|
||||
else
|
||||
{
|
||||
await _repository._Db.Updateable<AccessLogEntity>().SetColumns(it => it.Number == it.Number + 1).Where(it => it.Id == last.Id).ExecuteCommandAsync();
|
||||
await _repository._Db.Updateable<AccessLogAggregateRoot>().SetColumns(it => it.Number == it.Number + 1).Where(it => it.Id == last.Id).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Yi.Framework.Bbs.Application.Services
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
private AccessLogDto[] WeekTimeHandler(AccessLogEntity[] data)
|
||||
private AccessLogDto[] WeekTimeHandler(AccessLogAggregateRoot[] data)
|
||||
{
|
||||
data = data.Where(x => x.CreationTime >= GetWeekFirst()).OrderByDescending(x => x.CreationTime).DistinctBy(x => x.CreationTime.DayOfWeek).ToArray();
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Yi.Framework.Bbs.Application.Services.Analyses
|
||||
{
|
||||
var output = await _forumManager._discussRepository._DbQueryable
|
||||
.Where(discuss=>discuss.PermissionType== DiscussPermissionTypeEnum.Public)
|
||||
.LeftJoin<UserEntity>((discuss, user) => discuss.CreatorId == user.Id)
|
||||
.LeftJoin<UserAggregateRoot>((discuss, user) => discuss.CreatorId == user.Id)
|
||||
.LeftJoin<BbsUserExtraInfoEntity>((discuss, user, info) => user.Id == info.UserId)
|
||||
|
||||
.OrderBy(discuss => SqlFunc.GetRandom())
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace Yi.Framework.Bbs.Application.Services.Bank
|
||||
{
|
||||
private BankManager _bankManager;
|
||||
private BbsUserManager _bbsUserManager;
|
||||
private ISqlSugarRepository<BankCardEntity, Guid> _repository;
|
||||
private ISqlSugarRepository<InterestRecordsEntity, Guid> _interestRepository;
|
||||
public BankService(BankManager bankManager, BbsUserManager userManager, ISqlSugarRepository<BankCardEntity, Guid> repository, ISqlSugarRepository<InterestRecordsEntity, Guid> interestRepository)
|
||||
private ISqlSugarRepository<BankCardAggregateRoot, Guid> _repository;
|
||||
private ISqlSugarRepository<InterestRecordsAggregateRoot, Guid> _interestRepository;
|
||||
public BankService(BankManager bankManager, BbsUserManager userManager, ISqlSugarRepository<BankCardAggregateRoot, Guid> repository, ISqlSugarRepository<InterestRecordsAggregateRoot, Guid> interestRepository)
|
||||
{
|
||||
_bankManager = bankManager;
|
||||
_bbsUserManager = userManager;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
/// </summary>
|
||||
public class AgreeService : ApplicationService, IApplicationService
|
||||
{
|
||||
public AgreeService(ISqlSugarRepository<AgreeEntity> repository, ISqlSugarRepository<DiscussEntity> discssRepository)
|
||||
public AgreeService(ISqlSugarRepository<AgreeEntity> repository, ISqlSugarRepository<DiscussAggregateRoot> discssRepository)
|
||||
{
|
||||
_repository = repository;
|
||||
_discssRepository = discssRepository;
|
||||
@@ -21,7 +21,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
|
||||
private ISqlSugarRepository<AgreeEntity> _repository { get; set; }
|
||||
|
||||
private ISqlSugarRepository<DiscussEntity> _discssRepository { get; set; }
|
||||
private ISqlSugarRepository<DiscussAggregateRoot> _discssRepository { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -31,11 +31,11 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
/// Article服务实现
|
||||
/// </summary>
|
||||
|
||||
public class ArticleService : YiCrudAppService<ArticleEntity, ArticleGetOutputDto, ArticleGetListOutputDto, Guid, ArticleGetListInputVo, ArticleCreateInputVo, ArticleUpdateInputVo>,
|
||||
public class ArticleService : YiCrudAppService<ArticleAggregateRoot, ArticleGetOutputDto, ArticleGetListOutputDto, Guid, ArticleGetListInputVo, ArticleCreateInputVo, ArticleUpdateInputVo>,
|
||||
IArticleService
|
||||
{
|
||||
public ArticleService(IArticleRepository articleRepository,
|
||||
ISqlSugarRepository<DiscussEntity> discussRepository,
|
||||
ISqlSugarRepository<DiscussAggregateRoot> discussRepository,
|
||||
IDiscussService discussService,
|
||||
ForumManager forumManager) : base(articleRepository)
|
||||
{
|
||||
@@ -48,7 +48,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
}
|
||||
private ForumManager _forumManager;
|
||||
private IArticleRepository _articleRepository;
|
||||
private ISqlSugarRepository<DiscussEntity> _discussRepository;
|
||||
private ISqlSugarRepository<DiscussAggregateRoot> _discussRepository;
|
||||
private IDiscussService _discussService;
|
||||
|
||||
public override async Task<PagedResultDto<ArticleGetListOutputDto>> GetListAsync(ArticleGetListInputVo input)
|
||||
|
||||
@@ -12,11 +12,11 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
/// <summary>
|
||||
/// Banner服务实现
|
||||
/// </summary>
|
||||
public class BannerService : YiCrudAppService<BannerEntity, BannerGetOutputDto, BannerGetListOutputDto, Guid, BannerGetListInputVo, BannerCreateInputVo, BannerUpdateInputVo>,
|
||||
public class BannerService : YiCrudAppService<BannerAggregateRoot, BannerGetOutputDto, BannerGetListOutputDto, Guid, BannerGetListInputVo, BannerCreateInputVo, BannerUpdateInputVo>,
|
||||
IBannerService
|
||||
{
|
||||
private ISqlSugarRepository<BannerEntity, Guid> _repository;
|
||||
public BannerService(ISqlSugarRepository<BannerEntity, Guid> repository) : base(repository)
|
||||
private ISqlSugarRepository<BannerAggregateRoot, Guid> _repository;
|
||||
public BannerService(ISqlSugarRepository<BannerAggregateRoot, Guid> repository) : base(repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
@@ -21,12 +21,12 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
/// <summary>
|
||||
/// 评论
|
||||
/// </summary>
|
||||
public class CommentService : YiCrudAppService<CommentEntity, CommentGetOutputDto, CommentGetListOutputDto, Guid, CommentGetListInputVo, CommentCreateInputVo, CommentUpdateInputVo>,
|
||||
public class CommentService : YiCrudAppService<CommentAggregateRoot, CommentGetOutputDto, CommentGetListOutputDto, Guid, CommentGetListInputVo, CommentCreateInputVo, CommentUpdateInputVo>,
|
||||
ICommentService
|
||||
{
|
||||
private readonly ISqlSugarRepository<CommentEntity, Guid> _repository;
|
||||
private readonly ISqlSugarRepository<CommentAggregateRoot, Guid> _repository;
|
||||
private readonly BbsUserManager _bbsUserManager;
|
||||
public CommentService(ForumManager forumManager, ISqlSugarRepository<DiscussEntity> discussRepository, IDiscussService discussService, ISqlSugarRepository<CommentEntity, Guid> CommentRepository, BbsUserManager bbsUserManager) : base(CommentRepository)
|
||||
public CommentService(ForumManager forumManager, ISqlSugarRepository<DiscussAggregateRoot> discussRepository, IDiscussService discussService, ISqlSugarRepository<CommentAggregateRoot, Guid> CommentRepository, BbsUserManager bbsUserManager) : base(CommentRepository)
|
||||
{
|
||||
_forumManager = forumManager;
|
||||
_discussRepository = discussRepository;
|
||||
@@ -39,7 +39,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
|
||||
|
||||
|
||||
private ISqlSugarRepository<DiscussEntity> _discussRepository { get; set; }
|
||||
private ISqlSugarRepository<DiscussAggregateRoot> _discussRepository { get; set; }
|
||||
|
||||
private IDiscussService _discussService { get; set; }
|
||||
/// <summary>
|
||||
|
||||
@@ -29,12 +29,12 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
/// <summary>
|
||||
/// Discuss应用服务实现,用于参数校验、领域服务业务组合、日志记录、事务处理、账户信息
|
||||
/// </summary>
|
||||
public class DiscussService : YiCrudAppService<DiscussEntity, DiscussGetOutputDto, DiscussGetListOutputDto, Guid, DiscussGetListInputVo, DiscussCreateInputVo, DiscussUpdateInputVo>,
|
||||
public class DiscussService : YiCrudAppService<DiscussAggregateRoot, DiscussGetOutputDto, DiscussGetListOutputDto, Guid, DiscussGetListInputVo, DiscussCreateInputVo, DiscussUpdateInputVo>,
|
||||
IDiscussService
|
||||
{
|
||||
private ISqlSugarRepository<DiscussTopEntity> _discussTopEntityRepository;
|
||||
private BbsUserManager _bbsUserManager;
|
||||
public DiscussService(BbsUserManager bbsUserManager, ForumManager forumManager, ISqlSugarRepository<DiscussTopEntity> discussTopEntityRepository, ISqlSugarRepository<PlateEntity> plateEntityRepository, ILocalEventBus localEventBus) : base(forumManager._discussRepository)
|
||||
public DiscussService(BbsUserManager bbsUserManager, ForumManager forumManager, ISqlSugarRepository<DiscussTopEntity> discussTopEntityRepository, ISqlSugarRepository<PlateAggregateRoot> plateEntityRepository, ILocalEventBus localEventBus) : base(forumManager._discussRepository)
|
||||
{
|
||||
_forumManager = forumManager;
|
||||
_plateEntityRepository = plateEntityRepository;
|
||||
@@ -46,7 +46,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
private ForumManager _forumManager { get; set; }
|
||||
|
||||
|
||||
private ISqlSugarRepository<PlateEntity> _plateEntityRepository { get; set; }
|
||||
private ISqlSugarRepository<PlateAggregateRoot> _plateEntityRepository { get; set; }
|
||||
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
{
|
||||
|
||||
//查询主题发布 浏览主题 事件,浏览数+1
|
||||
var item = await _forumManager._discussRepository._DbQueryable.LeftJoin<UserEntity>((discuss, user) => discuss.CreatorId == user.Id)
|
||||
var item = await _forumManager._discussRepository._DbQueryable.LeftJoin<UserAggregateRoot>((discuss, user) => discuss.CreatorId == user.Id)
|
||||
.LeftJoin<BbsUserExtraInfoEntity>((discuss, user, info) => user.Id == info.UserId)
|
||||
.LeftJoin<PlateEntity>((discuss, user, info, plate) => plate.Id == discuss.PlateId)
|
||||
.LeftJoin<PlateAggregateRoot>((discuss, user, info, plate) => plate.Id == discuss.PlateId)
|
||||
.Select((discuss, user, info, plate) => new DiscussGetOutputDto
|
||||
{
|
||||
Id = discuss.Id,
|
||||
@@ -114,7 +114,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
.WhereIF(input.PlateId is not null, x => x.PlateId == input.PlateId)
|
||||
.WhereIF(input.IsTop is not null, x => x.IsTop == input.IsTop)
|
||||
.WhereIF(input.UserId is not null,x=>x.CreatorId==input.UserId)
|
||||
.LeftJoin<UserEntity>((discuss, user) => discuss.CreatorId == user.Id)
|
||||
.LeftJoin<UserAggregateRoot>((discuss, user) => discuss.CreatorId == user.Id)
|
||||
.WhereIF(input.UserName is not null, (discuss, user)=>user.UserName==input.UserName!)
|
||||
|
||||
.LeftJoin<BbsUserExtraInfoEntity>((discuss, user, info) => user.Id == info.UserId)
|
||||
@@ -157,8 +157,8 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
/// <returns></returns>
|
||||
public async Task<List<DiscussGetListOutputDto>> GetListTopAsync()
|
||||
{
|
||||
var output = await _discussTopEntityRepository._DbQueryable.LeftJoin<DiscussEntity>((top, discuss) => top.DiscussId == discuss.Id)
|
||||
.LeftJoin<UserEntity>((top, discuss, user) => discuss.CreatorId == user.Id)
|
||||
var output = await _discussTopEntityRepository._DbQueryable.LeftJoin<DiscussAggregateRoot>((top, discuss) => top.DiscussId == discuss.Id)
|
||||
.LeftJoin<UserAggregateRoot>((top, discuss, user) => discuss.CreatorId == user.Id)
|
||||
.LeftJoin<BbsUserExtraInfoEntity>((top, discuss, user, info) => user.Id == info.UserId)
|
||||
.OrderByDescending(top => top.OrderNum)
|
||||
.Select((top, discuss, user, info) => new DiscussGetListOutputDto
|
||||
|
||||
@@ -13,11 +13,11 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
|
||||
/// <summary>
|
||||
/// Plate服务实现
|
||||
/// </summary>
|
||||
public class PlateService : YiCrudAppService<PlateEntity, PlateGetOutputDto, PlateGetListOutputDto, Guid, PlateGetListInputVo, PlateCreateInputVo, PlateUpdateInputVo>,
|
||||
public class PlateService : YiCrudAppService<PlateAggregateRoot, PlateGetOutputDto, PlateGetListOutputDto, Guid, PlateGetListInputVo, PlateCreateInputVo, PlateUpdateInputVo>,
|
||||
IPlateService
|
||||
{
|
||||
private ISqlSugarRepository<PlateEntity, Guid> _repository;
|
||||
public PlateService(ISqlSugarRepository<PlateEntity, Guid> repository) : base(repository)
|
||||
private ISqlSugarRepository<PlateAggregateRoot, Guid> _repository;
|
||||
public PlateService(ISqlSugarRepository<PlateAggregateRoot, Guid> repository) : base(repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@ namespace Yi.Framework.Bbs.Application.Services.Integral
|
||||
/// <summary>
|
||||
/// 等级服务
|
||||
/// </summary>
|
||||
public class LevelService : YiCrudAppService<LevelEntity, LevelOutputDto, Guid, LevelGetListInputDto>, ILevelService
|
||||
public class LevelService : YiCrudAppService<LevelAggregateRoot, LevelOutputDto, Guid, LevelGetListInputDto>, ILevelService
|
||||
{
|
||||
private ISqlSugarRepository<LevelEntity, Guid> _repository;
|
||||
private ISqlSugarRepository<LevelAggregateRoot, Guid> _repository;
|
||||
private LevelManager _levelManager;
|
||||
public LevelService(ISqlSugarRepository<LevelEntity, Guid> repository, LevelManager levelManager) : base(repository)
|
||||
public LevelService(ISqlSugarRepository<LevelAggregateRoot, Guid> repository, LevelManager levelManager) : base(repository)
|
||||
{
|
||||
_repository = repository;
|
||||
_levelManager = levelManager;
|
||||
|
||||
Reference in New Issue
Block a user