43 lines
1.3 KiB
C#
43 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
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class GetFaultListController : Controller
|
|
{
|
|
Competition.Mysql.BLL.pow_exam_fault exam_fault_bll = new Competition.Mysql.BLL.pow_exam_fault();
|
|
|
|
public GetFaultListController()
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据单个故障树获取故障数据接口
|
|
/// </summary>
|
|
/// <param name="ExamId">考试id</param>
|
|
/// <param name="Id">id</param>
|
|
/// <returns></returns>
|
|
[Authorize]
|
|
[HttpGet]
|
|
[APIFilter]
|
|
public JsonResult Index(string ExamId, string Id)
|
|
{
|
|
try
|
|
{
|
|
var fault_list = exam_fault_bll.GetModelList(" ExamId = '" + ExamId + "' and DeviceId='" + Id + "' order by CreateTime asc ");
|
|
return Json(Tool.GetJsonWithCode(APICode.Success, fault_list));
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.WriteLog(ex.Message + ",行号:" + ex.StackTrace);
|
|
return Json(Tool.GetJsonWithCode(APICode.Fail, "发生错误,请联系管理员。"));
|
|
}
|
|
}
|
|
}
|
|
}
|