123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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<ResultMessage> 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<ResultMessage> GetDepOrServicePointById(Guid? depOrServicePointId)
- {
- return ResultMessage.Success(await DepOrServicePointService.GetDepOrServicePointById(depOrServicePointId));
- }
- [HttpPost]
- public async Task<ResultMessage> Delete([FromBody] dynamic inputObject)
- {
- List<Guid> depOrServicePointIdList = inputObject.depOrServicePointIdList.ToObject<List<Guid>>();
- return ResultMessage.Success(await DepOrServicePointService.Delete(depOrServicePointIdList));
- }
- [HttpPost]
- public async Task<ResultMessage> Save([FromBody] dynamic inputObj)
- {
- DepOrServicePointView data = inputObj["data"].ToObject<DepOrServicePointView>();
- List<Guid> roomIdList = inputObj["roomIdList"].ToObject<List<Guid>>();
- return ResultMessage.Success(await DepOrServicePointService.Save(data, roomIdList, LoginUser.Current.UserID));
- }
- [HttpGet]
- public async Task<ResultMessage> GetRoomList(Guid depOrServicePointId)
- {
- return ResultMessage.Success(await DepOrServicePointService.GetRoomList(depOrServicePointId));
- }
- }
- }
|