package com.psbc.cpsp.entity.enums;

import java.text.MessageFormat;

/**
 * 园区16位响应码基础枚举类
 */
public enum BaseRespCodeEnum implements BaseRespCodeInterFace {
    /**
     * 成功
     */
    SUCCESS("0000000000000000","成功");
    /**
     * 智慧园区16位响应码-枚举编码
     */
    private final String code;
    /**
     * 响应描述信息
     */
    private final String desc;

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    @Override
    public String getDesc(String... args) {
        if (args == null) {
            return desc;
        }

        return MessageFormat.format(desc, args);
    }

    BaseRespCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}

