namespace Admin.NET.Plugin.HwPortal; [AllowAnonymous] [Route("portal/productCaseInfo")] public class HwProductCaseInfoController : HwPortalControllerBase { private readonly HwProductCaseInfoService _caseInfoService; private readonly HwPortalConfigTypeService _configTypeService; public HwProductCaseInfoController(HwProductCaseInfoService caseInfoService, HwPortalConfigTypeService configTypeService) { _caseInfoService = caseInfoService; _configTypeService = configTypeService; } [HttpGet("list")] public async Task> List([FromQuery] HwProductCaseInfo input) { return GetDataTable(await _caseInfoService.SelectHwProductCaseInfoList(input)); } [HttpPost("export")] [Idempotent] public async Task Export([FromQuery] HwProductCaseInfo input) { return ExportExcel(await _caseInfoService.SelectHwProductCaseInfoList(input), "案例信息数据"); } [HttpGet("{caseInfoId:long}")] public async Task GetInfo(long caseInfoId) { return Success(await _caseInfoService.SelectHwProductCaseInfoByCaseInfoId(caseInfoId)); } [HttpPost] [Idempotent] public async Task Add([FromBody] HwProductCaseInfo input) { return ToAjax(await _caseInfoService.InsertHwProductCaseInfo(input)); } [HttpPut] [Idempotent] public async Task Edit([FromBody] HwProductCaseInfo input) { return ToAjax(await _caseInfoService.UpdateHwProductCaseInfo(input)); } [HttpDelete("{caseInfoIds}")] [Idempotent] public async Task Remove(string caseInfoIds) { return ToAjax(await _caseInfoService.DeleteHwProductCaseInfoByCaseInfoIds(ParseLongArray(caseInfoIds))); } [HttpGet("portalConfigTypeTree")] public async Task PortalConfigTypeTree([FromQuery] HwPortalConfigType input) { return Success(await _configTypeService.SelectPortalConfigTypeTreeList(input)); } private static long[] ParseLongArray(string value) => value.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray(); }