Tcp3Controller.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading.Tasks;
  4. using System.Linq;
  5. using System.Web;
  6. using Microsoft.AspNetCore.Mvc;
  7. using YiSha.Util;
  8. using YiSha.Util.Model;
  9. using YiSha.Entity;
  10. using YiSha.Model;
  11. using YiSha.Admin.Web.Controllers;
  12. using YiSha.Entity.KJH;
  13. using YiSha.IService.KJH;
  14. using YiSha.Model.Param.KJH;
  15. using YiSha.IBusiness.KJH;
  16. namespace YiSha.Admin.Web.Areas.KJH.Controllers
  17. {
  18. /// <summary>
  19. /// 创 建:cmzx
  20. /// 日 期:2021-04-27 16:23
  21. /// 描 述:体彩排列3、5控制器类
  22. /// </summary>
  23. [Area("KJH")]
  24. public class Tcp3Controller : BaseController
  25. {
  26. private ITcp3BLL _tcp3BLL;
  27. public Tcp3Controller(ITcp3BLL tcp3BLL)
  28. {
  29. _tcp3BLL = tcp3BLL;
  30. }
  31. #region 视图功能
  32. [AuthorizeFilter("kjh:tcp3:view")]
  33. public ActionResult Tcp3Index()
  34. {
  35. return View();
  36. }
  37. public ActionResult Tcp3Form()
  38. {
  39. return View();
  40. }
  41. #endregion
  42. #region 获取数据
  43. [HttpGet]
  44. [AuthorizeFilter("kjh:tcp3:search")]
  45. public async Task<ActionResult> GetListJson(Tcp3ListParam param)
  46. {
  47. TData<List<Tcp3Entity>> obj = await _tcp3BLL.GetList(param);
  48. return Json(obj);
  49. }
  50. [HttpGet]
  51. [AuthorizeFilter("kjh:tcp3:search")]
  52. public async Task<ActionResult> GetPageListJson(Tcp3ListParam param, Pagination pagination)
  53. {
  54. TData<List<Tcp3Entity>> obj = await _tcp3BLL.GetPageList(param, pagination);
  55. return Json(obj);
  56. }
  57. [HttpGet]
  58. public async Task<ActionResult> GetFormJson(int id)
  59. {
  60. TData<Tcp3Entity> obj = await _tcp3BLL.GetEntity(id);
  61. return Json(obj);
  62. }
  63. #endregion
  64. #region 提交数据
  65. [HttpPost]
  66. [AuthorizeFilter("kjh:tcp3:add,kjh:tcp3:edit")]
  67. public async Task<ActionResult> SaveFormJson(Tcp3Entity entity)
  68. {
  69. TData<int> obj = await _tcp3BLL.SaveForm(entity);
  70. return Json(obj);
  71. }
  72. [HttpPost]
  73. [AuthorizeFilter("kjh:tcp3:delete")]
  74. public async Task<ActionResult> DeleteFormJson(string ids)
  75. {
  76. TData obj = await _tcp3BLL.DeleteFormById(ids);
  77. return Json(obj);
  78. }
  79. #endregion
  80. #region 清理缓存
  81. [HttpGet]
  82. public async Task<ActionResult> UpCache()
  83. {
  84. TData obj = ClearCache.UpCache("tcp3");
  85. return Json(obj);
  86. }
  87. #endregion
  88. }
  89. }