package com.jianshui.common.exception.jianshui;

import com.jianshui.common.core.domain.AjaxResult;
import com.jianshui.common.core.domain.entity.Companyservice;
import com.jianshui.common.enums.ErrorCode;
import lombok.Data;

/**
 * @Description
 * @Author 巩权林
 * @Date 2022-01-10 10:55
 **/
@Data
public class JianshuiParamErrorException extends RuntimeException {

    private Integer errorCode;

    private String msg;

    private Companyservice companyservice;

    private String serviceKey;

    public JianshuiParamErrorException(String msg, Companyservice companyservice, String serviceKey) {
        super(msg);
        this.errorCode = 500;
        this.msg = msg;
        this.companyservice = companyservice;
        this.serviceKey = serviceKey;
    }

    public JianshuiParamErrorException(Integer errorCode, String msg, Companyservice companyservice, String serviceKey) {
        super(msg);
        this.errorCode = errorCode;
        this.msg = msg;
        this.companyservice = companyservice;
        this.serviceKey = serviceKey;

    }

    public JianshuiParamErrorException(ErrorCode errorCode, Companyservice companyservice, String serviceKey) {
        super(errorCode.getMsg());
        this.errorCode = Integer.parseInt(errorCode.getCode());
        this.msg = errorCode.getMsg();
        this.companyservice = companyservice;
        this.serviceKey = serviceKey;

    }
}
