use of org.mx.comps.rbac.rest.vo.AccountVO in project main by JohnPeng739.
the class UserManageResource method allocateAccount.
@Path("users/{userId}/allocate")
@POST
@AuthenticateAround(returnValueClass = DataVO.class)
public DataVO<AccountVO> allocateAccount(@QueryParam("userCode") String userCode, @PathParam("userId") String userId, AccountInfoVO accountInfoVO) {
sessionDataStore.setCurrentUserCode(userCode);
try {
accountInfoVO.setOwnerId(userId);
Account account = userManageService.allocateAccount(accountInfoVO.getAccountInfo());
AccountVO accountVO = AccountVO.transform(account, true);
sessionDataStore.removeCurrentUserCode();
return new DataVO<>(accountVO);
} catch (UserInterfaceException ex) {
return new DataVO<>(ex);
} catch (Exception ex) {
if (logger.isErrorEnabled()) {
logger.error("Allocate account fail.", ex);
}
return new DataVO<>(new UserInterfaceSystemErrorException(UserInterfaceSystemErrorException.SystemErrors.SYSTEM_OTHER_FAIL));
}
}
Aggregations