package enumeration.general; import com.baomidou.mybatisplus.annotation.EnumValue; import com.fasterxml.jackson.annotation.JsonValue; /** * 计数类型 * * @author:xp * @date:2024/4/12 10:21 */ public enum CountTypeEnum { INT("int", "整数"), PERCENT("percent", "比率"), SECOND("second", "秒"); @EnumValue // 标明该字段存入数据库 @JsonValue // 标明在转JSON时使用该字段 private final String code; private final String desc; CountTypeEnum(String code, String desc) { this.code = code; this.desc = desc; } }