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.7 KiB
C#
56 lines
1.7 KiB
C#
namespace Admin.NET.Plugin.HwPortal;
|
|
|
|
[AllowAnonymous]
|
|
[Route("portal/aboutUsInfo")]
|
|
public class HwAboutUsInfoController : HwPortalControllerBase
|
|
{
|
|
private readonly HwAboutUsInfoService _service;
|
|
|
|
public HwAboutUsInfoController(HwAboutUsInfoService service)
|
|
{
|
|
_service = service;
|
|
}
|
|
|
|
[HttpGet("list")]
|
|
public async Task<HwPortalTableDataInfo<HwAboutUsInfo>> List([FromQuery] HwAboutUsInfo input)
|
|
{
|
|
return GetDataTable(await _service.SelectHwAboutUsInfoList(input));
|
|
}
|
|
|
|
[HttpPost("export")]
|
|
[Idempotent]
|
|
public async Task<IActionResult> Export([FromQuery] HwAboutUsInfo input)
|
|
{
|
|
return ExportExcel(await _service.SelectHwAboutUsInfoList(input), "关于我们数据");
|
|
}
|
|
|
|
[HttpGet("{aboutUsInfoId:long}")]
|
|
public async Task<HwPortalAjaxResult> GetInfo(long aboutUsInfoId)
|
|
{
|
|
return Success(await _service.SelectHwAboutUsInfoByAboutUsInfoId(aboutUsInfoId));
|
|
}
|
|
|
|
[HttpPost]
|
|
[Idempotent]
|
|
public async Task<HwPortalAjaxResult> Add([FromBody] HwAboutUsInfo input)
|
|
{
|
|
return ToAjax(await _service.InsertHwAboutUsInfo(input));
|
|
}
|
|
|
|
[HttpPut]
|
|
[Idempotent]
|
|
public async Task<HwPortalAjaxResult> Edit([FromBody] HwAboutUsInfo input)
|
|
{
|
|
return ToAjax(await _service.UpdateHwAboutUsInfo(input));
|
|
}
|
|
|
|
[HttpDelete("{aboutUsInfoIds}")]
|
|
[Idempotent]
|
|
public async Task<HwPortalAjaxResult> Remove(string aboutUsInfoIds)
|
|
{
|
|
return ToAjax(await _service.DeleteHwAboutUsInfoByAboutUsInfoIds(ParseLongArray(aboutUsInfoIds)));
|
|
}
|
|
|
|
private static long[] ParseLongArray(string value) => value.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
|
|
}
|