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 GetPlatformAreaController : Controller
|
|
{
|
|
Competition.Mysql.BLL.pow_platform_area platform_area_bll = new Competition.Mysql.BLL.pow_platform_area();
|
|
|
|
public GetPlatformAreaController()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据场景获取台区接口
|
|
/// </summary>
|
|
/// <param name="SceneId">场景id</param>
|
|
/// <returns></returns>
|
|
[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, "发生错误,请联系管理员。"));
|
|
}
|
|
}
|
|
}
|
|
}
|