Notes Controller

@RestController
@RequestMapping(path = "BASE_EQUINOX_ENDPOINT + USERS_KEY + "/{" + IDENTIFIER_KEY + "}/" + NOTES_KEY" )
open class NotesController : DefaultPandoroController

The NotesController class is useful to manage all the note operations

Author

N7ghtm4r3 - Tecknobit

See also

EquinoxController

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
protected open var jsonHelper: JsonHelper
Link copied to clipboard
protected val mantis: Mantis
Link copied to clipboard
protected open var me: T
Link copied to clipboard
protected open var messageSource: MessageSource
Link copied to clipboard
@Autowired
private open var notesService: NotesService
notesService instance to manage the notes database operations
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
val WRONG_CONTENT_NOTE_MESSAGE: String = "wrong_content_note"
WRONG_CONTENT_NOTE_MESSAGE message to use when a wrong content note has been inserted
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
@PatchMapping(path = ""{" + NOTE_IDENTIFIER_KEY + "}" + CHANGE_NOTE_STATUS_ENDPOINT", headers = [] )
open fun changeNoteStatus(    @PathVariable(value = "id") id: String,     @RequestHeader(value = "token") token: String,     @PathVariable(value = "note_id") noteId: String,     @RequestBody payload: Map<String, Any>): String
Method to mark as done an existing note
Link copied to clipboard
@PostMapping(headers = [] )
open fun createNote(    @PathVariable(value = "id") id: String,     @RequestHeader(value = "token") token: String,     @RequestBody payload: Map<String, String>): String
Method to create a new note
Link copied to clipboard
@DeleteMapping(path = "{" + NOTE_IDENTIFIER_KEY + "}", headers = [] )
open fun deleteNote(    @PathVariable(value = "id") id: String,     @RequestHeader(value = "token") token: String,     @PathVariable(value = "note_id") noteId: String): String
Method to delete an existing note
Link copied to clipboard
@PatchMapping(path = "{" + NOTE_IDENTIFIER_KEY + "}", headers = [] )
open fun editNote(    @PathVariable(value = "id") id: String,     @PathVariable(value = "note_id") noteId: String,     @RequestHeader(value = "token") token: String,     @RequestBody payload: Map<String, String>): String
Method to edit an existing note
Link copied to clipboard
protected open fun failedResponse(errorKey: String): String
Link copied to clipboard
Link copied to clipboard
protected open fun getInternationalizedMessage(messageKey: String): String
Link copied to clipboard
@GetMapping(path = "/{" + NOTE_IDENTIFIER_KEY + "}", headers = [] )
open fun <T> getNote(    @PathVariable(value = "id") id: String,     @RequestHeader(value = "token") token: String,     @PathVariable(value = "note_id") noteId: String): T
Method to get a notes list
Link copied to clipboard
@GetMapping(headers = [] )
open fun <T> getNotes(    @PathVariable(value = "id") id: String,     @RequestHeader(value = "token") token: String,     @RequestParam(name = "page", defaultValue = "0", required = false) page: Int,     @RequestParam(name = "pageSize", defaultValue = "10", required = false) pageSize: Int,     @RequestParam(name = "marked_as_done", defaultValue = "all", required = false) statusFilter: String): T
Method to get a notes list
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 open fun loadJsonHelper(payload: JSONObject)
Link copied to clipboard
protected open fun plainResponse(status: ResponseStatus, message: String): String
Link copied to clipboard
protected open fun setSessionLocale(locale: String)
Link copied to clipboard
protected open fun successResponse(): String
protected open fun <V> successResponse(value: V): HashMap<String, V>