* @see UserWebService#getUser()
*/
//SpringSecurity 控制的方法
@Secured( { "ROLE_Admin" })
public GetUserResult getUser(String id) {
StopWatch totalStopWatch = new Slf4JStopWatch();
//校验请求参数
try {
Assert.notNull(id, "id参数为空");
} catch (IllegalArgumentException e) {
logger.error(e.getMessage());
return WSResult.buildResult(GetUserResult.class, WSResult.PARAMETER_ERROR, e.getMessage());
}
//获取用户
try {
StopWatch dbStopWatch = new Slf4JStopWatch("GetUser.fetchDB");
User entity = accountManager.getInitedUser(id);
dbStopWatch.stop();
UserDTO dto = dozer.map(entity, UserDTO.class);
GetUserResult result = new GetUserResult();
result.setUser(dto);