|
@@ -1,5 +1,7 @@
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
using GxPress.Common.Page;
|
|
using GxPress.Common.Page;
|
|
|
|
+using GxPress.Common.Tools;
|
|
|
|
+using GxPress.EnumConst;
|
|
using GxPress.Repository.Interface;
|
|
using GxPress.Repository.Interface;
|
|
using GxPress.Request.Comment;
|
|
using GxPress.Request.Comment;
|
|
using GxPress.Result.Comment;
|
|
using GxPress.Result.Comment;
|
|
@@ -13,7 +15,8 @@ namespace GxPress.Api.AdminControllers
|
|
/// </summary>
|
|
/// </summary>
|
|
[Route("api/admin/comment")]
|
|
[Route("api/admin/comment")]
|
|
[ApiController]
|
|
[ApiController]
|
|
- public class AdminCommentController : ControllerBase
|
|
|
|
|
|
+ [Authorize]
|
|
|
|
+ public class AdminCommentController : Controller
|
|
{
|
|
{
|
|
private readonly ICommentRepository _commentRepository;
|
|
private readonly ICommentRepository _commentRepository;
|
|
public AdminCommentController(ICommentRepository commentRepository)
|
|
public AdminCommentController(ICommentRepository commentRepository)
|
|
@@ -21,7 +24,7 @@ namespace GxPress.Api.AdminControllers
|
|
_commentRepository = commentRepository;
|
|
_commentRepository = commentRepository;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 分页显示数据
|
|
/// 分页显示数据
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -38,10 +41,24 @@ namespace GxPress.Api.AdminControllers
|
|
/// <param name="request"></param>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpDelete("delete")]
|
|
[HttpDelete("delete")]
|
|
- [AllowAnonymous]
|
|
|
|
public async Task<bool> Delete([FromBody] CommentDeleteRequest request)
|
|
public async Task<bool> Delete([FromBody] CommentDeleteRequest request)
|
|
{
|
|
{
|
|
return await _commentRepository.DeleteCommentAsync(request);
|
|
return await _commentRepository.DeleteCommentAsync(request);
|
|
}
|
|
}
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 后台评论分页列表
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="request"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost("list")]
|
|
|
|
+ public async Task<PagedList<CommentResult>> GetAllAsync(CommentSearchRequest request)
|
|
|
|
+ {
|
|
|
|
+ var result = await _commentRepository.GetAllAsync(request);
|
|
|
|
+ foreach (var item in result.Items)
|
|
|
|
+ {
|
|
|
|
+ item.TypeValueString = ((AllTypeConst)item.TypeValue).GetDescriptionOriginal();
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|