feat : 차적조회 후처리 로직 수정, 소유주정보 코드 이넘클래스 추가
parent
d3336543ff
commit
09e0865033
@ -1,4 +1,55 @@
|
||||
package go.kr.project.vo.code;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
public enum OmIngbEnum {
|
||||
|
||||
MANUAL_INPUT("1", "수기입력"),
|
||||
CARINFO_API("2", "차적망조회"),
|
||||
RESIDENT_API("3", "주민망조회"),
|
||||
RESIDENCE_REG("4", "거소지등록"),
|
||||
CONVERSION_REG("5", "변환등록"),
|
||||
FILE("6", "파일처리");
|
||||
|
||||
|
||||
private String code;
|
||||
private String desc;
|
||||
|
||||
|
||||
OmIngbEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
private static final Map<String, OmIngbEnum> CODE_MAP = new HashMap<>();
|
||||
private static final Map<String, OmIngbEnum> DESC_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
for (OmIngbEnum e : values()) {
|
||||
CODE_MAP.put(e.code, e);
|
||||
DESC_MAP.put(e.desc, e);
|
||||
}
|
||||
}
|
||||
|
||||
// code → desc
|
||||
public static String getDescByCode(String code) {
|
||||
OmIngbEnum e = CODE_MAP.get(code);
|
||||
return e != null ? e.desc : null;
|
||||
}
|
||||
|
||||
// desc → code
|
||||
public static String getCodeByDesc(String desc) {
|
||||
OmIngbEnum e = DESC_MAP.get(desc);
|
||||
return e != null ? e.code : null;
|
||||
}
|
||||
|
||||
// code → enum
|
||||
public static OmIngbEnum fromCode(String code) {
|
||||
return CODE_MAP.get(code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue