using Competition.Common.Util; using CompetitionAPI.Util; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace CompetitionAPI.Controllers.back { [Route("api/[controller]")] [ApiController] public class GetExamDetailsController : Controller { Competition.Mysql.BLL.pow_exam exam_bll = new Competition.Mysql.BLL.pow_exam(); public GetExamDetailsController() { } /// /// 获取单条考试数据接口 /// /// 考试id /// [Authorize] [HttpGet] [APIFilter] public JsonResult Index(string ExamId) { try { var model = exam_bll.GetAreaList(" ExamId='" + ExamId + "' ").FirstOrDefault(); //var model = exam_bll.GetModel(ExamId); return Json(Tool.GetJsonWithCode(APICode.Success, model)); } catch (Exception ex) { LogHelper.WriteLog(ex.Message + ",行号:" + ex.StackTrace); return Json(Tool.GetJsonWithCode(APICode.Fail, "发生错误,请联系管理员。")); } } } }