// Path: src/main/java/com/nuvola/myproject/server/service/UserService.java
// public interface UserService {
//     User getUserByUsername(String username);
// 
//     List<String> getPermissions(String username);
// 
//     User getCurrentUser();
// 
//     Boolean isCurrentUserLoggedIn();
// }
// 
// Path: src/main/java/com/nuvola/myproject/shared/model/User.java
// public class User {
//     private String login;
//     private String email;
//     private String firstName;
//     private String lastName;
//     private String password;
// 
//     public String getLogin() {
//         return login;
//     }
// 
//     public void setLogin(String login) {
//         this.login = login;
//     }
// 
//     public String getEmail() {
//         return email;
//     }
// 
//     public void setEmail(String email) {
//         this.email = email;
//     }
// 
//     public String getFirstName() {
//         return firstName;
//     }
// 
//     public void setFirstName(String firstName) {
//         this.firstName = firstName;
//     }
// 
//     public String getLastName() {
//         return lastName;
//     }
// 
//     public void setLastName(String lastName) {
//         this.lastName = lastName;
//     }
// 
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = password;
//     }
// }
// 
// Path: src/main/java/com/nuvola/myproject/shared/ResourcePaths.java
// public static final String LOGIN = "/login";
// 
// Path: src/main/java/com/nuvola/myproject/shared/ResourcePaths.java
// public static final String ROOT = "/user";


import javax.annotation.security.PermitAll;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.nuvola.myproject.server.service.UserService;
import com.nuvola.myproject.shared.model.User;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.http.ResponseEntity.ok;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static com.nuvola.myproject.shared.ResourcePaths.User.LOGIN;
import static com.nuvola.myproject.shared.ResourcePaths.User.ROOT;
package com.nuvola.myproject.server.controller;






@RestController
@RequestMapping(value = ROOT, produces = MediaType.APPLICATION_JSON_VALUE)
public class UserController {
    private final UserService userService;

    @Autowired
    UserController(UserService userService) {
        this.userService = userService;
    }

    @RequestMapping(value = LOGIN, method = GET)
    @PermitAll
    ResponseEntity<Boolean> isCurrentUserLoggedIn() {
        return new ResponseEntity<>(userService.isCurrentUserLoggedIn(), OK);
    }

    @RequestMapping(method = GET)
// Path: src/main/java/com/nuvola/myproject/server/service/UserService.java
// public interface UserService {
//     User getUserByUsername(String username);
// 
//     List<String> getPermissions(String username);
// 
//     User getCurrentUser();
// 
//     Boolean isCurrentUserLoggedIn();
// }
// 
// Path: src/main/java/com/nuvola/myproject/shared/model/User.java
// public class User {
//     private String login;
//     private String email;
//     private String firstName;
//     private String lastName;
//     private String password;
// 
//     public String getLogin() {
//         return login;
//     }
// 
//     public void setLogin(String login) {
//         this.login = login;
//     }
// 
//     public String getEmail() {
//         return email;
//     }
// 
//     public void setEmail(String email) {
//         this.email = email;
//     }
// 
//     public String getFirstName() {
//         return firstName;
//     }
// 
//     public void setFirstName(String firstName) {
//         this.firstName = firstName;
//     }
// 
//     public String getLastName() {
//         return lastName;
//     }
// 
//     public void setLastName(String lastName) {
//         this.lastName = lastName;
//     }
// 
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = password;
//     }
// }
// 
// Path: src/main/java/com/nuvola/myproject/shared/ResourcePaths.java
// public static final String LOGIN = "/login";
// 
// Path: src/main/java/com/nuvola/myproject/shared/ResourcePaths.java
// public static final String ROOT = "/user";


// Path: src/main/java/com/nuvola/myproject/server/controller/UserController.java
import javax.annotation.security.PermitAll;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.nuvola.myproject.server.service.UserService;
import com.nuvola.myproject.shared.model.User;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.http.ResponseEntity.ok;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static com.nuvola.myproject.shared.ResourcePaths.User.LOGIN;
import static com.nuvola.myproject.shared.ResourcePaths.User.ROOT;

package com.nuvola.myproject.server.controller;






@RestController
@RequestMapping(value = ROOT, produces = MediaType.APPLICATION_JSON_VALUE)
public class UserController {
    private final UserService userService;

    @Autowired
    UserController(UserService userService) {
        this.userService = userService;
    }

    @RequestMapping(value = LOGIN, method = GET)
    @PermitAll
    ResponseEntity<Boolean> isCurrentUserLoggedIn() {
        return new ResponseEntity<>(userService.isCurrentUserLoggedIn(), OK);
    }

    @RequestMapping(method = GET)
    ResponseEntity<User> getCurrentUser() {