package cn.quantgroup.customer.exception;

import cn.quantgroup.customer.enums.ErrorCodeEnum;
import lombok.Getter;
import org.springframework.stereotype.Component;

/**
 * @author Jony
 * @Date 2020/4/20 15:07
 * @Desc
 * @Update
 */
@Getter
@Component
public class ValidTokenException extends RuntimeException{

    private Long code;
    private String message;

    public ValidTokenException() {
    }

    public ValidTokenException(String message, Long code) {
        super(message);
        this.code = code;
    }

    public ValidTokenException(ErrorCodeEnum errorCodeEnum) {
        this.code = errorCodeEnum.getCode();
        this.message = errorCodeEnum.getMessage();
    }
}
