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"),
|
2026-02-06 21:22:47 +07:00
|
|
|
REFERRAL_LINK_IS_NOT_EXIST(1, "Refferal link is not exist"),
|
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"),
|
2026-01-20 15:12:24 +07:00
|
|
|
TOKEN_IS_ALIVE(2, "Token is alive"),
|
2025-12-17 22:31:30 +07:00
|
|
|
INVALID_ACTION(2, "Invalid action"),
|
|
|
|
|
FILE_UPLOAD_ERROR(2, "File upload error"),
|
2026-01-13 22:40:52 +07:00
|
|
|
DUPLICATE_FILE_UPLOAD(2, "Duplicate file upload"),
|
2025-12-26 12:22:40 +07:00
|
|
|
FILE_DOWNLOAD_ERROR(2, "File download error"),
|
2026-01-20 15:12:24 +07:00
|
|
|
USER_NOT_VERIFIED(2, "User not verified"),
|
2026-02-04 14:56:19 +07:00
|
|
|
PERMISSION_NOT_FOUND(2, "Permission not found"),
|
2026-01-21 12:34:40 +07:00
|
|
|
USER_NOT_FOUND(2, "User not found"),
|
2025-12-30 02:19:07 +07:00
|
|
|
FILE_DOWNLOAD_ERROR_NOT_CORRECT_FIELD(2, "Not correct field"),
|
2025-12-22 14:07:44 +07:00
|
|
|
IMAGE_FOUND_ERROR(2, "Image found 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-18 01:13:19 +07:00
|
|
|
FILE_ENTITY_ERROR(2, "File entity error"),
|
|
|
|
|
ACCESS_DENIED(2, "Access denied"),
|
2025-12-10 19:12:54 +07:00
|
|
|
AUTH_EMAIL_NOT_FOUND(4, "Email not found"),
|
2025-12-11 13:00:01 +07:00
|
|
|
AUTH_EMAIL_OR_TOKEN_NOT_FOUND(4, "Email or Token not found "),
|
|
|
|
|
AUTH_TOKEN_MISMATCH(4, "Token mismatch"),
|
2026-01-05 16:26:46 +07:00
|
|
|
AUTH_TOKEN_NOT_FOUND(4, "Token not found"),
|
2025-12-17 22:31:30 +07:00
|
|
|
FILE_NOT_FOUND(4, "File not found"),
|
2026-01-23 16:09:51 +07:00
|
|
|
AUTH_PASSWORD_NOT_MATCHES(2, "Password does not match"),
|
2026-01-24 11:23:06 +07:00
|
|
|
SEND_EMAIL_EXCEPTION(2, "Send email exception"),
|
2026-01-28 21:18:42 +07:00
|
|
|
SIMILAR_FILES_FOUND(0, "Similar files found"),
|
|
|
|
|
FILE_IS_PROTECTED(0, "File is protected"),
|
2026-01-29 19:24:36 +07:00
|
|
|
FILE_IS_NOT_PROTECTED(0, "File is not protected"),
|
2026-02-02 15:00:18 +07:00
|
|
|
TARIFF_IS_ADD(0, "Tariff is added"),
|
|
|
|
|
TARIFF_IS_DELETED(0, "Tariff is deleted"),
|
|
|
|
|
TARIFF_IS_UPDATED(0, "Tariff is updated"),
|
|
|
|
|
TARIFF_IS_NOT_FOUND(0, "Tariff is not found"),
|
2026-01-29 19:24:36 +07:00
|
|
|
VALIDATION_ERROR(2, "Validation error"),
|
|
|
|
|
RESOURCE_NOT_FOUND(4, "Resource not found"),
|
|
|
|
|
INTERNAL_ERROR(4, "Internal server error"),
|
|
|
|
|
COMPANY_NOT_FOUND(4, "Company not found"),
|
2026-02-02 15:47:58 +07:00
|
|
|
COMPANY_ALREADY_EXISTS(2, "Company already exists"),
|
2026-02-09 11:06:50 +07:00
|
|
|
USER_LIMIT_IS_OVER(2, "Over user limits"),
|
2026-02-02 15:47:58 +07:00
|
|
|
ERROR_TARIFF_INFO(2, "Erorr with tariff info");
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|