bug修复

This commit is contained in:
18792927508
2024-01-26 17:43:05 +08:00
parent 94d6500b92
commit c53dffddfd
7 changed files with 230 additions and 110 deletions
@@ -0,0 +1,63 @@
package com.ruoyi.common.enums;
import com.ruoyi.common.interfaces.EnumsInterface;
/**
* @author wangqiong
* @description 选择调解员入口枚举
* @date 2023-11-17 14:05
*/
public enum MediatorTypeEnum implements EnumsInterface
{
PC(0, "PC"),
MI_NI_PROGRESS(1, "小程序"),
;
private final Integer code;
private final String text;
MediatorTypeEnum(Integer code, String text)
{
this.code = code;
this.text = text;
}
public Integer getCode()
{
return code;
}
public String getText()
{
return text;
}
/**
* 根据code获取text
* @param codeNo
* @return
*/
public static String getTextByCode(Integer codeNo){
for (MediatorTypeEnum value : MediatorTypeEnum.values()) {
if (value.getCode().equals(codeNo)){
return value.getText();
}
}
return codeNo.toString();
}
/**
* 根据text获取code
* @param textStr
* @return
*/
public static String getCodeByText(String textStr){
for (MediatorTypeEnum value : MediatorTypeEnum.values()) {
if (value.getText().equals(textStr)){
return value.getText();
}
}
return textStr;
}
}