123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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<PageResult<Sys_AirCompany>> QueryPage([FromBody] QueryModel model)
- {
- var pageResult = await AirCompanyService.QueryAirCompany(model);
- return pageResult;
- }
- [HttpGet]
- public async Task<IEnumerable<Sys_AirCompany>> GetAllAirCompany()
- {
- return (await AirCompanyService.GetAirCompanyList()).OrderBy(x => x.Name).ToList();
- }
- [HttpPost]
- public async Task<ApiJsonModel> Add([FromBody] Sys_AirCompany ServiceProvider)
- {
- await AirCompanyService.InsertAirCompany(ServiceProvider);
- return ApiJsonModel.OK();
- }
- [HttpPost]
- public async Task<ApiJsonModel> Update([FromBody] Sys_AirCompany ServiceProvider)
- {
- await AirCompanyService.UpdateAirCompany(ServiceProvider);
- return ApiJsonModel.OK();
- }
- [HttpPost]
- public async Task<ApiJsonModel> Delete([FromBody] Sys_AirCompany ServiceProvider)
- {
- await AirCompanyService.DeleteAirCompany(ServiceProvider);
- return ApiJsonModel.OK();
- }
- }
- }
|