44 lines
1.3 KiB
C#
44 lines
1.3 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.score
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class GetExamDownController : Controller
|
|
{
|
|
Competition.Mysql.BLL.pow_exam exam_bll = new Competition.Mysql.BLL.pow_exam();
|
|
|
|
public GetExamDownController()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取视频回放接口
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[Authorize]
|
|
[HttpGet]
|
|
[APIFilter]
|
|
public JsonResult Index()
|
|
{
|
|
try
|
|
{
|
|
var list = exam_bll.GetModelList(" Status!='未发布' and Type='考试' ");
|
|
var data = (from l in list
|
|
select new { ExamId = l.ExamId, ExamName = l.ExamName }).ToList();
|
|
return Json(Tool.GetJsonWithCode(APICode.Success, data));
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.WriteLog(ex.Message + ",行号:" + ex.StackTrace);
|
|
return Json(Tool.GetJsonWithCode(APICode.Fail, "发生错误,请联系管理员。"));
|
|
}
|
|
}
|
|
}
|
|
}
|