diff --git a/YD_YiLu/Context/SmartSportsContext.cs b/YD_YiLu/Context/SmartSportsContext.cs index a9385c5..6fac0d5 100644 --- a/YD_YiLu/Context/SmartSportsContext.cs +++ b/YD_YiLu/Context/SmartSportsContext.cs @@ -26,7 +26,7 @@ namespace YD_YiShi.Api.Context public DbSet XW_ProjectMode { get; set; } public DbSet XW_TestingProject { get; set; } - public DbSet XW_Device { get; set; } + public DbSet XW_Device { get; set; } public DbSet XW_SportsTestData { get; set; } public DbSet XW_TrainStudents { get; set; } public DbSet XW_TrainSetting { get; set; } diff --git a/YD_YiLu/SmartSportsEntitys/YL_Device.cs b/YD_YiLu/SmartSportsEntitys/YL_Device.cs new file mode 100644 index 0000000..40ee571 --- /dev/null +++ b/YD_YiLu/SmartSportsEntitys/YL_Device.cs @@ -0,0 +1,105 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using YD_YiShi.Api.Entitys; + +namespace VOL.Entity.DomainModels.XinWei +{ + /// + /// 运动小站设备表 + /// + [Table("YL_Device")] + public class YL_Device + { + /// + /// 主键ID + /// + [Key] + public long Id { get; set; } + + /// + /// 运动小站ID + /// + public long SportStationId { get; set; } + + /// + /// 运动小站名称 + /// + [MaxLength(100)] + public string Name { get; set; } + + /// + /// 客户名称(租户名称) + /// + [MaxLength(100)] + public string TenantName { get; set; } + + /// + /// 设备唯一序列号(唯一约束) + /// + [Required] + [MaxLength(64)] + public string SerialNumber { get; set; } + + /// + /// Android Id(预留字段) + /// + [MaxLength(64)] + public string AndroidId { get; set; } + + /// + /// IMEI(预留字段) + /// + [MaxLength(64)] + public string IMEI { get; set; } + + /// + /// IMSI(预留字段) + /// + [MaxLength(64)] + public string IMSI { get; set; } + + /// + /// 是否已标定 0=否 1=是 + /// + public int IsCalibration { get; set; } + + /// + /// 是否开启数据同步 0=否 1=是 + /// + public int IsSynchronization { get; set; } + + /// + /// 是否激活 0=未激活 1=已激活 + /// + public int IsActive { get; set; } + + /// + /// 是否在线 0=离线 1=在线 + /// + public int IsOnline { get; set; } + + /// + /// 最后一次在线时间 + /// + public DateTime? LastOnlineTime { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 更新时间 + /// + public DateTime? UpdateTime { get; set; } + + /// + /// 备注 + /// + [MaxLength(500)] + public string Remark { get; set; } + } +} diff --git a/YD_YiLu/SmartSportsEntitys/YL_Train.cs b/YD_YiLu/SmartSportsEntitys/YL_Train.cs new file mode 100644 index 0000000..ec1d221 --- /dev/null +++ b/YD_YiLu/SmartSportsEntitys/YL_Train.cs @@ -0,0 +1,129 @@ +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace YD_YiLu.Api.SmartSportsEntitys +{ + /// + /// 训练成绩表 + /// + [Table("YL_Train")] + [Index(nameof(TrainSerial), IsUnique = true)] // 训练序列号唯一 + [Index(nameof(DeviceSerial))] + [Index(nameof(UserSerial))] + [Index(nameof(CourseId))] + public class YL_Train + { + /// + /// 主键ID + /// + [Key] + public long Id { get; set; } + + /// + /// 设备序列号(设备唯一标识) + /// + [Required] + [MaxLength(64)] + public string DeviceSerial { get; set; } + + /// + /// 设备类型 + /// + public int DeviceType { get; set; } + + /// + /// 人员编号 + /// + [Required] + [MaxLength(64)] + public string UserSerial { get; set; } + + /// + /// 单次训练唯一序列号(唯一字段) + /// + [Required] + [MaxLength(64)] + public string TrainSerial { get; set; } + + /// + /// 视频序列号(多人共用,可重复) + /// + [Required] + [MaxLength(64)] + public string VideoSerial { get; set; } + + /// + /// 是否测验任务 0=否 1=是 + /// + public int TrainExam { get; set; } + + /// + /// 测验任务ID(自由练习可为空) + /// + public int? QuizId { get; set; } + + /// + /// 有效个数 + /// + public int StandardCounts { get; set; } + + /// + /// 不合格动作数 + /// + public int UnStandardCounts { get; set; } + + /// + /// 有效时长(秒) + /// 计时类课目使用,如悬垂 + /// + public double? TimeKeeping { get; set; } + + /// + /// 训练持续时间(秒) + /// + public int Duration { get; set; } + + /// + /// 距离(米) + /// 跳远类课目使用 + /// + public double? Distance { get; set; } + + /// + /// 课目ID + /// + public int CourseId { get; set; } + + /// + /// 开始时间 + /// + public DateTime StartTime { get; set; } + + /// + /// 结束时间 + /// + public DateTime EndTime { get; set; } + + /// + /// 成绩值(统一换算后的成绩,用于排序) + /// + public double? Score { get; set; } + + /// + /// 是否有效成绩 0=否 1=是 + /// + public int IsValid { get; set; } + + /// + /// 数据上报时间 + /// + public DateTime UploadTime { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + } +} \ No newline at end of file diff --git a/YD_YiLu/SmartSportsEntitys/YS_Device.cs b/YD_YiLu/SmartSportsEntitys/YS_Device.cs deleted file mode 100644 index 6079f9b..0000000 --- a/YD_YiLu/SmartSportsEntitys/YS_Device.cs +++ /dev/null @@ -1,201 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using YD_YiShi.Api.Entitys; - -namespace VOL.Entity.DomainModels.XinWei -{ - /// - /// 设备表 - /// - [Table("YS_Device")] - public class YS_Device - { - /// - /// 编号 - /// - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Display(Description = "主键Id")] - [Comment("编号")] - public int Id { get; set; } - - /// - /// 类型 (1 平板, 2 跳绳, ...) - /// - [Display(Name = "Type")] - [Comment("类型")] - [Column(TypeName = "double")] - public double? Type { get; set; } - - /// - /// 设备型号 - /// - [Display(Name = "DeviceType")] - [Comment("设备型号")] - public string? DeviceType { get; set; } - - /// - /// 设备序列号 - /// - [Display(Name = "DeviceSerial")] - [Comment("设备序列号")] - public string? DeviceSerial { get; set; } - - /// - /// 设备 MAC 地址 - /// - [Display(Name = "DeviceMac")] - [Comment("设备 MAC 地址")] - public string? DeviceMac { get; set; } - - /// - /// 设备 IMEI 地址 - /// - [Display(Name = "DeviceImei")] - [Comment("设备 IMEI 地址")] - public string? DeviceImei { get; set; } - - /// - /// AI 摄像机 IP 地址 (多个 IP 用 , 隔开) - /// - [Display(Name = "CameraIp")] - [Comment("AI 摄像机 IP 地址")] - public string? CameraIp { get; set; } - - /// - /// 抢跑 IP (短跑) - /// - [Display(Name = "GunJumpingIp")] - [Comment("抢跑 IP")] - public string? GunJumpingIp { get; set; } - - /// - /// 是否是 EAI100 摄像头 - /// - [Display(Name = "Eai100Flag")] - [Comment("是否是 EAI100 摄像头")] - public bool? Eai100Flag { get; set; } - - /// - /// 组织 ID - /// - [Display(Name = "OrgId")] - [Comment("组织 ID")] - public int? OrgId { get; set; } - - /// - /// 组织名称 - /// - [Display(Name = "OrgName")] - [Comment("组织名称")] - public string? OrgName { get; set; } - - /// - /// 用户 ID - /// - [Display(Name = "UserId")] - [Comment("用户 ID")] - public int? UserId { get; set; } - - /// - /// 用户名称 - /// - [Display(Name = "UserName")] - [Comment("用户名称")] - public string? UserName { get; set; } - - /// - /// 软件版本 - /// - [Display(Name = "SoftWareVer")] - [Comment("软件版本")] - public string? SoftWareVer { get; set; } - - /// - /// 硬件版本 - /// - [Display(Name = "HardwareVer")] - [Comment("硬件版本")] - public string? HardwareVer { get; set; } - - /// - /// 应用时间 - /// - [Display(Name = "DeployTime")] - [Comment("应用时间")] - public string? DeployTime { get; set; } - - /// - /// 最后登录时间 - /// - [Display(Name = "LastLoginTime")] - [Comment("最后登录时间")] - public string? LastLoginTime { get; set; } - - /// - /// 备注 - /// - [Display(Name = "Remark")] - [Comment("备注")] - public string? Remark { get; set; } - - /// - /// 授权状态 (0 无效, 1 有效) - /// - [Display(Name = "State")] - [Comment("授权状态")] - public int? State { get; set; } - - /// - /// 状态 (0 无效, 1 有效) - /// - [Display(Name = "Status")] - [Comment("状态")] - public int? Status { get; set; } - - /// - /// 创建时间 - /// - [Display(Name = "CreateTime")] - [Comment("创建时间")] - public string? CreateTime { get; set; } - - /// - /// 创建人 - /// - [Display(Name = "CreateBy")] - [Comment("创建人")] - public string? CreateBy { get; set; } - - /// - /// 修改时间 - /// - [Display(Name = "UpdateTime")] - [Comment("修改时间")] - public string? UpdateTime { get; set; } - - /// - /// 修改人 - /// - [Display(Name = "UpdateBy")] - [Comment("修改人")] - public string? UpdateBy { get; set; } - - /// - /// 学校人脸的相似度 (80-99 之间的整数) - /// - [Display(Name = "SimilarNumber")] - [Comment("学校人脸的相似度")] - public int? SimilarNumber { get; set; } - - /// - /// 摄像头序列号、版本信息 - /// - [Display(Name = "摄像头序列号、版本信息")] - [Comment("摄像头序列号、版本信息")] - public string CameraInfo { get; set; } - } -}