Commit 48b106d9 by Patryk Czarnik

ktoraGodzina - JSON

parent 9fc9d832
package com.example.demo;
import java.time.LocalTime;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -24,4 +26,12 @@ public class HelloController {
return "Ahoj świecie!";
}
// TODO dodaj metodę działającą pod adresem ktora-godzina
// która wypisuje biężacy czas
@RequestMapping("/ktora-godzina")
@ResponseBody
public LocalTime ktoraGodzina() {
return LocalTime.now();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment