100 lines
3.3 KiB
C#
100 lines
3.3 KiB
C#
using MiaoYu.Api.Admin.ApplicationServices.Apps;
|
|
using MiaoYu.Repository.ChatAI.Admin.Entities.Apps;
|
|
namespace MiaoYu.Api.Admin.Controllers.Apps;
|
|
|
|
/// <summary>
|
|
/// 意向订单表 控制器
|
|
/// </summary>
|
|
[ControllerDescriptor(MenuId = "请设置菜单Id 系统菜单表中查找,如果不设置不受权限保护!", DisplayName = "意向订单表")]
|
|
public class T_User_IntentOrderController : AdminControllerBase<T_User_IntentOrderService>
|
|
{
|
|
public T_User_IntentOrderController(T_User_IntentOrderService defaultService)
|
|
: base(defaultService)
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取列表
|
|
/// </summary>
|
|
/// <param name="pagingSearchInput"></param>
|
|
/// <returns></returns>
|
|
[ActionDescriptor(PermissionFunctionConsts.Function_Display, DisplayName = "查看数据")]
|
|
[HttpPost]
|
|
public Task<PagingView> FindListAsync([FromBody] PagingSearchInput<T_User_IntentOrder> pagingSearchInput)
|
|
{
|
|
return this._defaultService.FindListAsync(pagingSearchInput);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据id数组删除
|
|
/// </summary>
|
|
/// <param name="ids">ids</param>
|
|
/// <returns></returns>
|
|
[ActionDescriptor(PermissionFunctionConsts.Function_Delete, DisplayName = "删除数据")]
|
|
[HttpPost]
|
|
public async Task<bool> DeleteListAsync([FromBody] List<int> ids)
|
|
{
|
|
await this._defaultService.DeleteListAsync(ids);
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询表单数据
|
|
/// </summary>
|
|
/// <param name="id">id</param>
|
|
/// <returns></returns>
|
|
[ActionDescriptor(DisplayName = "查看表单")]
|
|
[HttpGet("{id?}")]
|
|
public Task<Dictionary<string, object>> FindFormAsync([FromRoute] int id)
|
|
{
|
|
return this._defaultService.FindFormAsync(id);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加
|
|
/// </summary>
|
|
/// <param name="form"></param>
|
|
/// <returns></returns>
|
|
[RequestLimitFilter(Duration = 1, LimitCount = 1)]
|
|
[ActionDescriptor(PermissionFunctionConsts.Function_Insert, DisplayName = "创建表单")]
|
|
[HttpPost]
|
|
[ApiCheckModel]
|
|
public Task CreateAsync([FromBody] T_User_IntentOrder form)
|
|
{
|
|
return this._defaultService.SaveFormAsync(form);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 编辑
|
|
/// </summary>
|
|
/// <param name="form"></param>
|
|
/// <returns></returns>
|
|
[RequestLimitFilter(Duration = 1, LimitCount = 1)]
|
|
[ActionDescriptor(PermissionFunctionConsts.Function_Update, DisplayName = "编辑表单")]
|
|
[HttpPost]
|
|
[ApiCheckModel]
|
|
public Task UpdateAsync([FromBody] T_User_IntentOrder form)
|
|
{
|
|
return this._defaultService.SaveFormAsync(form);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 导出Excel
|
|
/// </summary>
|
|
/// <param name="pagingSearchInput"></param>
|
|
/// <returns></returns>
|
|
[ActionDescriptor(PermissionFunctionConsts.Function_Export, DisplayName = "导出数据")]
|
|
[ApiResourceCacheFilter(10)]
|
|
[HttpPost]
|
|
public async Task ExportExcelAsync([FromBody] PagingSearchInput<T_User_IntentOrder> pagingSearchInput)
|
|
{
|
|
var data = await this._defaultService.ExportExcelAsync(pagingSearchInput);
|
|
var name = $"{PermissionUtil.GetControllerDisplayName(this.GetType())}列表数据 {DateTime.Now.ToString("yyyy-MM-dd")}.xls";
|
|
base.HttpContext.DownLoadFile(data, Tools.GetFileContentType[".xls"].ToStr(), name);
|
|
}
|
|
|
|
|
|
|
|
|
|
} |