feat(common): add exception handling and response utilities

backend project initial!!!
This commit is contained in:
2025-11-26 20:24:16 +08:00
parent 531d99b3df
commit 3eb651e039
11 changed files with 291 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
package com.hanserwei.common.enums;
import com.hanserwei.common.exception.BaseExceptionInterface;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ResponseCodeEnum implements BaseExceptionInterface {
// ----------- 通用异常状态码 -----------
SYSTEM_ERROR("10000", "出错啦,后台小哥正在努力修复中..."),
PARAM_NOT_VALID("10001", "参数错误"),
// ----------- 业务异常状态码 -----------
;
// 异常码
private final String errorCode;
// 错误信息
private final String errorMsg;
}