package cn.stylefeng.team.project.modular.business.enums;

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

@Getter
public enum BusinessExceptionEnum implements AbstractExceptionEnum {

    BUSINESS_NOT_EXISTED(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10001", "业务信息不存在"),

    SQL_NOT_CONFIG(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10002", "业务SQL配置错误，请检查业务设计"),

    CANT_FIND_MAIN_TABLE(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10003", "表结构配置有问题，无法找到主表"),

    CANT_FIND_TABLES(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10004", "无法获取到业务的表信息，请检查数据表配置"),

    CANT_FIND_MAIN_META_MODEL(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10005", "无法获取到主表信息，请检查数据表配置"),

    VIEW_API_CLASS_NOT_FOUND(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10006", "视图配置的API类查询不存在"),

    SQL_TEMPLATE_EMPTY_PARAM_ERROR(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10007", "数据获取错误，SQL模板存在参数为空");

    private final String errorCode;

    private final String userTip;

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

}
