using Bowin.Common.WebModels; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using YLShipBuildLandMap.Entity.ViewModel; using YLShipBuildLandMap.Entity.ViewModel.Build; using YLShipBuildLandMap.Services.Build; namespace YLShipBuildLandMap.Web.Controllers.Build { [Route("api/build/[controller]/[action]")] [Authorize] [ApiController] public class DepOrServiceController : ControllerBase { private IDepOrServicePointService DepOrServicePointService { get; set; } public DepOrServiceController(IDepOrServicePointService depOrServicePointService) { DepOrServicePointService = depOrServicePointService; } [HttpGet] public async Task GetDepOrServicePointList(int pageIndex, int pageSize, Guid? buildingId, Guid? floorId,string name) { return ResultMessage.Success(DepOrServicePointService.GetDepOrServicePointList(pageIndex, pageSize, buildingId, floorId, name)); } [HttpGet] public async Task GetDepOrServicePointById(Guid? depOrServicePointId) { return ResultMessage.Success(await DepOrServicePointService.GetDepOrServicePointById(depOrServicePointId)); } [HttpPost] public async Task Delete([FromBody] dynamic inputObject) { List depOrServicePointIdList = inputObject.depOrServicePointIdList.ToObject>(); return ResultMessage.Success(await DepOrServicePointService.Delete(depOrServicePointIdList)); } [HttpPost] public async Task Save([FromBody] dynamic inputObj) { DepOrServicePointView data = inputObj["data"].ToObject(); List roomIdList = inputObj["roomIdList"].ToObject>(); return ResultMessage.Success(await DepOrServicePointService.Save(data, roomIdList, LoginUser.Current.UserID)); } [HttpGet] public async Task GetRoomList(Guid depOrServicePointId) { return ResultMessage.Success(await DepOrServicePointService.GetRoomList(depOrServicePointId)); } } }