You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.7 KiB
74 lines
1.7 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace HardWareInteface.Common
|
|
{
|
|
/// <summary>
|
|
/// 图片缓存模型
|
|
/// </summary>
|
|
public class FaceRecCacheModel
|
|
{
|
|
/// <summary>
|
|
/// 最后一次更新时间
|
|
/// </summary>
|
|
public DateTime updtm { get; set; }
|
|
|
|
private string picurl;
|
|
/// <summary>
|
|
/// 图片地址
|
|
/// </summary>
|
|
public string PicUrl
|
|
{
|
|
get
|
|
{
|
|
return picurl;
|
|
}
|
|
set
|
|
{
|
|
picurl = value;
|
|
updtm = DateTime.Now;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 现在时间和历史存储时间比较
|
|
/// true 需要保存图片,更新键值对 false 不需要
|
|
/// </summary>
|
|
public bool ChangeTime
|
|
{
|
|
get
|
|
{
|
|
if (updtm == null) // 时间为空
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
//现在时间和历史存储时间比较是否大于一分钟
|
|
TimeSpan ts = DateTime.Now - updtm;
|
|
if (ts.TotalMinutes > 1)
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public static class FaceRecCache
|
|
{
|
|
public static Dictionary<string, FaceRecCacheModel> dic = new Dictionary<string, FaceRecCacheModel>();
|
|
}
|
|
}
|