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 GetLineController : Controller { Competition.Mysql.BLL.pow_line line_bll = new Competition.Mysql.BLL.pow_line(); public GetLineController() { } /// /// 根据台区获取线路接口 /// /// 台区id /// [Authorize] [HttpGet] [APIFilter] public JsonResult Index(string PlatformAreaId) { try { var list = line_bll.GetModelList(" PlatformAreaId='" + PlatformAreaId + "' "); return Json(Tool.GetJsonWithCode(APICode.Success, list)); } catch (Exception ex) { LogHelper.WriteLog(ex.Message + ",行号:" + ex.StackTrace); return Json(Tool.GetJsonWithCode(APICode.Fail, "发生错误,请联系管理员。")); } } } }