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.
gym/TypeEnum.java

52 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.

// 包声明,定义当前文件所在的包路径
package com.model.enums;
// 导入Java的序列化接口用于标记类的实例可以被序列化
import java.io.Serializable;
// 导入MyBatis-Plus的枚举接口用于支持枚举类型的数据库映射
import com.baomidou.mybatisplus.enums.IEnum;
//类型枚举类继承自MyBatis-Plus的IEnum接口用于定义不同的状态类型。
// 必须在IEnum中配置该包扫描自动注入查看文件spring-mybatis.xml中的参数typeEnumsPackage。
public enum TypeEnum implements IEnum {
// 定义枚举值DISABLED表示禁用状态值为0描述为"禁用"
DISABLED(0, "禁用"),
// 定义枚举值NORMAL表示正常状态值为1描述为"正常"
NORMAL(1, "正常");
// 枚举值对应的整数值
private final int value;
// 枚举值对应的描述信息
private final String desc;
//构造方法,初始化枚举值的整数和描述信息
//@param value 枚举值对应的整数
// @param desc 枚举值对应的描述信息
TypeEnum(final int value, final String desc) {
this.value = value;
this.desc = desc;
}
//获取枚举值对应的整数值
// @return 枚举值对应的整数值
@Override
public Serializable getValue() {
return this.value;
}
//获取枚举值对应的描述信息
//@return 枚举值对应的描述信息
public String getDesc() {
return this.desc;
}
}