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.study
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class GetStudyClassListController : Controller
|
|
{
|
|
Competition.Mysql.BLL.pow_study_class study_class_bll = new Competition.Mysql.BLL.pow_study_class();
|
|
|
|
|
|
public GetStudyClassListController()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取学习分类列表数据接口
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[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, "发生错误,请联系管理员。"));
|
|
}
|
|
}
|
|
}
|
|
}
|