package com.gk.firework.Domain.Enum; import com.baomidou.mybatisplus.core.enums.IEnum; import com.fasterxml.jackson.annotation.JsonValue; import java.io.Serializable; public enum PersonnelCategory implements IEnum { SECURITY("SECURITY", "安全人员"), SPECIAL("SPECIAL", "特种人员"), ; private String code; private String msg; PersonnelCategory(String code, String msg) { this.code = code; this.msg = msg; } public String getCode() { return code; } @JsonValue public String getMsg() { return msg; } public static PersonnelCategory parse(String code){ for(PersonnelCategory pc:PersonnelCategory.values()){ if(pc.getCode().equals(code)){ return pc; } } return null; } @Override public Serializable getValue() { return this.code; } }