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