单位
This commit is contained in:
parent
a02788708d
commit
742999591b
@ -25,5 +25,15 @@ namespace YD_XinWei.Commons.Dto.LargeScreen
|
|||||||
/// 类别
|
/// 类别
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CategoryValue { get; set; }
|
public int CategoryValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 类别美剧
|
||||||
|
/// </summary>
|
||||||
|
public string CategoryEnum { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public string Unit { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
82
Server/YD_XinWei.Commons/Enum/SportsTestItemType.cs
Normal file
82
Server/YD_XinWei.Commons/Enum/SportsTestItemType.cs
Normal file
@ -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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 体测项目
|
||||||
|
/// </summary>
|
||||||
|
public enum SportsTestItemType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 体重指数(BMI)
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "体重指数(BMI)", Description = "kg/m²")]
|
||||||
|
BMI = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 肺活量
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "肺活量", Description = "ml")]
|
||||||
|
VitalCapacity = 2,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 50米跑
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "50米跑", Description = "s")]
|
||||||
|
MeterRun_50 = 3,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 坐位体前屈
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "坐位体前屈", Description = "cm")]
|
||||||
|
Sit_And_Reach = 4,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 1分钟跳绳
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "1分钟跳绳", Description = "个")]
|
||||||
|
OneMinuteJumpRope = 5,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 1分钟仰卧起坐(女)
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "1分钟仰卧起坐(女)", Description = "个")]
|
||||||
|
One_Minute_Sit_Up = 6,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 50米*8往返跑
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "50米*8往返跑", Description = "s")]
|
||||||
|
ShuttleRun_50x8 = 7,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 立定跳远
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "立定跳远", Description = "cm")]
|
||||||
|
StandingLongJump = 8,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 引体向上(男)
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "引体向上(男)", Description = "个")]
|
||||||
|
Pull_Up = 9,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 1000米跑(男)
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "1000米跑(男)", Description = "s")]
|
||||||
|
MeterRun_1000 = 10,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 800米跑(女)
|
||||||
|
/// </summary>
|
||||||
|
[Display(Name = "800米跑(女)", Description = "s")]
|
||||||
|
MeterRun_800 = 11
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System.ComponentModel;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace YD_XinWei.Commons.Utils
|
namespace YD_XinWei.Commons.Utils
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Commons")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Commons")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[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.AssemblyProductAttribute("YD_XinWei.Commons")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Commons")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Commons")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
@ -1 +1 @@
|
|||||||
f2cd6ca8ff95a7c4607306742b0f6455f67e97940b68e393657f6ff677fbc6f0
|
9ec83a13f8e585a112448938f4a72b0b520cb731b6b8ddc39d52020bd7388fed
|
||||||
|
@ -5,8 +5,10 @@ using VOL.Entity.Enum;
|
|||||||
using YD_XinWei.Api.Context;
|
using YD_XinWei.Api.Context;
|
||||||
using YD_XinWei.Api.Services.Interface;
|
using YD_XinWei.Api.Services.Interface;
|
||||||
using YD_XinWei.Api.SmartSportsEntitys;
|
using YD_XinWei.Api.SmartSportsEntitys;
|
||||||
|
using YD_XinWei.Api.Utilities;
|
||||||
using YD_XinWei.Commons.Dto.Common;
|
using YD_XinWei.Commons.Dto.Common;
|
||||||
using YD_XinWei.Commons.Dto.LargeScreen;
|
using YD_XinWei.Commons.Dto.LargeScreen;
|
||||||
|
using YD_XinWei.Commons.Enum;
|
||||||
using YD_XinWei.Commons.MemoryCaches;
|
using YD_XinWei.Commons.MemoryCaches;
|
||||||
|
|
||||||
namespace YD_XinWei.Api.Services.Impl
|
namespace YD_XinWei.Api.Services.Impl
|
||||||
@ -50,7 +52,9 @@ namespace YD_XinWei.Api.Services.Impl
|
|||||||
{
|
{
|
||||||
ProjectId = x.ProjectId,
|
ProjectId = x.ProjectId,
|
||||||
ProjectName = x.ProjectName,
|
ProjectName = x.ProjectName,
|
||||||
CategoryValue = x.CategoryValue
|
CategoryValue = x.CategoryValue,
|
||||||
|
CategoryEnum = x.CategoryEnum,
|
||||||
|
Unit = ((SportsTestItemType)x.CategoryValue).GetUnit()
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
40
Server/YD_XinWei/Utilities/Tool.cs
Normal file
40
Server/YD_XinWei/Utilities/Tool.cs
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace YD_XinWei.Api.Utilities
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 工具类
|
||||||
|
/// </summary>
|
||||||
|
public static class Tool
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取枚举的 Display.Description 值
|
||||||
|
/// </summary>
|
||||||
|
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<DisplayAttribute>();
|
||||||
|
return displayAttr?.Description ?? string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取枚举的 Display.Name 值(可选)
|
||||||
|
/// </summary>
|
||||||
|
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<DisplayAttribute>();
|
||||||
|
return displayAttr?.Name ?? value.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2191,6 +2191,14 @@
|
|||||||
"categoryValue": {
|
"categoryValue": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int32"
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"categoryEnum": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true
|
||||||
|
},
|
||||||
|
"unit": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Api")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Api")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[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.AssemblyProductAttribute("YD_XinWei.Api")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Api")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Api")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
@ -1 +1 @@
|
|||||||
853f3940ff1e4c76230b7f689ccce5dc2964ced3eb1c5e1437954d479bd6dbeb
|
93668722b7fb624125cdbbebd817283445fb3f99bcefa434051a1db85667509a
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user