AdminAppStartPageController.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 AdminAppStartPageController : Controller
  15. {
  16. private readonly IAppStartPageRepository appStartPageRepository;
  17. public AdminAppStartPageController(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. /// <summary>
  51. /// 添加
  52. /// </summary>
  53. /// <param name="model"></param>
  54. /// <returns></returns>
  55. [HttpPost]
  56. public async Task<bool> InsertAsync(Entity.tede2.AppStartPage.AppStartPage model)
  57. {
  58. return await appStartPageRepository.InsertAsync(model);
  59. }
  60. }
  61. }