feat: 支持用户限制

This commit is contained in:
ccnetcore
2025-06-02 02:12:38 +08:00
parent 8b92cd6bed
commit 629add1e8a
6 changed files with 91 additions and 76 deletions

View File

@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Users;
using Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser;
using Yi.Framework.Bbs.Application.Contracts.Dtos.Comment;
using Yi.Framework.Bbs.Application.Contracts.IServices;
@@ -34,14 +35,11 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
_repository = CommentRepository;
_bbsUserManager = bbsUserManager;
}
private ForumManager _forumManager { get; set; }
private ISqlSugarRepository<DiscussAggregateRoot> _discussRepository { get; set; }
private IDiscussService _discussService { get; set; }
/// <summary>
/// 获取改主题下的评论,结构为二维列表,该查询无分页
/// </summary>
@@ -127,7 +125,7 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
{
throw new UserFriendlyException("评论不能为空");
}
await _bbsUserManager.VerifyUserLimitAsync(CurrentUser.GetId());
var discuess = await _discussRepository.GetFirstAsync(x => x.Id == input.DiscussId);
if (discuess is null)
{