package cn.stylefeng.team.meta.modular.enums;

import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
import lombok.Getter;

@Getter
public enum MetaModelExceptionEnum implements AbstractExceptionEnum {

    META_MODEL_NOT_EXISTED(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10001", "模型查询结果不存在"),

    CODE_REPEAT(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10002", "模型编码重复"),

    NAME_REPEAT(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10003", "模型名称重复"),

    FIELD_IS_EMPTY(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10004", "模型字段为空，无法进行sql生成"),

    TABLE_EXISTED(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10005", "数据库已存在表，无需再创建表"),

    UPDATE_SQL_ERROR(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10006", "Update SQL执行出错，请检查系统配置"),

    CANT_FIND_SUB_TABLE_LINK_FIELD(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10007", "找不到子表中关联主表的字段名称，请检查模型配置"),

    CANT_FIND_TABLE(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10008", "数据库中未创建表，请先创建表再更新"),

    NEED_OUT_TABLE(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10009", "如果新建表类型为已有表，则需要选择已有表");

    private final String errorCode;

    private final String userTip;

    MetaModelExceptionEnum(String errorCode, String userTip) {
        this.errorCode = errorCode;
        this.userTip = userTip;
    }

}