diff --git a/CoreCms.Net.Web.WebApi/Controllers/SQController.cs b/CoreCms.Net.Web.WebApi/Controllers/SQController.cs index 8e4d2bb..a90d0f7 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/SQController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/SQController.cs @@ -191,6 +191,38 @@ public class SQController : ControllerBase } + /// + /// 根据预约ID获取详情(结构同首页预约列表单项) + /// + /// 预约ID + /// + [HttpGet] + public async Task GetReservationDetail([FromQuery] int id) + { + var userId = _user.ID; + var model = await _SQReservationsServices.QueryByIdAsync(id); + if (model == null) + { + return new WebApiDto + { + Code = -1, + Msg = "预约不存在", + }; + } + + var dto = _mapper.Map(model); + var roomList = await _SQRoomsServices.GetRoomList(); + var baseList = new List { dto }; + await baseList.LoadSQReservationParticipantsApiDto(userId, _dbBase, _coreCmsUserBlacklistServices, roomList, _mapper); + + return new WebApiDto + { + Data = dto, + Code = 0, + Msg = "ok", + }; + } + /// /// 获取预约评价 /// diff --git a/CoreCms.Net.Web.WebApi/Doc.xml b/CoreCms.Net.Web.WebApi/Doc.xml index 4efe59c..bda8963 100644 --- a/CoreCms.Net.Web.WebApi/Doc.xml +++ b/CoreCms.Net.Web.WebApi/Doc.xml @@ -799,6 +799,13 @@ + + + 根据预约ID获取详情(结构同首页预约列表单项) + + 预约ID + + 获取预约评价