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.
62 lines
1.8 KiB
C#
62 lines
1.8 KiB
C#
namespace Admin.NET.Plugin.HwPortal;
|
|
|
|
[AllowAnonymous]
|
|
[Route("portal/hwWebMenu")]
|
|
public class HwWebMenuController : HwPortalControllerBase
|
|
{
|
|
private readonly HwWebMenuService _service;
|
|
|
|
public HwWebMenuController(HwWebMenuService service)
|
|
{
|
|
_service = service;
|
|
}
|
|
|
|
[HttpGet("list")]
|
|
public async Task<HwPortalAjaxResult> List([FromQuery] HwWebMenu input)
|
|
{
|
|
return Success(await _service.SelectHwWebMenuList(input));
|
|
}
|
|
|
|
[HttpPost("export")]
|
|
[Idempotent]
|
|
public async Task<IActionResult> Export([FromQuery] HwWebMenu input)
|
|
{
|
|
return ExportExcel(await _service.SelectHwWebMenuList(input), "官网菜单数据");
|
|
}
|
|
|
|
[HttpGet("{webMenuId:long}")]
|
|
public async Task<HwPortalAjaxResult> GetInfo(long webMenuId)
|
|
{
|
|
return Success(await _service.SelectHwWebMenuByWebMenuId(webMenuId));
|
|
}
|
|
|
|
[HttpPost]
|
|
[Idempotent]
|
|
public async Task<HwPortalAjaxResult> Add([FromBody] HwWebMenu input)
|
|
{
|
|
return ToAjax(await _service.InsertHwWebMenu(input));
|
|
}
|
|
|
|
[HttpPut]
|
|
[Idempotent]
|
|
public async Task<HwPortalAjaxResult> Edit([FromBody] HwWebMenu input)
|
|
{
|
|
return ToAjax(await _service.UpdateHwWebMenu(input));
|
|
}
|
|
|
|
[HttpDelete("{webMenuIds}")]
|
|
[Idempotent]
|
|
public async Task<HwPortalAjaxResult> Remove(string webMenuIds)
|
|
{
|
|
return ToAjax(await _service.DeleteHwWebMenuByWebMenuIds(ParseLongArray(webMenuIds)));
|
|
}
|
|
|
|
[HttpGet("selectMenuTree")]
|
|
public async Task<HwPortalAjaxResult> SelectMenuTree([FromQuery] HwWebMenu input)
|
|
{
|
|
return Success(await _service.SelectMenuTree(input));
|
|
}
|
|
|
|
private static long[] ParseLongArray(string value) => value.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
|
|
}
|