service common

This commit is contained in:
2025-09-28 15:50:38 +08:00
parent 6fda9d89f6
commit f6e9206da3
18 changed files with 1677 additions and 9 deletions

View File

@@ -0,0 +1,75 @@
package org.xyzh.common.exception;
/**
* @description BaseException.java文件描述 基础异常类
* @filename BaseException.java
* @author yslg
* @copyright xyzh
* @since 2025-09-28
*/
public class BaseException extends RuntimeException{
private static final long serialVersionUID = 1L;
/**
* @description code
* @author yslg
* @since 2025-09-28
*/
private String code;
/**
* @description BaseException
* @author yslg
* @since 2025-09-28
*/
public BaseException(String message) {
super(message);
}
/**
* @description BaseException
* @author yslg
* @since 2025-09-28
*/
public BaseException(String code, String message) {
super(message);
this.code = code;
}
/**
* @description BaseException
* @author yslg
* @since 2025-09-28
*/
public BaseException(String message, Throwable cause) {
super(message, cause);
}
/**
* @description BaseException
* @author yslg
* @since 2025-09-28
*/
public BaseException(String code, String message, Throwable cause) {
super(message, cause);
this.code = code;
}
/**
* @description getCode
* @author yslg
* @since 2025-09-28
*/
public String getCode() {
return code;
}
/**
* @description setCode
* @author yslg
* @since 2025-09-28
*/
public void setCode(String code) {
this.code = code;
}
}

View File

@@ -0,0 +1,39 @@
package org.xyzh.common.exception.auth;
import org.xyzh.common.exception.BaseException;
/**
* @description AuthException.java文件描述 认证异常类
* @filename AuthException.java
* @author yslg
* @copyright xyzh
* @since 2025-09-28
*/
public class AuthException extends BaseException {
private static final long serialVersionUID = 1L;
public AuthException(String message) {
super(message);
}
public AuthException(String code, String message) {
super(code, message);
}
public AuthException(String message, Throwable cause) {
super(message, cause);
}
public AuthException(String code, String message, Throwable cause) {
super(code, message, cause);
}
public String getCode() {
return super.getCode();
}
public void setCode(String code) {
super.setCode(code);
}
}