You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System.ComponentModel;
using System.Reflection;
namespace Entity.Constant;
public class StationConstant
{
/// <summary>
/// 换电站状态: 1营运中 2歇业中 3设备维护状态 4暂停营业
/// </summary>
public enum StationStatus
{
[Description("营运中")]
Run=1,
[Description("歇业中")]
Stop,
[Description("设备维护")]
Repair,
[Description("暂停营业")]
Suspend,
}
/// <summary>
/// 换电方式1:自动换电 2手动换电
/// </summary>
public enum StationWay
{
[Description("自动换电")]
Auto=1,
[Description("手动换电")]
Manual,
}
/// <summary>
/// 换电模式1本地换电 2远程换电
/// </summary>
public enum StationModel
{
[Description("本地换电")]
Local=1,
[Description("远程换电、云平台参与")]
Remote,
}
public static class EnumExtensions
{
public static string GetDescription( Enum value)
{
FieldInfo field = value.GetType().GetField(value.ToString());
DescriptionAttribute attribute = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) as DescriptionAttribute;
return attribute == null ? value.ToString() : attribute.Description;
}
}
}