2019-02-16 11:04:41 +01:00
|
|
|
package eu.dnetlib.repo.manager.controllers;
|
|
|
|
|
|
|
|
import eu.dnetlib.repo.manager.service.UserServiceImpl;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
@RequestMapping(value = "/user")
|
|
|
|
@Api(description = "User API", tags = {"user"})
|
|
|
|
public class UserController {
|
|
|
|
|
|
|
|
@Autowired
|
2019-07-22 15:00:51 +02:00
|
|
|
private UserServiceImpl userService;
|
2019-02-16 11:04:41 +01:00
|
|
|
|
|
|
|
@RequestMapping(value = "/login" , method = RequestMethod.GET)
|
2021-07-21 13:51:18 +02:00
|
|
|
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
2019-02-16 11:04:41 +01:00
|
|
|
public ResponseEntity<Object> login() {
|
|
|
|
return userService.login();
|
|
|
|
}
|
|
|
|
}
|