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.study
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class GetStudyClassDetailsController : Controller
|
|
{
|
|
Competition.Mysql.BLL.pow_study_class study_class_bll = new Competition.Mysql.BLL.pow_study_class();
|
|
|
|
|
|
public GetStudyClassDetailsController()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取单条学习分类数据接口
|
|
/// </summary>
|
|
/// <param name="StudyClassId">学习分类id</param>
|
|
/// <returns></returns>
|
|
[Authorize]
|
|
[HttpGet]
|
|
[APIFilter]
|
|
public JsonResult Index(string StudyClassId)
|
|
{
|
|
try
|
|
{
|
|
var model = study_class_bll.GetModel(StudyClassId);
|
|
return Json(Tool.GetJsonWithCode(APICode.Success, model));
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.WriteLog(ex.Message + ",行号:" + ex.StackTrace);
|
|
return Json(Tool.GetJsonWithCode(APICode.Fail, "发生错误,请联系管理员。"));
|
|
}
|
|
}
|
|
}
|
|
}
|