using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Linq;
using System.Web;
using Microsoft.AspNetCore.Mvc;
using YiSha.Util;
using YiSha.Util.Model;
using YiSha.Entity;
using YiSha.Model;
using YiSha.Admin.Web.Controllers;
using YiSha.Entity.KJH;
using YiSha.IService.KJH;
using YiSha.Model.Param.KJH;
using YiSha.IBusiness.KJH;
namespace YiSha.Admin.Web.Areas.KJH.Controllers
{
///
/// 创 建:cmzx
/// 日 期:2021-04-27 16:23
/// 描 述:体彩排列3、5控制器类
///
[Area("KJH")]
public class Tcp3Controller : BaseController
{
private ITcp3BLL _tcp3BLL;
public Tcp3Controller(ITcp3BLL tcp3BLL)
{
_tcp3BLL = tcp3BLL;
}
#region 视图功能
[AuthorizeFilter("kjh:tcp3:view")]
public ActionResult Tcp3Index()
{
return View();
}
public ActionResult Tcp3Form()
{
return View();
}
#endregion
#region 获取数据
[HttpGet]
[AuthorizeFilter("kjh:tcp3:search")]
public async Task GetListJson(Tcp3ListParam param)
{
TData> obj = await _tcp3BLL.GetList(param);
return Json(obj);
}
[HttpGet]
[AuthorizeFilter("kjh:tcp3:search")]
public async Task GetPageListJson(Tcp3ListParam param, Pagination pagination)
{
TData> obj = await _tcp3BLL.GetPageList(param, pagination);
return Json(obj);
}
[HttpGet]
public async Task GetFormJson(int id)
{
TData obj = await _tcp3BLL.GetEntity(id);
return Json(obj);
}
#endregion
#region 提交数据
[HttpPost]
[AuthorizeFilter("kjh:tcp3:add,kjh:tcp3:edit")]
public async Task SaveFormJson(Tcp3Entity entity)
{
TData obj = await _tcp3BLL.SaveForm(entity);
return Json(obj);
}
[HttpPost]
[AuthorizeFilter("kjh:tcp3:delete")]
public async Task DeleteFormJson(string ids)
{
TData obj = await _tcp3BLL.DeleteFormById(ids);
return Json(obj);
}
#endregion
#region 清理缓存
[HttpGet]
public async Task UpCache()
{
TData obj = ClearCache.UpCache("tcp3");
return Json(obj);
}
#endregion
}
}