1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- 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 RoomController : ControllerBase
- {
- private IRoomService RoomService { get; set; }
- public RoomController(IRoomService roomService)
- {
- RoomService = roomService;
- }
- [HttpGet]
- public async Task<ResultMessage> GetRoomList(int pageIndex, int pageSize, Guid? buildingId, Guid? floorId)
- {
- return ResultMessage.Success(RoomService.GetRoomList(pageIndex, pageSize, buildingId, floorId));
- }
- [HttpGet]
- public async Task<ResultMessage> GetRoomById(Guid? roomId)
- {
- return ResultMessage.Success(await RoomService.GetRoomById(roomId));
- }
- [HttpPost]
- public async Task<ResultMessage> Delete([FromBody] dynamic inputObject)
- {
- List<Guid> roomIdList = inputObject.roomIdList.ToObject<List<Guid>>();
- return ResultMessage.Success(await RoomService.Delete(roomIdList));
- }
- [HttpPost]
- public async Task<ResultMessage> Save([FromBody] dynamic inputObj)
- {
- RoomView data = inputObj["data"].ToObject<RoomView>();
- return ResultMessage.Success(await RoomService.Save(data, LoginUser.Current.UserID));
- }
- [HttpGet]
- [AllowAnonymous]
- public async Task<ResultMessage> GetRoomDepOrServiceList()
- {
- return ResultMessage.Success(await RoomService.GetRoomDepOrServiceList());
- }
- }
- }
|