use of org.mx.service.rest.vo.DataVO in project main by JohnPeng739.
the class UserManageResource method getUser.
@Path("users/{id}")
@GET
@AuthenticateAround(returnValueClass = DataVO.class)
public DataVO<UserVO> getUser(@PathParam("id") String id) {
try {
User user = accessor.getById(id, User.class);
UserVO userVO = UserVO.transform(user);
return new DataVO<>(userVO);
} catch (UserInterfaceException ex) {
return new DataVO<>(ex);
} catch (Exception ex) {
if (logger.isErrorEnabled()) {
logger.error("Get user fail.", ex);
}
return new DataVO<>(new UserInterfaceSystemErrorException(UserInterfaceSystemErrorException.SystemErrors.SYSTEM_OTHER_FAIL));
}
}
Aggregations