diff --git a/Server/YD_XinWei.Commons/Dto/LargeScreen/SportsProjectListDto.cs b/Server/YD_XinWei.Commons/Dto/LargeScreen/SportsProjectListDto.cs index 92d7a40..f7c8743 100644 --- a/Server/YD_XinWei.Commons/Dto/LargeScreen/SportsProjectListDto.cs +++ b/Server/YD_XinWei.Commons/Dto/LargeScreen/SportsProjectListDto.cs @@ -25,5 +25,15 @@ namespace YD_XinWei.Commons.Dto.LargeScreen /// 类别 /// public int CategoryValue { get; set; } + + /// + /// 类别美剧 + /// + public string CategoryEnum { get; set; } + + /// + /// 单位 + /// + public string Unit { get; set; } } } diff --git a/Server/YD_XinWei.Commons/Enum/SportsTestItemType.cs b/Server/YD_XinWei.Commons/Enum/SportsTestItemType.cs new file mode 100644 index 0000000..ad83a31 --- /dev/null +++ b/Server/YD_XinWei.Commons/Enum/SportsTestItemType.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace YD_XinWei.Commons.Enum +{ + /// + /// 体测项目 + /// + public enum SportsTestItemType + { + /// + /// 体重指数(BMI) + /// + [Display(Name = "体重指数(BMI)", Description = "kg/m²")] + BMI = 1, + + /// + /// 肺活量 + /// + [Display(Name = "肺活量", Description = "ml")] + VitalCapacity = 2, + + /// + /// 50米跑 + /// + [Display(Name = "50米跑", Description = "s")] + MeterRun_50 = 3, + + /// + /// 坐位体前屈 + /// + [Display(Name = "坐位体前屈", Description = "cm")] + Sit_And_Reach = 4, + + /// + /// 1分钟跳绳 + /// + [Display(Name = "1分钟跳绳", Description = "个")] + OneMinuteJumpRope = 5, + + /// + /// 1分钟仰卧起坐(女) + /// + [Display(Name = "1分钟仰卧起坐(女)", Description = "个")] + One_Minute_Sit_Up = 6, + + /// + /// 50米*8往返跑 + /// + [Display(Name = "50米*8往返跑", Description = "s")] + ShuttleRun_50x8 = 7, + + /// + /// 立定跳远 + /// + [Display(Name = "立定跳远", Description = "cm")] + StandingLongJump = 8, + + /// + /// 引体向上(男) + /// + [Display(Name = "引体向上(男)", Description = "个")] + Pull_Up = 9, + + /// + /// 1000米跑(男) + /// + [Display(Name = "1000米跑(男)", Description = "s")] + MeterRun_1000 = 10, + + /// + /// 800米跑(女) + /// + [Display(Name = "800米跑(女)", Description = "s")] + MeterRun_800 = 11 + } +} diff --git a/Server/YD_XinWei.Commons/Utils/Util.cs b/Server/YD_XinWei.Commons/Utils/Util.cs index 4bb0c6e..690348d 100644 --- a/Server/YD_XinWei.Commons/Utils/Util.cs +++ b/Server/YD_XinWei.Commons/Utils/Util.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; -using System; +using System.ComponentModel; +using System.Reflection; namespace YD_XinWei.Commons.Utils { diff --git a/Server/YD_XinWei.Commons/obj/Debug/net6.0/YD_XinWei.Commons.AssemblyInfo.cs b/Server/YD_XinWei.Commons/obj/Debug/net6.0/YD_XinWei.Commons.AssemblyInfo.cs index 59d2aeb..5938269 100644 --- a/Server/YD_XinWei.Commons/obj/Debug/net6.0/YD_XinWei.Commons.AssemblyInfo.cs +++ b/Server/YD_XinWei.Commons/obj/Debug/net6.0/YD_XinWei.Commons.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Commons")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d6f1972ad9eeb1f7748d627b93cfc055c9be74da")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a02788708d17c249598086966005229c44c74ffc")] [assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Commons")] [assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Commons")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Server/YD_XinWei.Commons/obj/Debug/net6.0/YD_XinWei.Commons.AssemblyInfoInputs.cache b/Server/YD_XinWei.Commons/obj/Debug/net6.0/YD_XinWei.Commons.AssemblyInfoInputs.cache index 9b035b3..6d2e1dd 100644 --- a/Server/YD_XinWei.Commons/obj/Debug/net6.0/YD_XinWei.Commons.AssemblyInfoInputs.cache +++ b/Server/YD_XinWei.Commons/obj/Debug/net6.0/YD_XinWei.Commons.AssemblyInfoInputs.cache @@ -1 +1 @@ -f2cd6ca8ff95a7c4607306742b0f6455f67e97940b68e393657f6ff677fbc6f0 +9ec83a13f8e585a112448938f4a72b0b520cb731b6b8ddc39d52020bd7388fed diff --git a/Server/YD_XinWei/Services/Impl/LargeScreenService.cs b/Server/YD_XinWei/Services/Impl/LargeScreenService.cs index 1f935f6..a18fbf6 100644 --- a/Server/YD_XinWei/Services/Impl/LargeScreenService.cs +++ b/Server/YD_XinWei/Services/Impl/LargeScreenService.cs @@ -5,8 +5,10 @@ using VOL.Entity.Enum; using YD_XinWei.Api.Context; using YD_XinWei.Api.Services.Interface; using YD_XinWei.Api.SmartSportsEntitys; +using YD_XinWei.Api.Utilities; using YD_XinWei.Commons.Dto.Common; using YD_XinWei.Commons.Dto.LargeScreen; +using YD_XinWei.Commons.Enum; using YD_XinWei.Commons.MemoryCaches; namespace YD_XinWei.Api.Services.Impl @@ -50,7 +52,9 @@ namespace YD_XinWei.Api.Services.Impl { ProjectId = x.ProjectId, ProjectName = x.ProjectName, - CategoryValue = x.CategoryValue + CategoryValue = x.CategoryValue, + CategoryEnum = x.CategoryEnum, + Unit = ((SportsTestItemType)x.CategoryValue).GetUnit() }).ToListAsync(); } diff --git a/Server/YD_XinWei/Utilities/Tool.cs b/Server/YD_XinWei/Utilities/Tool.cs new file mode 100644 index 0000000..2aef465 --- /dev/null +++ b/Server/YD_XinWei/Utilities/Tool.cs @@ -0,0 +1,40 @@ +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Reflection; + +namespace YD_XinWei.Api.Utilities +{ + /// + /// 工具类 + /// + public static class Tool + { + /// + /// 获取枚举的 Display.Description 值 + /// + public static string GetUnit(this Enum value) + { + if (value == null) throw new ArgumentNullException(nameof(value)); + + FieldInfo field = value.GetType().GetField(value.ToString()); + if (field == null) return string.Empty; + + var displayAttr = field.GetCustomAttribute(); + return displayAttr?.Description ?? string.Empty; + } + + /// + /// 获取枚举的 Display.Name 值(可选) + /// + public static string GetDisplayName(this Enum value) + { + if (value == null) throw new ArgumentNullException(nameof(value)); + + FieldInfo field = value.GetType().GetField(value.ToString()); + if (field == null) return string.Empty; + + var displayAttr = field.GetCustomAttribute(); + return displayAttr?.Name ?? value.ToString(); + } + } +} diff --git a/Server/YD_XinWei/obj/Debug/net6.0/EndpointInfo/YD_XinWei.Api.json b/Server/YD_XinWei/obj/Debug/net6.0/EndpointInfo/YD_XinWei.Api.json index 0b41b5b..687475e 100644 --- a/Server/YD_XinWei/obj/Debug/net6.0/EndpointInfo/YD_XinWei.Api.json +++ b/Server/YD_XinWei/obj/Debug/net6.0/EndpointInfo/YD_XinWei.Api.json @@ -2191,6 +2191,14 @@ "categoryValue": { "type": "integer", "format": "int32" + }, + "categoryEnum": { + "type": "string", + "nullable": true + }, + "unit": { + "type": "string", + "nullable": true } }, "additionalProperties": false diff --git a/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.AssemblyInfo.cs b/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.AssemblyInfo.cs index 40b5544..a3101b8 100644 --- a/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.AssemblyInfo.cs +++ b/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Api")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d6f1972ad9eeb1f7748d627b93cfc055c9be74da")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a02788708d17c249598086966005229c44c74ffc")] [assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Api")] [assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Api")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.AssemblyInfoInputs.cache b/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.AssemblyInfoInputs.cache index fdf3b80..e91cad0 100644 --- a/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.AssemblyInfoInputs.cache +++ b/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.AssemblyInfoInputs.cache @@ -1 +1 @@ -853f3940ff1e4c76230b7f689ccce5dc2964ced3eb1c5e1437954d479bd6dbeb +93668722b7fb624125cdbbebd817283445fb3f99bcefa434051a1db85667509a diff --git a/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.csproj.AssemblyReference.cache b/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.csproj.AssemblyReference.cache index 89f6cc7..35e8c3d 100644 Binary files a/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.csproj.AssemblyReference.cache and b/Server/YD_XinWei/obj/Debug/net6.0/YD_XinWei.Api.csproj.AssemblyReference.cache differ diff --git a/Server/YD_XinWei/obj/Debug/net6.0/apphost.exe b/Server/YD_XinWei/obj/Debug/net6.0/apphost.exe index a48f2be..b72cce1 100644 Binary files a/Server/YD_XinWei/obj/Debug/net6.0/apphost.exe and b/Server/YD_XinWei/obj/Debug/net6.0/apphost.exe differ