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/productInfoDetail")]
public class HwProductInfoDetailController : HwPortalControllerBase
{
private readonly HwProductInfoDetailService _service;
public HwProductInfoDetailController(HwProductInfoDetailService service)
{
_service = service;
}
[HttpGet("list")]
public async Task<HwPortalAjaxResult> List([FromQuery] HwProductInfoDetail input)
{
return Success(await _service.SelectHwProductInfoDetailList(input));
}
[HttpPost("export")]
[Idempotent]
public async Task<IActionResult> Export([FromQuery] HwProductInfoDetail input)
{
return ExportExcel(await _service.SelectHwProductInfoDetailList(input), "产品明细数据");
}
[HttpGet("{productInfoDetailId:long}")]
public async Task<HwPortalAjaxResult> GetInfo(long productInfoDetailId)
{
return Success(await _service.SelectHwProductInfoDetailByProductInfoDetailId(productInfoDetailId));
}
[HttpPost]
[Idempotent]
public async Task<HwPortalAjaxResult> Add([FromBody] HwProductInfoDetail input)
{
return ToAjax(await _service.InsertHwProductInfoDetail(input));
}
[HttpPut]
[Idempotent]
public async Task<HwPortalAjaxResult> Edit([FromBody] HwProductInfoDetail input)
{
return ToAjax(await _service.UpdateHwProductInfoDetail(input));
}
[HttpDelete("{productInfoDetailIds}")]
[Idempotent]
public async Task<HwPortalAjaxResult> Remove(string productInfoDetailIds)
{
return ToAjax(await _service.DeleteHwProductInfoDetailByProductInfoDetailIds(ParseLongArray(productInfoDetailIds)));
}
private static long[] ParseLongArray(string value) => value.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
}