You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.8 KiB
C#

namespace Admin.NET.Plugin.HwPortal;
[AllowAnonymous]
[Route("portal/aboutUsInfoDetail")]
public class HwAboutUsInfoDetailController : HwPortalControllerBase
{
private readonly HwAboutUsInfoDetailService _service;
public HwAboutUsInfoDetailController(HwAboutUsInfoDetailService service)
{
_service = service;
}
[HttpGet("list")]
public async Task<HwPortalTableDataInfo<HwAboutUsInfoDetail>> List([FromQuery] HwAboutUsInfoDetail input)
{
return GetDataTable(await _service.SelectHwAboutUsInfoDetailList(input));
}
[HttpPost("export")]
[Idempotent]
public async Task<IActionResult> Export([FromQuery] HwAboutUsInfoDetail input)
{
return ExportExcel(await _service.SelectHwAboutUsInfoDetailList(input), "关于我们明细数据");
}
[HttpGet("{usInfoDetailId:long}")]
public async Task<HwPortalAjaxResult> GetInfo(long usInfoDetailId)
{
return Success(await _service.SelectHwAboutUsInfoDetailByUsInfoDetailId(usInfoDetailId));
}
[HttpPost]
[Idempotent]
public async Task<HwPortalAjaxResult> Add([FromBody] HwAboutUsInfoDetail input)
{
return ToAjax(await _service.InsertHwAboutUsInfoDetail(input));
}
[HttpPut]
[Idempotent]
public async Task<HwPortalAjaxResult> Edit([FromBody] HwAboutUsInfoDetail input)
{
return ToAjax(await _service.UpdateHwAboutUsInfoDetail(input));
}
[HttpDelete("{usInfoDetailIds}")]
[Idempotent]
public async Task<HwPortalAjaxResult> Remove(string usInfoDetailIds)
{
return ToAjax(await _service.DeleteHwAboutUsInfoDetailByUsInfoDetailIds(ParseLongArray(usInfoDetailIds)));
}
private static long[] ParseLongArray(string value) => value.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
}