78 lines
3.2 KiB
Java
78 lines
3.2 KiB
Java
package ru.soune.nocopy.dto;
|
|
|
|
public enum MessageCode {
|
|
SUCCESS(0, "Operation successful"),
|
|
REG_EMAIL_EXISTS(1, "Email already registered"),
|
|
REG_EMAIL_OR_PHONE_EXISTS(1, "Email or phone already registered"),
|
|
REFERRAL_LINK_IS_NOT_EXIST(1, "Refferal link is not exist"),
|
|
INVALID_FIELD(2, "Invalid field"),
|
|
MAIL_VERIFIED_NULL(2, "Mail verified null"),
|
|
INVALID_TOKEN(2, "Token not found or time expired"),
|
|
TOKEN_IS_ALIVE(2, "Token is alive"),
|
|
INVALID_ACTION(2, "Invalid action"),
|
|
FILE_UPLOAD_ERROR(2, "File upload error"),
|
|
DUPLICATE_FILE_UPLOAD(2, "Duplicate file upload"),
|
|
FILE_DOWNLOAD_ERROR(2, "File download error"),
|
|
FILE_NOT_EXIST(2, "File not exist on disk"),
|
|
FILE_DELETE(2, "File was deleted"),
|
|
USER_NOT_HAD_PERMISSION(2, "User not have permission for file"),
|
|
USER_NOT_VERIFIED(2, "User not verified"),
|
|
PERMISSION_NOT_FOUND(2, "Permission not found"),
|
|
USER_NOT_FOUND(2, "User not found"),
|
|
FILE_DOWNLOAD_ERROR_NOT_CORRECT_FIELD(2, "Not correct field"),
|
|
TOKEN_IS_NULL(2, "Token field is null"),
|
|
IMAGE_FOUND_ERROR(2, "Image found error"),
|
|
INVALID_JSON_BODY(2, "Invalid fields in JSON object"),
|
|
INCOMPLETE_UPLOAD(2, "Not load all chunks"),
|
|
MSG_ID_NOT_FOUND(4, "Message id not found"),
|
|
FILE_ENTITY_ERROR(2, "File entity error"),
|
|
ACCESS_DENIED(2, "Access denied"),
|
|
AUTH_EMAIL_NOT_FOUND(4, "Email not found"),
|
|
AUTH_EMAIL_OR_TOKEN_NOT_FOUND(4, "Email or Token not found "),
|
|
AUTH_TOKEN_MISMATCH(4, "Token mismatch"),
|
|
AUTH_TOKEN_NOT_FOUND(4, "Token not found"),
|
|
FILE_NOT_FOUND(4, "File not found"),
|
|
AUTH_PASSWORD_NOT_MATCHES(2, "Password does not match"),
|
|
SEND_EMAIL_EXCEPTION(2, "Send email exception"),
|
|
SIMILAR_FILES_FOUND(0, "Similar files found"),
|
|
FILE_IS_PROTECTED(0, "File is protected"),
|
|
FILE_IS_NOT_PROTECTED(0, "File is not protected"),
|
|
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"),
|
|
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"),
|
|
PAYMENT_NOT_FOUND(4, "Payment not found"),
|
|
COMPANY_ALREADY_EXISTS(2, "Company already exists"),
|
|
USER_LIMIT_IS_OVER(2, "Over user limits"),
|
|
MONITORING_TYPE_NOT_FOUND(4, "Monitoring type not found"),
|
|
ERROR_TARIFF_INFO(2, "Erorr with tariff info"),
|
|
FILE_FOR_SEARCH_NOT_VALID(2, "File for search unsupported"),
|
|
NOT_VALID_FILE_TYPE_OR_COUNT_FILE(2, "Cost for file type not found, count is negative or files count" +
|
|
"more than max valid"),
|
|
USER_NOT_ACTIVE(2, "User not active"),
|
|
NOTION_NOT_FOUND(4, "Notion not found"),
|
|
NOT_FOUND(4, "Notion not found"),
|
|
MESSAGE_IS_REQUIRED_FOR_NOTION(4, "Message is required for notion");
|
|
|
|
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;
|
|
}
|
|
}
|