WEBBPMNEXT-9188 fix
This commit is contained in:
parent
d5cde135a3
commit
1b5d862ba1
1 changed files with 0 additions and 34 deletions
|
|
@ -1,34 +0,0 @@
|
|||
package controller;
|
||||
|
||||
import dto.jivoprofile.JivoProfileDto;
|
||||
import org.hsqldb.lib.StringUtil;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import ru.cg.webbpm.modules.security.api.model.User;
|
||||
import ru.cg.webbpm.modules.security.api.service.UserService;
|
||||
|
||||
@RestController
|
||||
public class ProfileController {
|
||||
|
||||
private UserService userService;
|
||||
|
||||
public ProfileController(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/profile/jivo/{userId}", method = RequestMethod.GET)
|
||||
public JivoProfileDto profile(@PathVariable("userId") String userId) {
|
||||
|
||||
if (StringUtil.isEmpty(userId)) {
|
||||
return new JivoProfileDto();
|
||||
}
|
||||
|
||||
User user = userService.get(userId);
|
||||
|
||||
JivoProfileDto profileDto = new JivoProfileDto();
|
||||
profileDto.setUsername(user.firstName());
|
||||
profileDto.setEmail(user.email());
|
||||
profileDto.setPhone(user.phone());
|
||||
return profileDto;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue