|
@@ -18,6 +18,7 @@ namespace HealthMonitor.Service.Cache |
|
|
private const string CACHE_KEY_GPSDEVICE_WATCH_CONFIG = "#GPSDEVICE_WATCH_CONFIG_HASH"; |
|
|
private const string CACHE_KEY_GPSDEVICE_WATCH_CONFIG = "#GPSDEVICE_WATCH_CONFIG_HASH"; |
|
|
private const string CACHE_KEY_FETALMOVEMENT = "FM_"; |
|
|
private const string CACHE_KEY_FETALMOVEMENT = "FM_"; |
|
|
private const string CACHE_KEY_FETALHEARTRATE = "FHR_"; |
|
|
private const string CACHE_KEY_FETALHEARTRATE = "FHR_"; |
|
|
|
|
|
private const string CACHE_KEY_PHRFREQSTATUS = "PhrFreqStatus_"; |
|
|
|
|
|
|
|
|
private readonly GpsLocationHistoryAccessorClient<HisGpsFetalMovement> _hisFetalMovementApiClient; |
|
|
private readonly GpsLocationHistoryAccessorClient<HisGpsFetalMovement> _hisFetalMovementApiClient; |
|
|
private readonly GpsLocationHistoryAccessorClient<HisGpsFetalHeartRate> _hisFetalHeartRateApiClient; |
|
|
private readonly GpsLocationHistoryAccessorClient<HisGpsFetalHeartRate> _hisFetalHeartRateApiClient; |
|
@@ -86,7 +87,7 @@ namespace HealthMonitor.Service.Cache |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
var key = $"PhrFreqStatus_{sn}"; |
|
|
|
|
|
|
|
|
var key = CACHE_KEY_PHRFREQSTATUS+sn; |
|
|
var status = await RedisHelper.GetAsync(key).ConfigureAwait(false); |
|
|
var status = await RedisHelper.GetAsync(key).ConfigureAwait(false); |
|
|
if (string.IsNullOrEmpty(status)) return null; |
|
|
if (string.IsNullOrEmpty(status)) return null; |
|
|
return JsonConvert.DeserializeObject<PregnancyHeartRateModel>(status); |
|
|
return JsonConvert.DeserializeObject<PregnancyHeartRateModel>(status); |
|
@@ -102,7 +103,7 @@ namespace HealthMonitor.Service.Cache |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
var key = $"PhrFreqStatus_{sn}"; |
|
|
|
|
|
|
|
|
var key = CACHE_KEY_PHRFREQSTATUS + sn; |
|
|
var data=JsonConvert.SerializeObject(status); |
|
|
var data=JsonConvert.SerializeObject(status); |
|
|
await RedisHelper.SetAsync(key, data, expire).ConfigureAwait(false); |
|
|
await RedisHelper.SetAsync(key, data, expire).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
@@ -116,7 +117,7 @@ namespace HealthMonitor.Service.Cache |
|
|
{ |
|
|
{ |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
var key = $"PregnancyHeartRateFreqStatus_{sn}"; |
|
|
|
|
|
|
|
|
var key = CACHE_KEY_PHRFREQSTATUS + sn; |
|
|
await RedisHelper.DelAsync(key).ConfigureAwait(false); |
|
|
await RedisHelper.DelAsync(key).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
catch (Exception ex) |
|
|