AdminFeedbackController.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System.Threading.Tasks;
  2. using GxPress.Common.Page;
  3. using GxPress.Entity;
  4. using GxPress.Repository.Interface;
  5. using GxPress.Request.Feedback;
  6. using GxPress.Result.Feedback;
  7. using Microsoft.AspNetCore.Authorization;
  8. using Microsoft.AspNetCore.Mvc;
  9. using Microsoft.Extensions.Logging;
  10. namespace GxPress.Api.AdminControllers
  11. {
  12. /// <summary>
  13. /// 意见反馈
  14. /// </summary>
  15. [Route("api/admin/Feedback")]
  16. [ApiController]
  17. [Authorize]
  18. public class AdminFeedbackController : ControllerBase
  19. {
  20. private readonly ILogger<AdminAppVersionController> _logger;
  21. private readonly IFeedbackRepository _feedbackRepository;
  22. public AdminFeedbackController(ILogger<AdminAppVersionController> logger, IFeedbackRepository feedbackRepository)
  23. {
  24. _logger = logger;
  25. _feedbackRepository = feedbackRepository;
  26. }
  27. /// <summary>
  28. /// 查询分页数据
  29. /// </summary>
  30. /// <param name="request"></param>
  31. /// <returns></returns>
  32. [HttpPost("page")]
  33. public async Task<PagedList<FeedbackPageResult>> GetPageList([FromBody] FeedbackPageRequest request)
  34. {
  35. return await _feedbackRepository.GetPagedList(request);
  36. }
  37. /// <summary>
  38. /// 删除意见反馈
  39. /// </summary>
  40. /// <param name="id"></param>
  41. /// <returns></returns>
  42. [HttpDelete("{id}")]
  43. public async Task<bool> Delete(int id)
  44. {
  45. return await _feedbackRepository.DeleteAsync(id);
  46. }
  47. }
  48. }