January 2018
Intermediate to advanced
434 pages
14h 1m
English
In this recipe, we will create a REST controller that will fetch us information about students in a college. We will be using an in-memory database using a list to keep things simple:
package collegeclass Student() { lateinit var roll_number: String lateinit var name: String constructor( roll_number: String, name: String): this() { this.roll_number = roll_number this.name = name }}
@Componentclass StudentDatabase { private val students = mutableListOf<Student>()}
Note that we have annotated the StudentDatabase class with @Component, which means its ...
Read now
Unlock full access