tangxu
2023-04-10 7f8ba13a353ed3da5efbbbf623d586428f4bce96
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using Microsoft.AspNetCore.Mvc;
using System.Net;
using System.Net.Http.Headers;
using Microsoft.Extensions.Hosting.Internal;
using Microsoft.AspNetCore.Http.Extensions;
using IStation.Untity;
using Furion.DynamicApiController;
using System.ComponentModel.DataAnnotations;
using Mapster;
 
 
 
namespace IStation.Application
{
    /// <summary>
    /// EtaSingleRealRecord
    /// </summary>
    [Route("Eta/EtaSingleRealRecord")]
    [ApiDescriptionSettings("Eta", Name = "能效(单)实时记录", Order = 1000)]
    public class EtaSingleRealRecord_Controller : IDynamicApiController 
    {
        private readonly Service.EtaSingleRealRecord _service = new Service.EtaSingleRealRecord();
 
        /// <summary>
        /// 获取最近一条记录
        /// </summary>
        [Route("GetLastRecord@V1.0")]
        [HttpGet]
        public EtaSingleRealRecordDto GetLastRecord([FromQuery][Required] ObjectUnderCorpInput input)
        {
            var model = _service.GetLastRecord(input.CorpID,input.ObjectType,input.ObjectID);
            return model?.Adapt<Model.EtaSingleRealRecordPure,EtaSingleRealRecordDto>();
        }
 
        /// <summary>
        /// 获取最近一条记录列表
        /// </summary>
        [Route("GetLastRecordList@V1.0")]
        [HttpGet]
        public List<EtaSingleRealRecordDto> GetLastRecordList([FromQuery][Required] ObjectIdsUnderCorpInput input)
        {
            var list = _service.GetLastRecord(input.CorpID, input.ObjectType, LongListHelper.ToList(input.ObjectIds));
            return list?.Select(x => x.Adapt<Model.EtaSingleRealRecordPure, EtaSingleRealRecordDto>()).ToList();
        }
 
        /// <summary>
        /// 获取最近一条正常记录
        /// </summary>
        [Route("GetLastNormalRecord@V1.0")]
        [HttpGet]
        public EtaSingleRealRecordDto GetLastNormalRecord([FromQuery][Required] ObjectUnderCorpInput input)
        {
            var model = _service.GetLastNormalRecord(input.CorpID, input.ObjectType, input.ObjectID);
            return model?.Adapt<Model.EtaSingleRealRecordPure, EtaSingleRealRecordDto>();
        }
 
 
 
 
    }
}