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 GetSceneController : Controller { Competition.Mysql.BLL.pow_scene scene_bll = new Competition.Mysql.BLL.pow_scene(); public GetSceneController() { } /// /// 获取场景接口 /// /// [Authorize] [HttpGet] [APIFilter] public JsonResult Index() { try { var list = scene_bll.GetModelList(""); return Json(Tool.GetJsonWithCode(APICode.Success, list)); } catch (Exception ex) { LogHelper.WriteLog(ex.Message + ",行号:" + ex.StackTrace); return Json(Tool.GetJsonWithCode(APICode.Fail, "发生错误,请联系管理员。")); } } } }