diff --git a/WeChatApplet/Context/SmartSportsContext.cs b/WeChatApplet/Context/SmartSportsContext.cs index b5d6460..6a4acb5 100644 --- a/WeChatApplet/Context/SmartSportsContext.cs +++ b/WeChatApplet/Context/SmartSportsContext.cs @@ -46,6 +46,10 @@ namespace YD_WeChatApplet.Context public DbSet StadiumVisiting { get; set; } public DbSet SchoolAccountApplication { get; set; } public DbSet CurricularPurchaseRecord { get; set; } + + public DbSet JS_Special { get; set; } + public DbSet JS_SpecialAction { get; set; } + public DbSet JS_SpecialLevel { get; set; } } } diff --git a/WeChatApplet/Services/Impl/ResourceService.cs b/WeChatApplet/Services/Impl/ResourceService.cs index 8dbcb6d..8fb2aa9 100644 --- a/WeChatApplet/Services/Impl/ResourceService.cs +++ b/WeChatApplet/Services/Impl/ResourceService.cs @@ -124,8 +124,8 @@ namespace YD_WeChatApplet.Api.Services.Impl /// public async Task> SpecialLevelList() { - var specials = await _sportsContext.Ai_Special.ToListAsync(); - var levels = await _sportsContext.Ai_SpecialLevel + var specials = await _sportsContext.JS_Special.ToListAsync(); + var levels = await _sportsContext.JS_SpecialLevel .Where(s => specials.Select(x => x.Id).Contains(s.SpecialId)) .Include(s => s.SpecialActionList) .ToListAsync(); diff --git a/WeChatApplet/SmartSportsEntitys/JS_Special.cs b/WeChatApplet/SmartSportsEntitys/JS_Special.cs new file mode 100644 index 0000000..5d4ecd7 --- /dev/null +++ b/WeChatApplet/SmartSportsEntitys/JS_Special.cs @@ -0,0 +1,73 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace YD_WeChatApplet.Api.SmartSportsEntitys +{ + [Table("JS_Special")] + public class JS_Special + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Display(Description = "主键Id")] + [Comment("Id")] + public int Id { get; set; } + + /// + /// 专项名称 + /// + [Display(Name = "专项名称")] + [Comment("专项名称")] + [Column(TypeName = "nvarchar(100)")] + public string SpecialName { get; set; } + + /// + /// 图片地址 + /// + [Display(Name = "图片地址")] + [Comment("图片地址")] + [Column(TypeName = "nvarchar(2000)")] + public string ImageUrl { get; set; } + + /// + /// 创建人 + /// + [Display(Name = "创建人")] + [Comment("创建人")] + [Column(TypeName = "int")] + public int? Creator { get; set; } + + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + [Comment("创建时间")] + [Column(TypeName = "datetime")] + [Editable(true)] + public DateTime? CreateDate { get; set; } + + /// + /// 修改人 + /// + [Display(Name = "修改人")] + [Comment("修改人")] + [Column(TypeName = "int")] + public int? Modifier { get; set; } + + /// + /// 修改时间 + /// + [Display(Name = "修改时间")] + [Comment("修改时间")] + [Column(TypeName = "datetime")] + public DateTime? ModifyDate { get; set; } + + /// + /// 专项水平列表 + /// + [Display(Name = "专项水平列表")] + [Comment("专项水平列表")] + public List SpecialLevelList { get; set; } + } +} diff --git a/WeChatApplet/SmartSportsEntitys/JS_SpecialAction.cs b/WeChatApplet/SmartSportsEntitys/JS_SpecialAction.cs new file mode 100644 index 0000000..c4cf94b --- /dev/null +++ b/WeChatApplet/SmartSportsEntitys/JS_SpecialAction.cs @@ -0,0 +1,113 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using YD_WeChatApplet.Commons.Enum; +namespace YD_WeChatApplet.Api.SmartSportsEntitys +{ + [Table("JS_SpecialAction")] + public class JS_SpecialAction + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Display(Description = "主键Id")] + [Comment("Id")] + public int Id { get; set; } + + /// + /// 专项水平Id + /// + [Display(Name = "专项水平Id")] + [Comment("专项水平Id")] + [Column(TypeName = "int")] + public int SpecialLevelId { get; set; } + + /// + /// 动作名称 + /// + [Display(Name = "动作名称")] + [Comment("动作名称")] + [Column(TypeName = "nvarchar(100)")] + public string ActionName { get; set; } + + /// + /// 动作类型 + /// + [Display(Name = "动作类型")] + [Comment("动作类型")] + [Column(TypeName = "nvarchar(100)")] + public SpecialActionType ActionType { get; set; } + + /// + /// 动作示范-视频路径 + /// + [Display(Name = "动作示范-视频路径")] + [Comment("动作示范-视频路径")] + [Column(TypeName = "nvarchar(2000)")] + public string ActionVideoPath { get; set; } + + /// + /// 要领讲解-视频路径 + /// + [Display(Name = "要领讲解-视频路径")] + [Comment("要领讲解-视频路径")] + [Column(TypeName = "nvarchar(2000)")] + public string ExplainVideoPath { get; set; } + + /// + /// 练习方法-视频路径 + /// + [Display(Name = "练习方法-视频路径")] + [Comment("练习方法-视频路径")] + [Column(TypeName = "nvarchar(2000)")] + public string ExerciseVideoPath { get; set; } + + /// + /// 达标标准-视频路径 + /// + [Display(Name = "达标标准-视频路径")] + [Comment("达标标准-视频路径")] + [Column(TypeName = "nvarchar(2000)")] + public string StandardVideoPath { get; set; } + + /// + /// 创建人 + /// + [Display(Name = "创建人")] + [Comment("创建人")] + [Column(TypeName = "int")] + public int? Creator { get; set; } + + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + [Comment("创建时间")] + [Column(TypeName = "datetime")] + [Editable(true)] + public DateTime? CreateDate { get; set; } + + /// + /// 修改人 + /// + [Display(Name = "修改人")] + [Comment("修改人")] + [Column(TypeName = "int")] + public int? Modifier { get; set; } + + /// + /// 修改时间 + /// + [Display(Name = "修改时间")] + [Comment("修改时间")] + [Column(TypeName = "datetime")] + public DateTime? ModifyDate { get; set; } + + /// + /// 专项水平表-导航属性 + /// + [ForeignKey("SpecialLevelId")] + public JS_SpecialLevel SpecialLevel { get; set; } + } +} diff --git a/WeChatApplet/SmartSportsEntitys/JS_SpecialLevel.cs b/WeChatApplet/SmartSportsEntitys/JS_SpecialLevel.cs new file mode 100644 index 0000000..137571f --- /dev/null +++ b/WeChatApplet/SmartSportsEntitys/JS_SpecialLevel.cs @@ -0,0 +1,95 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace YD_WeChatApplet.Api.SmartSportsEntitys +{ + [Table("JS_SpecialLevel")] + public class JS_SpecialLevel + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Display(Description = "主键Id")] + [Comment("Id")] + public int Id { get; set; } + + /// + /// 专项Id + /// + [Display(Name = "专项Id")] + [Comment("专项Id")] + [Column(TypeName = "int")] + public int SpecialId { get; set; } + + /// + /// 水平名称 + /// + [Display(Name = "水平名称")] + [Comment("水平名称")] + [Column(TypeName = "nvarchar(100)")] + public string LevelName { get; set; } + + /// + /// 开始年级 + /// + [Display(Name = "开始年级")] + [Comment("开始年级")] + [Column(TypeName = "int")] + public int StartGrade { get; set; } + + /// + /// 结束年级 + /// + [Display(Name = "结束年级")] + [Comment("结束年级")] + [Column(TypeName = "int")] + public int EndGrade { get; set; } + + /// + /// 创建人 + /// + [Display(Name = "创建人")] + [Comment("创建人")] + [Column(TypeName = "int")] + public int? Creator { get; set; } + + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + [Comment("创建时间")] + [Column(TypeName = "datetime")] + [Editable(true)] + public DateTime? CreateDate { get; set; } + + /// + /// 修改人 + /// + [Display(Name = "修改人")] + [Comment("修改人")] + [Column(TypeName = "int")] + public int? Modifier { get; set; } + + /// + /// 修改时间 + /// + [Display(Name = "修改时间")] + [Comment("修改时间")] + [Column(TypeName = "datetime")] + public DateTime? ModifyDate { get; set; } + + /// + /// 专项-导航属性 + /// + [ForeignKey("SpecialId")] + public JS_Special Special { get; set; } + + /// + /// 专项动作列表 + /// + [Display(Name = "专项动作列表")] + [Comment("专项动作列表")] + public List SpecialActionList { get; set; } + } +}