package eu.dnetlib.loginservice.controllers; import eu.dnetlib.loginservice.entities.User; import eu.dnetlib.loginservice.services.UserInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @RestController public class UserController { private final UserInfoService userInfoService; @Autowired public UserController(UserInfoService userInfoService) { this.userInfoService = userInfoService; } @RequestMapping(value = "/userInfo", method = RequestMethod.GET) public ResponseEntity getUserInfo() { return ResponseEntity.ok(userInfoService.getUserInfo()); } }