1
|
/**
|
2
|
* Copyright (C) 2016 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.remote.controller;
|
10
|
|
11
|
import io.swagger.annotations.Api;
|
12
|
|
13
|
import java.security.Principal;
|
14
|
|
15
|
import org.springframework.beans.factory.annotation.Autowired;
|
16
|
import org.springframework.stereotype.Controller;
|
17
|
import org.springframework.web.bind.annotation.RequestMapping;
|
18
|
import org.springframework.web.bind.annotation.RequestMethod;
|
19
|
|
20
|
import eu.etaxonomy.cdm.api.service.IUserService;
|
21
|
import eu.etaxonomy.cdm.model.permission.User;
|
22
|
|
23
|
/**
|
24
|
* @author a.kohlbecker
|
25
|
* @since Oct 11, 2016
|
26
|
*
|
27
|
*/
|
28
|
@Controller
|
29
|
@Api("user")
|
30
|
@RequestMapping(value = {"/user"})
|
31
|
public class UserController extends AbstractController<User, IUserService> {
|
32
|
|
33
|
/**
|
34
|
* {@inheritDoc}
|
35
|
*/
|
36
|
@Override
|
37
|
@Autowired
|
38
|
public void setService(IUserService service) {
|
39
|
this.service = service;
|
40
|
}
|
41
|
|
42
|
@RequestMapping(value="me", method=RequestMethod.GET)
|
43
|
public Principal doGetCurrentUser(Principal principal) {
|
44
|
return principal;
|
45
|
}
|
46
|
|
47
|
|
48
|
|
49
|
}
|