using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;
using System.Xml.Serialization;
using NewLife;
using NewLife.Data;
using NewLife.Reflection;
namespace JT808.Data;
/// <summary>媒体记录。多媒体文件上传记录</summary>
public partial class MediaRecordModel : IModel
{
#region 属性
/// <summary>编号</summary>
public Int64 Id { get; set; }
/// <summary>设备编号</summary>
public Int32 DeviceId { get; set; }
/// <summary>手机号</summary>
public String? Mobile { get; set; }
/// <summary>多媒体编号</summary>
public Int64 MediaId { get; set; }
/// <summary>状态。0-上传中 1-已完成 2-失败</summary>
public Int32 Status { get; set; }
/// <summary>创建时间</summary>
public DateTime CreateTime { get; set; }
/// <summary>更新时间</summary>
public DateTime UpdateTime { get; set; }
#endregion
#region 获取/设置 字段值
/// <summary>获取/设置 字段值</summary>
/// <param name="name">字段名</param>
/// <returns></returns>
public virtual Object? this[String name]
{
get
{
return name switch
{
"Id" => Id,
"DeviceId" => DeviceId,
"Mobile" => Mobile,
"MediaId" => MediaId,
"Status" => Status,
"CreateTime" => CreateTime,
"UpdateTime" => UpdateTime,
_ => this.GetValue(name, false),
};
}
set
{
switch (name)
{
case "Id": Id = value.ToLong(); break;
case "DeviceId": DeviceId = value.ToInt(); break;
case "Mobile": Mobile = Convert.ToString(value); break;
case "MediaId": MediaId = value.ToLong(); break;
case "Status": Status = value.ToInt(); break;
case "CreateTime": CreateTime = value.ToDateTime(); break;
case "UpdateTime": UpdateTime = value.ToDateTime(); break;
default: this.SetValue(name, value); break;
}
}
}
#endregion
#region 拷贝
/// <summary>拷贝模型对象</summary>
/// <param name="model">模型</param>
public void Copy(IMediaRecord model)
{
Id = model.Id;
DeviceId = model.DeviceId;
Mobile = model.Mobile;
MediaId = model.MediaId;
Status = model.Status;
CreateTime = model.CreateTime;
UpdateTime = model.UpdateTime;
}
#endregion
}
|