using Microsoft.AspNetCore.Mvc; using SMP.Model; using SMP.Service; using SMP.Service.ProviderServices.Dto; using XYY.Common.Standard; using XYY.Core.Standard.Mvc; namespace SMP.Api.Base.Controllers { [ApiController] [Route("[controller]/[action]")] public class AirCompanyController : ControllerBase { public AirCompanyController(ISysAirCompanyService airCompanyService) { AirCompanyService = airCompanyService; } public ISysAirCompanyService AirCompanyService { get; } [HttpPost] public async Task> QueryPage([FromBody] QueryModel model) { var pageResult = await AirCompanyService.QueryAirCompany(model); return pageResult; } [HttpGet] public async Task> GetAllAirCompany() { return (await AirCompanyService.GetAirCompanyList()).OrderBy(x => x.Name).ToList(); } [HttpPost] public async Task Add([FromBody] Sys_AirCompany ServiceProvider) { await AirCompanyService.InsertAirCompany(ServiceProvider); return ApiJsonModel.OK(); } [HttpPost] public async Task Update([FromBody] Sys_AirCompany ServiceProvider) { await AirCompanyService.UpdateAirCompany(ServiceProvider); return ApiJsonModel.OK(); } [HttpPost] public async Task Delete([FromBody] Sys_AirCompany ServiceProvider) { await AirCompanyService.DeleteAirCompany(ServiceProvider); return ApiJsonModel.OK(); } } }