using Competition.Common.Util; using CompetitionAPI.Util; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace CompetitionAPI.Controllers.back { [Route("api/[controller]")] [ApiController] public class GetPlatformAreaController : Controller { Competition.Mysql.BLL.pow_platform_area platform_area_bll = new Competition.Mysql.BLL.pow_platform_area(); public GetPlatformAreaController() { } /// /// 根据场景获取台区接口 /// /// 场景id /// [Authorize] [HttpGet] [APIFilter] public JsonResult Index(string SceneId) { try { var list = platform_area_bll.GetModelList(" SceneId='" + SceneId + "' "); return Json(Tool.GetJsonWithCode(APICode.Success, list)); } catch (Exception ex) { LogHelper.WriteLog(ex.Message + ",行号:" + ex.StackTrace); return Json(Tool.GetJsonWithCode(APICode.Fail, "发生错误,请联系管理员。")); } } } }