2025-12-10 19:12:54 +07:00
|
|
|
package ru.soune.nocopy.dto;
|
2025-12-10 02:37:31 +07:00
|
|
|
|
|
|
|
|
public enum MessageCode {
|
|
|
|
|
SUCCESS(0, "Operation successful"),
|
2025-12-10 19:12:54 +07:00
|
|
|
REG_EMAIL_EXISTS(1, "Email already registered"),
|
2025-12-16 16:43:20 +07:00
|
|
|
REG_EMAIL_OR_PHONE_EXISTS(1, "Email or phone already registered"),
|
2025-12-10 19:12:54 +07:00
|
|
|
INVALID_FIELD(2, "Invalid field"),
|
2025-12-17 22:31:30 +07:00
|
|
|
INVALID_TOKEN(2, "Invalid token"),
|
|
|
|
|
INVALID_ACTION(2, "Invalid action"),
|
|
|
|
|
FILE_UPLOAD_ERROR(2, "File upload error"),
|
2025-12-10 19:25:45 +07:00
|
|
|
INVALID_JSON_BODY(2, "Invalid fields in JSON object"),
|
2025-12-17 22:31:30 +07:00
|
|
|
INCOMPLETE_UPLOAD(2, "Not load all chunks"),
|
2025-12-10 19:12:54 +07:00
|
|
|
MSG_ID_NOT_FOUND(4, "Message id not found"),
|
2025-12-10 02:37:31 +07:00
|
|
|
|
2025-12-10 19:12:54 +07:00
|
|
|
AUTH_EMAIL_NOT_FOUND(4, "Email not found"),
|
2025-12-17 22:31:30 +07:00
|
|
|
FILE_NOT_FOUND(4, "File not found"),
|
2025-12-10 19:12:54 +07:00
|
|
|
AUTH_PASSWORD_NOT_MATCHES(2, "Password does not match");
|
2025-12-10 02:37:31 +07:00
|
|
|
|
|
|
|
|
private final Integer code;
|
|
|
|
|
|
|
|
|
|
private final String description;
|
|
|
|
|
|
|
|
|
|
MessageCode(Integer code, String description) {
|
|
|
|
|
this.code = code;
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Integer getCode() {
|
|
|
|
|
return code;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
}
|