Commit f445e19da944eb1cf8af473c63516e549e717e3c
1 parent
7bf1cae5
feat(common): error codes for module update REQ-MOD-002
Showing
2 changed files
with
4 additions
and
0 deletions
backend/src/main/java/com/xly/erp/common/response/ErrorCode.java
| @@ -7,7 +7,9 @@ public enum ErrorCode { | @@ -7,7 +7,9 @@ public enum ErrorCode { | ||
| 7 | SUCCESS(200, "操作成功"), | 7 | SUCCESS(200, "操作成功"), |
| 8 | PARAM_INVALID(40010, "参数错误"), | 8 | PARAM_INVALID(40010, "参数错误"), |
| 9 | MOD_PARENT_NOT_FOUND(40411, "父模块不存在或已删除"), | 9 | MOD_PARENT_NOT_FOUND(40411, "父模块不存在或已删除"), |
| 10 | + MOD_NOT_FOUND(40421, "模块不存在或已删除"), | ||
| 10 | MOD_PROC_NAME_DUP(40911, "存储过程名称已存在"), | 11 | MOD_PROC_NAME_DUP(40911, "存储过程名称已存在"), |
| 12 | + MOD_PARENT_LOOP(40921, "iParentId 不能等于自身或后代"), | ||
| 11 | INTERNAL_ERROR(50000, "服务器内部错误"); | 13 | INTERNAL_ERROR(50000, "服务器内部错误"); |
| 12 | 14 | ||
| 13 | private final int code; | 15 | private final int code; |
backend/src/test/java/com/xly/erp/common/response/ApiResponseTest.java
| @@ -48,5 +48,7 @@ class ApiResponseTest { | @@ -48,5 +48,7 @@ class ApiResponseTest { | ||
| 48 | assertThat(ErrorCode.MOD_PARENT_NOT_FOUND.getCode()).isEqualTo(40411); | 48 | assertThat(ErrorCode.MOD_PARENT_NOT_FOUND.getCode()).isEqualTo(40411); |
| 49 | assertThat(ErrorCode.MOD_PROC_NAME_DUP.getCode()).isEqualTo(40911); | 49 | assertThat(ErrorCode.MOD_PROC_NAME_DUP.getCode()).isEqualTo(40911); |
| 50 | assertThat(ErrorCode.INTERNAL_ERROR.getCode()).isEqualTo(50000); | 50 | assertThat(ErrorCode.INTERNAL_ERROR.getCode()).isEqualTo(50000); |
| 51 | + assertThat(ErrorCode.MOD_NOT_FOUND.getCode()).isEqualTo(40421); | ||
| 52 | + assertThat(ErrorCode.MOD_PARENT_LOOP.getCode()).isEqualTo(40921); | ||
| 51 | } | 53 | } |
| 52 | } | 54 | } |