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/contactUsInfo")]
|
|
public class HwContactUsInfoController : HwPortalControllerBase
|
|
{
|
|
private readonly HwContactUsInfoService _service;
|
|
|
|
public HwContactUsInfoController(HwContactUsInfoService service)
|
|
{
|
|
_service = service;
|
|
}
|
|
|
|
[HttpGet("list")]
|
|
public async Task<HwPortalTableDataInfo<HwContactUsInfo>> List([FromQuery] HwContactUsInfo input)
|
|
{
|
|
return GetDataTable(await _service.SelectHwContactUsInfoList(input));
|
|
}
|
|
|
|
[HttpPost("export")]
|
|
[Idempotent]
|
|
public async Task<IActionResult> Export([FromQuery] HwContactUsInfo input)
|
|
{
|
|
return ExportExcel(await _service.SelectHwContactUsInfoList(input), "联系我们数据");
|
|
}
|
|
|
|
[HttpGet("{contactUsInfoId:long}")]
|
|
public async Task<HwPortalAjaxResult> GetInfo(long contactUsInfoId)
|
|
{
|
|
return Success(await _service.SelectHwContactUsInfoByContactUsInfoId(contactUsInfoId));
|
|
}
|
|
|
|
[HttpPost]
|
|
[Idempotent]
|
|
public async Task<HwPortalAjaxResult> Add([FromBody] HwContactUsInfo input)
|
|
{
|
|
return ToAjax(await _service.InsertHwContactUsInfo(input));
|
|
}
|
|
|
|
[HttpPut]
|
|
[Idempotent]
|
|
public async Task<HwPortalAjaxResult> Edit([FromBody] HwContactUsInfo input)
|
|
{
|
|
return ToAjax(await _service.UpdateHwContactUsInfo(input));
|
|
}
|
|
|
|
[HttpDelete("{contactUsInfoIds}")]
|
|
[Idempotent]
|
|
public async Task<HwPortalAjaxResult> Remove(string contactUsInfoIds)
|
|
{
|
|
return ToAjax(await _service.DeleteHwContactUsInfoByContactUsInfoIds(ParseLongArray(contactUsInfoIds)));
|
|
}
|
|
|
|
private static long[] ParseLongArray(string value) => value.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
|
|
}
|