Created
May 3, 2022 13:47
-
-
Save i07/f022d54e13f6b9e9c940054871876eee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package donkers.tutorial.medium | |
import org.springframework.http.HttpStatus | |
import org.springframework.http.ResponseEntity | |
import org.springframework.web.bind.annotation.GetMapping | |
import org.springframework.web.bind.annotation.RequestMapping | |
import org.springframework.web.bind.annotation.RestController | |
import java.time.LocalDateTime | |
data class StatusObject(var timestamp:LocalDateTime, var message:String) { | |
constructor():this(LocalDateTime.now(), "Server Ok!") | |
} | |
@RestController | |
@RequestMapping("/") | |
class StatusController { | |
@GetMapping("status") | |
fun getStatus():ResponseEntity<StatusObject> { | |
return ResponseEntity(StatusObject(), HttpStatus.OK) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment