1
|
package eu.dnetlib.repo.manager.controllers;
|
2
|
|
3
|
import eu.dnetlib.repo.manager.service.UserServiceImpl;
|
4
|
import io.swagger.annotations.Api;
|
5
|
import org.springframework.beans.factory.annotation.Autowired;
|
6
|
import org.springframework.http.ResponseEntity;
|
7
|
import org.springframework.security.access.prepost.PreAuthorize;
|
8
|
import org.springframework.web.bind.annotation.RequestMapping;
|
9
|
import org.springframework.web.bind.annotation.RequestMethod;
|
10
|
import org.springframework.web.bind.annotation.RestController;
|
11
|
|
12
|
@RestController
|
13
|
@RequestMapping(value = "/user")
|
14
|
@Api(description = "User API", tags = {"user"})
|
15
|
public class UserController {
|
16
|
|
17
|
@Autowired
|
18
|
private UserServiceImpl userService;
|
19
|
|
20
|
@RequestMapping(value = "/login" , method = RequestMethod.GET)
|
21
|
@PreAuthorize("hasRole('ROLE_USER')")
|
22
|
public ResponseEntity<Object> login() {
|
23
|
return userService.login();
|
24
|
}
|
25
|
}
|