diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/IServices/ICommentService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/IServices/ICommentService.cs index c3e693c7..4b787dab 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/IServices/ICommentService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/IServices/ICommentService.cs @@ -8,6 +8,14 @@ namespace Yi.Framework.Bbs.Application.Contracts.IServices /// public interface ICommentService : IYiCrudAppService { - + /// + /// 发表评论 + /// + /// + /// + /// + // [Permission("bbs:comment:add")] + // [Authorize] + Task CreateAsync(CommentCreateInputVo input); } } diff --git a/Yi.Abp.Net8/src/Yi.Abp.Application/Services/TestService.cs b/Yi.Abp.Net8/src/Yi.Abp.Application/Services/TestService.cs index cde02589..409db5dc 100644 --- a/Yi.Abp.Net8/src/Yi.Abp.Application/Services/TestService.cs +++ b/Yi.Abp.Net8/src/Yi.Abp.Application/Services/TestService.cs @@ -6,6 +6,8 @@ using Volo.Abp.Application.Services; using Volo.Abp.Settings; using Volo.Abp.Uow; using Yi.Framework.Bbs.Application.Contracts.Dtos.Banner; +using Yi.Framework.Bbs.Application.Contracts.Dtos.Comment; +using Yi.Framework.Bbs.Application.Contracts.IServices; using Yi.Framework.Bbs.Domain.Entities.Forum; using Yi.Framework.Rbac.Domain.Authorization; using Yi.Framework.Rbac.Domain.Extensions; @@ -25,6 +27,24 @@ namespace Yi.Abp.Application.Services /// public ISqlSugarRepository sqlSugarRepository { get; set; } + private ICommentService _commentService; + public readonly ISqlSugarRepository _commentRepository; + public TestService(ICommentService commentService, ISqlSugarRepository commentRepository) + { + _commentService = commentService; + _commentRepository = commentRepository; + } + + public async Task GetAbpUnitOfWorkMiddleware() + { + var entity = new CommentAggregateRoot(Guid.Empty); + entity.Content = "测试"; + entity.ParentId = Guid.Empty; + entity.RootId = Guid.Empty; + await _commentRepository.InsertAsync(entity); + return "yes"; + } + /// /// 动态Api ///