コード例 #1
0
        public void GetEcg()
        {
            GetEcg ecg = new GetEcg(client);

            var ecgRes = ecg.Do("00001").Result;

            Assert.AreEqual("36.5", ecgRes.Ates);
            Assert.AreEqual(501, ecgRes.Avf.Count);
            Assert.AreEqual(501, ecgRes.Avl.Count);
            Assert.AreEqual(501, ecgRes.Avr.Count);
        }
コード例 #2
0
        public IActionResult GetMeasurement(string id)
        {
            Measurement measurement;

            if (!_cache.TryGetValue(id, out measurement))
            {
                var cacheExpOptions = new MemoryCacheEntryOptions
                {
                    AbsoluteExpiration = DateTime.Now.AddMinutes(30)
                };

                measurement = new GetEcg(_client).Do(id).Result;
                _cache.Set(id, measurement, cacheExpOptions);
            }
            return(Ok(measurement));
        }