All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pighand.framework.spring.exception.ThrowPrompt Maven / Gradle / Ivy

There is a newer version: 2.0.0-bate.2.20250103
Show newest version
package com.pighand.framework.spring.exception;

import jakarta.servlet.http.HttpServletResponse;

import lombok.Data;

/**
 * 提示
 *
 * 

用法:throw new ThrowPrompt() * * @author wangshuli */ @Data public class ThrowPrompt extends RuntimeException implements ThrowInterface { /** 状态码 默认400 */ private Integer code = HttpServletResponse.SC_BAD_REQUEST; /** 返回数据 */ private Object data; /** 异常消息 */ private String error; public ThrowPrompt(String error) { super(error); this.error = error; } public ThrowPrompt(String error, Object data) { super(error); this.error = error; this.data = data; } /** * @param error * @param code */ public ThrowPrompt(String error, Integer code) { super(error); this.error = error; this.code = code; } /** * @param error * @param code */ public ThrowPrompt(String error, Integer code, Object data) { super(error); this.error = error; this.code = code; this.data = data; } @Override public Integer getCode() { return code; } @Override public Object getData() { return data; } @Override public String getError() { return error; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy