package com.xisc.pm.infra.enums;

import io.choerodon.core.exception.CommonException;

/**
 * 组版方式枚举
 * @author jun.zeng
 *
 */
public enum FormPlateMode {

    A1("A1", "A"), A2("A2", "A"), S("S", "S") , S1("S1", "S"), S2("S2", "S"), S3("S3", "S"), S7("S7", "S"), G("G", "G"),
    G1("G1", "G");
    
    private final String code;
    private final String type;

    // 私有构造函数
    FormPlateMode(String code, String type) {
        this.code = code;
        this.type = type;
    }

    // Getter 方法
    public String getCode() {
        return code;
    }

    public String getType() {
        return type;
    }

    // 根据code查找枚举项（可选）
    public static FormPlateMode getByCode(String code) {
        for (FormPlateMode type : FormPlateMode.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        throw new CommonException("pm.pm_pro_cont_053", code);
    }
}
