package com.oqpo.api.enums;

import lombok.Getter;

@Getter
public enum ViewCd {
    CREATE("C", "등록"),
    READ("R", "읽기"),
    UPDATE("U", "수정"),
    DELETE("D", "삭제");

    private String id;
    private String message;

    ViewCd(String id, String message) {
        this.id = id;
        this.message = message;
    }

    public static String getId(String message) {
        ViewCd[] list = ViewCd.values();
        for (ViewCd item : list) {
            if (item.message.equals(message)) {
                return item.id;
            }
        }
        return null;
    }
}
