using System.Threading.Tasks;
using GxPress.Common.Page;
using GxPress.Entity;
using GxPress.Repository.Interface;
using GxPress.Request.Feedback;
using GxPress.Result.Feedback;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace GxPress.Api.AdminControllers
{
///
/// 意见反馈
///
[Route("api/admin/Feedback")]
[ApiController]
[Authorize]
public class AdminFeedbackController : ControllerBase
{
private readonly ILogger _logger;
private readonly IFeedbackRepository _feedbackRepository;
public AdminFeedbackController(ILogger logger, IFeedbackRepository feedbackRepository)
{
_logger = logger;
_feedbackRepository = feedbackRepository;
}
///
/// 查询分页数据
///
///
///
[HttpPost("page")]
public async Task> GetPageList([FromBody] FeedbackPageRequest request)
{
return await _feedbackRepository.GetPagedList(request);
}
///
/// 删除意见反馈
///
///
///
[HttpDelete("{id}")]
public async Task Delete(int id)
{
return await _feedbackRepository.DeleteAsync(id);
}
}
}