Ametista Users Helper

@Primary
@Service
open class AmetistaUsersHelper : EquinoxUsersHelper<T, R>

The EquinoxUsersHelper class is useful to manage all the user database operations

Author

N7ghtm4r3 - Tecknobit

See also

EquinoxUsersHelper
EquinoxItemsHelper
ResourcesManager

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
protected val _DROP_COLUMN_: String = " DROP COLUMN "
Link copied to clipboard
private val _IN_CLAUSE_: String = " IN "
Link copied to clipboard
val _VALUES_: String = " VALUES "
Link copied to clipboard
val _WHERE_: String = " WHERE "
Link copied to clipboard
protected val ALTER_TABLE_: String = "ALTER TABLE "
Link copied to clipboard
protected val BASE_SIGN_UP_QUERY: String = "INSERT INTO users("
Link copied to clipboard
Link copied to clipboard
val COMMA: String = ","
Link copied to clipboard
Link copied to clipboard
val DELETE_FROM_: String = "DELETE FROM "
Link copied to clipboard
protected open var discriminatorValue: String
Link copied to clipboard
protected open var entityManager: EntityManager
Link copied to clipboard
Link copied to clipboard
val PROFILES_DIRECTORY: String = "profiles"
Link copied to clipboard
Link copied to clipboard
val RESOURCES_KEY: String = "resources"
Link copied to clipboard
val RESOURCES_PATH: String = "resources/"
Link copied to clipboard
val SINGLE_QUOTE: String = "'"
Link copied to clipboard
protected open var usersRepository: R
Link copied to clipboard
protected val VALUES_QUERY_PART: String = " VALUES ("

Functions

Link copied to clipboard
open fun addViewer(name: String, surname: String, email: String)
Method to add a new viewer in the system
Link copied to clipboard
protected open fun batchDelete(table: String, values: List<List<out Any>>, columns: Array<String>)
Link copied to clipboard
protected open fun batchInsert(command: EquinoxItemsHelper.InsertCommand, table: String, values: List<out Any>, batchQuery: EquinoxItemsHelper.BatchQuery, columns: Array<String>)
Link copied to clipboard
open fun changeEmail(newEmail: String, userId: String)
Link copied to clipboard
open fun changeLanguage(newLanguage: String, userId: String)
Link copied to clipboard
open fun changePassword(newPassword: String, userId: String)
Link copied to clipboard
open fun changeProfilePic(profilePic: MultipartFile, userId: String): String
Link copied to clipboard
open fun createProfileResource(resource: MultipartFile, resourceId: String): String
Link copied to clipboard
open fun createResource(resource: MultipartFile, resourcesDirectory: String, resourceId: String): String
Link copied to clipboard
Link copied to clipboard
open fun deleteResource(resourcesDirectory: String, resourceId: String): Boolean
Link copied to clipboard
open fun deleteUser(id: String)
Link copied to clipboard
protected open fun getQueryValuesKeys(): List<String>
Method to get the list of keys to use in the BASE_SIGN_UP_QUERY No-any params required
Link copied to clipboard
open fun getSessionMembers(page: Int, pageSize: Int, userId: String): PaginatedResponse<AmetistaMember>
Method to get the current session members
Link copied to clipboard
open fun getSuffixResource(resource: MultipartFile): String
Link copied to clipboard
protected open fun hash(secret: String): String
Link copied to clipboard
open fun saveResource(resource: MultipartFile, path: String)
Link copied to clipboard
open fun signInUser(email: String, password: String, custom: Array<Any>): T
Link copied to clipboard
open fun signUpUser(id: String, token: String, name: String, surname: String, email: String, password: String, language: String, custom: Array<Any>)
Method to sign up a new user in the system
Link copied to clipboard
protected open fun <V> syncBatch(container: EquinoxItemsHelper.SyncBatchContainer, table: String, targetId: String, updatedData: List<V>, batchQuery: EquinoxItemsHelper.BatchQuery)
Link copied to clipboard
open fun userExists(userId: String): Boolean
Method to get whether the user is present in the database
Link copied to clipboard
protected open fun validateSignIn(user: T, password: String, custom: Array<Any>): Boolean