| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | |
| | | YES(1, "是"); |
| | | |
| | | @Getter |
| | | @JsonValue |
| | | private String desc; |
| | | |
| | | |
| | | @Getter |
| | | @EnumValue |
| | | private int code; |
| | | |
| | | |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 通过desc获取美剧 |
| | | * @param desc |
| | | * @return |
| | | */ |
| | | public static DisabledEnum getByDesc(String desc) { |
| | | DisabledEnum[] resultTypes = DisabledEnum.values(); |
| | | for (DisabledEnum resultType : resultTypes) { |
| | | if (desc.equals(resultType.getDesc())) { |
| | | return resultType; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |