Added main controller and user entity

This commit is contained in:
mirrerror
2023-09-21 10:21:31 +03:00
parent ac175a6bd2
commit ccea0d393c
3 changed files with 48 additions and 1 deletions

View File

@@ -1,13 +1,21 @@
package com.faf223.expensetrackerfaf.controllers;
import entities.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
@RestController
class GetHelloWorld {
public class MainController {
@GetMapping("/")
public String helloWorld() {
return "Hello, World!";
}
@GetMapping("/users/{id}")
public User getUser(@PathVariable int id) {
return new User(id, "Test");
}
}