init
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
package com.newyetai.recruit.user.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.newyetai.mybatis.handle.BaseEnum;
|
||||
|
||||
/**
|
||||
* 入职周期枚举
|
||||
*/
|
||||
public enum InductionCycleEnum implements BaseEnum<Integer> {
|
||||
|
||||
ANY_TIME(1, "随时入职"),
|
||||
TWO_WEEKS(2, "2周内入职"),
|
||||
ONE_MONTH(3, "一个月内入职");
|
||||
|
||||
@EnumValue
|
||||
private final Integer type;
|
||||
|
||||
private final String desc;
|
||||
|
||||
InductionCycleEnum(Integer type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
public static Integer findTypeByDesc(String desc) {
|
||||
for (InductionCycleEnum type : InductionCycleEnum.values()) {
|
||||
if (type.getDesc().equals(desc)) {
|
||||
return type.getType();
|
||||
}
|
||||
}
|
||||
return null; // 如果没有找到,返回null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user