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"), INVALID_FIELD(2, "Invalid field"), INVALID_TOKEN(2, "Invalid token"), 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"), USER_NOT_VERIFIED(2, "User not verified"), USER_NOT_FOUND(2, "User not found"), FILE_DOWNLOAD_ERROR_NOT_CORRECT_FIELD(2, "Not correct field"), 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"), COMPANY_ALREADY_EXISTS(2, "Company already exists"), ERROR_TARIFF_INFO(2, "Erorr with tariff info"); 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; } }