Default Refy Controller

@RestController
@RequestMapping(value = "BASE_EQUINOX_ENDPOINT + USERS_KEY + "/{" + USER_IDENTIFIER_KEY + "}"" )
abstract class DefaultRefyController<I : RefyItem?> : EquinoxController<T, R, H>

The DefaultRefyController class is useful to give the base behavior of the Refy's controllers

Author

N7ghtm4r3 - Tecknobit

See also

EquinoxController

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
protected open var jsonHelper: JsonHelper
Link copied to clipboard
@Autowired
protected open var linksCollectionsService: LinksCollectionsService
linksCollectionsService helper to manage the LinksCollection database operations
Link copied to clipboard
@Autowired
protected open var linksService: LinksService
linksService helper to manage the RefyLink database operations
Link copied to clipboard
protected val mantis: Mantis
Link copied to clipboard
protected open var me: T
Link copied to clipboard
Link copied to clipboard
open var resourcesProvider: ResourcesProvider
Link copied to clipboard
val RESPONSE_SUCCESSFUL_MESSAGE: String = "operation_executed_successfully_key"
Link copied to clipboard
protected open var serverProtector: ServerProtector
Link copied to clipboard
@Autowired
protected open var teamsService: TeamsService
teamsService helper to manage the Team database operations
Link copied to clipboard
protected open var userItem: I
userItem the current item requested by the user
Link copied to clipboard
protected open var usersRepository: R
Link copied to clipboard
val WRONG_PROCEDURE_MESSAGE: String = "wrong_procedure_key"

Functions

Link copied to clipboard
abstract fun create(token: String, userId: String, payload: Map<String, Any>): String
Method to create a new item
Link copied to clipboard
abstract fun delete(token: String, userId: String, itemId: String): String
Method to delete an item
Link copied to clipboard
abstract fun edit(token: String, userId: String, itemId: String, payload: Map<String, Any>): String
Method to edit an existing item
Link copied to clipboard
protected open fun failedResponse(error: String): String
Link copied to clipboard
Link copied to clipboard
open fun <T> getItem(token: String, userId: String, itemId: String): T
Method to get an existing item
Link copied to clipboard
open fun initEquinoxEnvironment(    storagePath: String,     saveMessage: String,     context: Class<out Any>,     args: Array<String>,     customSubDirectories: Array<String>)
Link copied to clipboard
protected open fun isMe(id: String, token: String): Boolean
Link copied to clipboard
protected abstract fun isUserNotAuthorized(userId: String, token: String, itemId: String): Boolean
Method to get whether the user is or not authorized to operate with the item requested
Link copied to clipboard
abstract fun <T> list(token: String, userId: String, ownedOnly: Boolean, page: Int, pageSize: Int, keywords: Set<String>): T
Method to get a list of items
Link copied to clipboard
protected open fun <V> loadJsonHelper(payload: Map<String, V>)
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 userIsNotTheItemOwner(userId: String, token: String, itemId: String): Boolean
Method to get whether the user is or not the owner of the item requested