You've already forked FrameTour-BE
修整代码
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
package com.ycwl.basic.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 是否同意用户协议枚举
|
||||
*
|
||||
* @author songmingsong
|
||||
*/
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public enum AgreementEnum {
|
||||
AGREE(1, "同意"),
|
||||
NOT_AGREE(0, "未同意");
|
||||
private int type;
|
||||
private String remark;
|
||||
}
|
@@ -1,69 +0,0 @@
|
||||
package com.ycwl.basic.enums;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:longbinbin
|
||||
* @Date:2024/12/6 16:46
|
||||
*/
|
||||
public enum GoodsTypeEnum {
|
||||
VIDEO(1,"成片"),
|
||||
SOURCE(2,"源素材")
|
||||
;
|
||||
|
||||
|
||||
public Integer code;
|
||||
|
||||
private String value;
|
||||
public static final Map<Integer, GoodsTypeEnum> cacheMap;
|
||||
|
||||
static {
|
||||
cacheMap = new HashMap<>(GoodsTypeEnum.values().length);
|
||||
for (GoodsTypeEnum value : GoodsTypeEnum.values()) {
|
||||
cacheMap.put(value.code, value);
|
||||
}
|
||||
}
|
||||
public static final java.util.Map<String, GoodsTypeEnum> valueMap;
|
||||
|
||||
static {
|
||||
valueMap = new HashMap<>(GoodsTypeEnum.values().length);
|
||||
for (GoodsTypeEnum value : GoodsTypeEnum.values()) {
|
||||
valueMap.put(value.value, value);
|
||||
}
|
||||
}
|
||||
|
||||
GoodsTypeEnum(Integer code, String value) {
|
||||
this.code = code;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取value值
|
||||
*/
|
||||
public static String getValue(Integer noticeMethod) {
|
||||
if (noticeMethod == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
GoodsTypeEnum GoodsTypeEnum = cacheMap.get(noticeMethod);
|
||||
if (GoodsTypeEnum == null) {
|
||||
return null;
|
||||
}
|
||||
return GoodsTypeEnum.value;
|
||||
}
|
||||
/**
|
||||
* 获取code值
|
||||
*/
|
||||
public static Integer getCode(String noticeMethod) {
|
||||
if (noticeMethod == null) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
GoodsTypeEnum GoodsTypeEnum = valueMap.get(noticeMethod);
|
||||
if (GoodsTypeEnum == null) {
|
||||
return -1;
|
||||
}
|
||||
return GoodsTypeEnum.code;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user