com.aluka.nirvana.framework.exception.model.ErrorInfo Maven / Gradle / Ivy
package com.aluka.nirvana.framework.exception.model;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import lombok.Getter;
import lombok.ToString;
import java.io.Serializable;
/**
* 错误信息
* @author gongli
* @since 2019/12/25
*/
@Getter
@ToString
public class ErrorInfo implements Serializable {
/**
* serialVersionUID:.
*/
private static final long serialVersionUID = 7878068469202292871L;
/**
* 错误编号
*/
private String code;
/**
* 错误信息
*/
private String message;
/**
* 错误信息
*
* @param message 错误简单描述
* @param errorCode 错误编号
*/
public ErrorInfo(String errorCode, String message) {
this.message = message;
this.code = errorCode;
}
public String serializable(){
return JSONUtil.toJsonStr(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy