AdminAppStartPage.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using GxPress.Repository.Interface.AppStartPage;
  4. using Microsoft.AspNetCore.Authorization;
  5. using Microsoft.AspNetCore.Mvc;
  6. namespace GxPress.Api.AdminControllers
  7. {
  8. /// <summary>
  9. /// app启动页管理
  10. /// </summary>
  11. [Route("api/admin/app-start-page")]
  12. [ApiController]
  13. [Authorize]
  14. public class AdminAppStartPage : Controller
  15. {
  16. private readonly IAppStartPageRepository appStartPageRepository;
  17. public AdminAppStartPage(IAppStartPageRepository appStartPageRepository)
  18. {
  19. this.appStartPageRepository = appStartPageRepository;
  20. }
  21. /// <summary>
  22. /// 查询
  23. /// </summary>
  24. /// <returns></returns>
  25. [HttpGet("list")]
  26. public async Task<IEnumerable<Entity.tede2.AppStartPage.AppStartPage>> GetAllAsync()
  27. {
  28. return await appStartPageRepository.GetAllAsync();
  29. }
  30. /// <summary>
  31. /// 删除
  32. /// </summary>
  33. /// <param name="id"></param>
  34. /// <returns></returns>
  35. [HttpDelete("{id}")]
  36. public async Task<bool> DeleteAsync(int id)
  37. {
  38. return await appStartPageRepository.DeleteAsync(id);
  39. }
  40. /// <summary>
  41. /// 修改
  42. /// </summary>
  43. /// <param name="model"></param>
  44. /// <returns></returns>
  45. [HttpPut("")]
  46. public async Task<bool> UpdateAsync(Entity.tede2.AppStartPage.AppStartPage model)
  47. {
  48. return await appStartPageRepository.UpdateAsync(model);
  49. }
  50. }
  51. }