ibms-dome/FrontendWebApi/Models/Alert.cs
2022-11-10 11:08:24 +08:00

33 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
namespace FrontendWebApi.Models
{
public class Alert
{
public string buildingFloorName { get; set; } //building_name and floor_name
public string uuid { get; set; } //error_code
public string alarmClass { get; set; } //error_type
public string msgText { get; set; } //error_reason
public string sourceName_zh { get; set; } //device_number
public string ackState { get; set; } //ACKconfirm: Acked/Unacked
public DateTime timestamp { get; set; }//發生時間 occur time
public string formId { get; set; }
public string ackState_zh
{
get
{
Dictionary<string, string> name = new Dictionary<string, string>()
{
{ "Acked" , "確認" },
{ "Unacked" , "未確認" }
};
return name[ackState];
}
}
public string created_at { get { return timestamp.ToString(); } set { } }
public string Created_at { get { return Convert.ToDateTime(created_at).ToString("yyyy-MM-dd HH:mm:ss"); } set { created_at = value; } } //發生時間顯示
}
}