May 2018
Intermediate to advanced
310 pages
6h 18m
English
In the next chapter, we will obtain data from the database and return everything dynamically but, for now, we will be happy to have at least this dummy data. Let's apply all that we have learned so far to the rest of our API calls.
Define an entity for TODOs and create a Todo data class with the following fields:
package com.journaler.api.data
data class Todo(
var id: String = "",
var title: String,
var message: String,
var schedule: Long,
var location: String = ""
)
We are ready to write a controller class for TODOs. Before we do so, let's draft the rest of the Note entity API calls:
package com.journaler.api.controller import com.journaler.api.data.Note import org.springframework.http.MediaType import org.springframework.web.bind.annotation.* ...
Read now
Unlock full access