Ametista Users Controller

@RestController
open class AmetistaUsersController : EquinoxUsersController<T, R, H>

The AmetistaUsersController class is useful to manage all the user operations

Author

N7ghtm4r3 - Tecknobit

See also

EquinoxController

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val adminCodeProvider: ServerProtector
adminCodeProvider helper to provide the admin code and manage the admin accesses
Link copied to clipboard
protected val configuration: EquinoxBackendConfiguration
Link copied to clipboard
private val INVALID_ADMIN_CODE_MESSAGE: String = "invalid_admin_code"
INVALID_ADMIN_CODE_MESSAGE error message used when the admin code inserted is not valid
Link copied to clipboard
protected open var jsonHelper: JsonHelper
Link copied to clipboard
protected open var me: T
Link copied to clipboard
protected open var messageSource: MessageSource
Link copied to clipboard
open var resourcesProvider: ResourcesProvider
Link copied to clipboard
val RESPONSE_SUCCESSFUL_MESSAGE: String = "operation_executed_successfully"
Link copied to clipboard
protected open var serverProtector: ServerProtector
Link copied to clipboard
protected open var usersRepository: R
Link copied to clipboard
protected open var usersService: H
Link copied to clipboard
val WRONG_EMAIL_MESSAGE: String = "wrong_email"
Link copied to clipboard
val WRONG_LANGUAGE_MESSAGE: String = "wrong_language"
Link copied to clipboard
val WRONG_NAME_MESSAGE: String = "wrong_name"
Link copied to clipboard
val WRONG_PASSWORD_MESSAGE: String = "wrong_password"
Link copied to clipboard
val WRONG_PROCEDURE_MESSAGE: String = "wrong_procedure"
Link copied to clipboard
val WRONG_SURNAME_MESSAGE: String = "wrong_surname"

Functions

Link copied to clipboard
@PostMapping(path = "USERS_KEY + "/{" + IDENTIFIER_KEY + "}/" + SESSION_KEY + "/" + MEMBERS_KEY", headers = [] )
open fun addViewer(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @RequestBody payload: Map<String, String>): String
Method to add a new VIEWER in the system
Link copied to clipboard
protected open fun assembleSignInSuccessResponse(user: T): JSONObject
Link copied to clipboard
open fun changeEmail(userId: String, token: String, payload: Map<String, String>): String
Link copied to clipboard
open fun changeLanguage(userId: String, token: String, payload: Map<String, String>): String
Link copied to clipboard
open fun changePassword(userId: String, token: String, payload: Map<String, String>): String
Link copied to clipboard
@PatchMapping(path = "USERS_KEY + "/{" + IDENTIFIER_KEY + "}" + CHANGE_PRESET_PASSWORD_ENDPOINT", headers = [] )
open fun changePresetPassword(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @RequestBody payload: Map<String, String>): String
Method to change the preset password of a VIEWER
Link copied to clipboard
open fun changeProfilePic(userId: String, token: String, profilePic: MultipartFile): String
Link copied to clipboard
open fun deleteAccount(userId: String, token: String): String
Link copied to clipboard
protected open fun failedResponse(errorKey: String): String
Link copied to clipboard
Link copied to clipboard
open fun getDynamicAccountData(userId: String, token: String): String
Link copied to clipboard
protected open fun getInternationalizedMessage(messageKey: String): String
Link copied to clipboard
@GetMapping(path = "USERS_KEY + "/{" + IDENTIFIER_KEY + "}/" + SESSION_KEY + "/" + MEMBERS_KEY", headers = [] )
open fun <T> getSessionMembers(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @RequestParam(value = "page", defaultValue = "0", required = false) page: Int, @RequestParam(value = "pageSize", defaultValue = "10", required = false) pageSize: Int): T
Method to get the current members registered in the system
Link copied to clipboard
protected open fun getSignInCustomParams(): Array<Any>
Link copied to clipboard
protected open fun getSignUpCustomParams(): Array<Any>
Link copied to clipboard
open fun initEquinoxEnvironment(context: Class<out Any>, args: Array<String>)
Link copied to clipboard
private open fun isAdmin(userId: String, token: String): Boolean
Method to get whether the user who request to execute an action is a ADMIN
Link copied to clipboard
protected open fun isMe(id: String, token: String): Boolean
Link copied to clipboard
protected open fun loadJsonHelper(payload: JSONObject)
Link copied to clipboard
protected open fun plainResponse(status: ResponseStatus, message: String): String
Link copied to clipboard
@DeleteMapping(path = "USERS_KEY + "/{" + IDENTIFIER_KEY + "}/" + SESSION_KEY + "/" + MEMBERS_KEY + "/{" + MEMBER_IDENTIFIER_KEY + "}"", headers = [] )
open fun removeMember(@PathVariable(value = "id") userId: String, @RequestHeader(value = "token") token: String, @PathVariable(value = "member_id") memberId: String): String
Method to remove a member from the system
Link copied to clipboard
protected open fun setSessionLocale(locale: String)
Link copied to clipboard
open fun signIn(payload: Map<String, Any>): String
Link copied to clipboard
@PostMapping(path = "users/signUp" )
open fun signUp(@RequestBody payload: Map<String, Any>): String
Method to sign up in the Equinox's system
Link copied to clipboard
protected open fun successResponse(): String
protected open fun <V> successResponse(value: V): HashMap<String, V>
Link copied to clipboard
protected open fun validateSignIn(email: String, password: String, language: String, custom: Array<Any>): String
Link copied to clipboard
protected open fun validateSignUp(name: String, surname: String, email: String, password: String, language: String, custom: Array<Any>): String