43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
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()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据台区获取线路接口
|
|
/// </summary>
|
|
/// <param name="PlatformAreaId">台区id</param>
|
|
/// <returns></returns>
|
|
[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, "发生错误,请联系管理员。"));
|
|
}
|
|
}
|
|
}
|
|
}
|