using Competition.Common.Util; using CompetitionAPI.Util; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace CompetitionAPI.Controllers.unity.study { [Route("unity/[controller]")] [ApiController] public class GetStudyClassListController : Controller { Competition.Mysql.BLL.pow_study_class study_class_bll = new Competition.Mysql.BLL.pow_study_class(); public GetStudyClassListController() { } /// /// 获取学习分类数据接口 /// /// [Authorize] [HttpGet] [APIFilter] public JsonResult Index() { try { var list = study_class_bll.GetModelList(" 1=1 order by CreateTime desc "); return Json(Tool.GetJsonWithCode(APICode.Success, list)); } catch (Exception ex) { LogHelper.WriteLog(ex.Message + ",行号:" + ex.StackTrace); return Json(Tool.GetJsonWithCode(APICode.Fail, "发生错误,请联系管理员。")); } } } }