123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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));
- }
- }
- }
|