NewManagerModelController.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using Microsoft.AspNetCore.Mvc;
  4. using YiSha.Util.Model;
  5. using YiSha.Admin.Web.Controllers;
  6. using YiSha.Entity.ZX;
  7. using YiSha.Model.Param.ZX;
  8. using YiSha.IBusiness.ZX;
  9. using YiSha.Model.Result.ZX;
  10. using YiSha.Web.Code;
  11. namespace YiSha.Admin.Web.Areas.ZX.Controllers
  12. {
  13. /// <summary>
  14. /// 创 建:cmzx
  15. /// 日 期:2021-04-16 15:56
  16. /// 描 述:资讯文章控制器类
  17. /// </summary>
  18. [Area("ZX")]
  19. public class NewManagerModelController : BaseController
  20. {
  21. private INewManagerModelBLL _newManagerModelBLL;
  22. public NewManagerModelController(INewManagerModelBLL newManagerModelBLL)
  23. {
  24. _newManagerModelBLL = newManagerModelBLL;
  25. }
  26. #region 视图功能
  27. [AuthorizeFilter("zx:newmanagermodel:view")]
  28. public ActionResult NewManagerModelIndex()
  29. {
  30. return View();
  31. }
  32. public async Task<IActionResult> NewManagerModelForm()
  33. {
  34. OperatorInfo operatorInfo = await Operator.Instance.Current();
  35. ViewBag.NewUserInfo = operatorInfo;
  36. return View();
  37. }
  38. public ActionResult NewManagerModelChoose()
  39. {
  40. return View();
  41. }
  42. public ActionResult NoticeIndex()
  43. {
  44. return View();
  45. }
  46. public ActionResult NoticeForm()
  47. {
  48. return View();
  49. }
  50. public ActionResult NewManagerModelIndexChoose()
  51. {
  52. return View();
  53. }
  54. [AuthorizeFilter("zx:newmanagermodel:view")]
  55. public ActionResult PublishNumberIndex()
  56. {
  57. return View();
  58. }
  59. #endregion
  60. #region 获取数据
  61. [HttpGet]
  62. [AuthorizeFilter("zx:newmanagermodel:search")]
  63. public async Task<ActionResult> GetListJson(NewManagerModelListParam param)
  64. {
  65. TData<List<NewManagerModelEntity>> obj = await _newManagerModelBLL.GetList(param);
  66. return Json(obj);
  67. }
  68. [HttpGet]
  69. [AuthorizeFilter("zx:newmanagermodel:search")]
  70. public async Task<ActionResult> GetPageListJson(NewManagerModelListParam param, Pagination pagination)
  71. {
  72. TData<List<NewManagerModelPageJoinModel>> obj = await _newManagerModelBLL.GetPageListPartial(param, pagination);
  73. return Json(obj);
  74. }
  75. [HttpGet]
  76. [AuthorizeFilter("zx:newmanagermodel:search")]
  77. public async Task<ActionResult> GetPublishNumberPageListJson(NewContentPublishNumberListParam param, Pagination pagination)
  78. {
  79. TData<List<NewContentPublishNumberPageJoinModel>> obj = await _newManagerModelBLL.GetPublishNumberPageListJson(param, pagination);
  80. return Json(obj);
  81. }
  82. [HttpGet]
  83. public async Task<ActionResult> GetFormJson(int id)
  84. {
  85. TData<NewManagerModelEntity> obj = await _newManagerModelBLL.GetEntity(id);
  86. return Json(obj);
  87. }
  88. #endregion
  89. #region 提交数据
  90. [HttpPost]
  91. [AuthorizeFilter("zx:newmanagermodel:add,zx:newmanagermodel:edit")]
  92. public async Task<ActionResult> SaveFormJson(NewManagerModelEntity entity)
  93. {
  94. TData<int> obj = await _newManagerModelBLL.SaveFormPartial(entity);
  95. return Json(obj);
  96. }
  97. [HttpPost]
  98. [AuthorizeFilter("zx:newmanagermodel:delete")]
  99. public async Task<ActionResult> DeleteFormJson(string ids)
  100. {
  101. TData obj = await _newManagerModelBLL.DeleteFormById(ids);
  102. return Json(obj);
  103. }
  104. #endregion
  105. }
  106. }