From 9058055e15216a7f6fd38e0cf9f55f1593b46111 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 11 May 2023 17:01:45 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=8D=B2=E5=8F=96=E6=A3=9F=E5=88=A5=E6=A8=93=E5=B1=A4api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiControllers/BuildController.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/FrontendWebApi/ApiControllers/BuildController.cs b/FrontendWebApi/ApiControllers/BuildController.cs index b390619..af06e51 100644 --- a/FrontendWebApi/ApiControllers/BuildController.cs +++ b/FrontendWebApi/ApiControllers/BuildController.cs @@ -690,5 +690,37 @@ namespace FrontendWebApi.ApiControllers return Ok(apiResult); } + + [HttpPost] + [Route("api/GetAllfloor")] + public async Task>>> GetAllfloor(string building_tag) + { + ApiResult> apiResult = new ApiResult>(jwt_str); + if (!jwtlife) + { + apiResult.Code = "5000"; + return BadRequest(apiResult); + } + try + { + string sWhere = $@" + SELECT + full_name + FROM floor + where building_guid = @building_tag and deleted = 0"; + var floor = await backendRepository.GetAllAsync(sWhere, new { building_tag = building_tag }); + + apiResult.Data = floor; + apiResult.Code = "0000"; + } + catch (Exception exception) + { + apiResult.Code = "9999"; + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + return Ok(apiResult); + } + return Ok(apiResult); + + } } }