using log4net; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Ropin.Inspection.Service.MTN.Interface; using Ropin.Inspection.Service; using Ropin.Inspection.Api.Common; using Ropin.Inspection.Model.SearchModel.MTN; using Ropin.Inspection.Model.ViewModel.MTN; using Ropin.Inspection.Model; using System.Threading.Tasks; using System; namespace Ropin.Inspection.Api.Controllers.MTN { [Route("api/[controller]")] [ApiController] public class mtnAlarmShadowRecordController : BaseController { private readonly ImtnAlarmShadowRecordService _repository; private static readonly ILog log = LogManager.GetLogger(typeof(mtnAlarmShadowRecordController)); /// /// 构造函数 /// /// public mtnAlarmShadowRecordController(ImtnAlarmShadowRecordService repository) { _repository = repository; } /// /// 报警影像记录列表 /// /// /// [HttpPost("GetPageAsync")] public async Task GetPageAsync(AlarmShadowRecordSearch searchModel) { if (searchModel == null) { return new ApiResult(ReturnCode.ArgsError); } try { var contentList = await _repository.GetConditionAsync(searchModel); return new ApiResult>(new PagesModel(contentList, searchModel)); } catch (Exception ex) { return new ApiResult(ReturnCode.GeneralError, ex.Message); } } } }