123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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));
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="repository"></param>
- public mtnAlarmShadowRecordController(ImtnAlarmShadowRecordService repository)
- {
- _repository = repository;
- }
- /// <summary>
- /// 报警影像记录列表
- /// </summary>
- /// <param name="searchModel"></param>
- /// <returns></returns>
- [HttpPost("GetPageAsync")]
- public async Task<ApiResult> GetPageAsync(AlarmShadowRecordSearch searchModel)
- {
- if (searchModel == null)
- {
- return new ApiResult(ReturnCode.ArgsError);
- }
- try
- {
- var contentList = await _repository.GetConditionAsync(searchModel);
- return new ApiResult<PagesModel<AlarmShadowRecordModel>>(new PagesModel<AlarmShadowRecordModel>(contentList, searchModel));
- }
- catch (Exception ex)
- {
- return new ApiResult(ReturnCode.GeneralError, ex.Message);
- }
- }
- }
- }
|