namespace Admin.NET.Plugin.HwPortal; [AllowAnonymous] [Route("portal/portalConfig")] public class HwPortalConfigController : HwPortalControllerBase { private readonly HwPortalConfigService _configService; private readonly HwPortalConfigTypeService _configTypeService; public HwPortalConfigController(HwPortalConfigService configService, HwPortalConfigTypeService configTypeService) { _configService = configService; _configTypeService = configTypeService; } [HttpGet("list")] public async Task> List([FromQuery] HwPortalConfig input) { return GetDataTable(await _configService.SelectHwPortalConfigJoinList(input)); } [HttpPost("export")] [Idempotent] public async Task Export([FromQuery] HwPortalConfig input) { return ExportExcel(await _configService.SelectHwPortalConfigList(input), "门户配置数据"); } [HttpGet("{portalConfigId:long}")] public async Task GetInfo(long portalConfigId) { return Success(await _configService.SelectHwPortalConfigByPortalConfigId(portalConfigId)); } [HttpPost] [Idempotent] public async Task Add([FromBody] HwPortalConfig input) { return ToAjax(await _configService.InsertHwPortalConfig(input)); } [HttpPut] [Idempotent] public async Task Edit([FromBody] HwPortalConfig input) { return ToAjax(await _configService.UpdateHwPortalConfig(input)); } [HttpDelete("{portalConfigIds}")] [Idempotent] public async Task Remove(string portalConfigIds) { return ToAjax(await _configService.DeleteHwPortalConfigByPortalConfigIds(ParseLongArray(portalConfigIds))); } [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(); }