Commit c726c36d by Patryk Czarnik

ktoraGodzina @ResponseBody

parent ff11594b
package sklep.controller; package sklep.controller;
import java.time.LocalDateTime;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -19,4 +21,11 @@ public class RootController { ...@@ -19,4 +21,11 @@ public class RootController {
return "Hello Spring"; return "Hello Spring";
} }
@RequestMapping("/time")
@ResponseBody
public String ktoraGodzina() {
LocalDateTime dt = LocalDateTime.now();
return dt.toString();
}
} }
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