Commit 9620656e by Patryk Czarnik

Pobierz czas i inne proste przykłady

parent 4a4d34d7
package com.example.demo;
import java.time.LocalDateTime;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
......@@ -7,10 +9,23 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class PierwszyController {
@RequestMapping("/")
@ResponseBody
public String index() {
return "Aplikacja springowa";
}
@RequestMapping("/hello")
@ResponseBody
public String hello() {
return "Hello world";
}
// Dodaj metodę wyświetlającą bieżący czas
@RequestMapping("/czas")
@ResponseBody
public LocalDateTime czas() {
return LocalDateTime.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