use of com.webank.wedatasphere.qualitis.metadata.request.GetColumnByUserAndTableRequest in project Qualitis by WeBankFinTech.
the class MetaDataServiceImpl method getUserColumnByTableId.
@Override
public GeneralResponse<GetAllResponse<ColumnInfoDetail>> getUserColumnByTableId(GetUserColumnByTableIdRequest request) throws UnExpectedRequestException, MetaDataAcquireFailedException {
// Check Arguments
checkRequest(request);
// Get login user
String userName = "";
if (request.getLoginUser() != null) {
userName = request.getLoginUser();
LOGGER.info("Recover user[{}] from is get column info.", userName);
} else {
userName = HttpUtils.getUserName(httpServletRequest);
;
}
if (StringUtils.isNotBlank(request.getProxyUser())) {
userName = request.getProxyUser();
}
GetColumnByUserAndTableRequest getColumnByUserAndTableRequest = new GetColumnByUserAndTableRequest(userName, request.getStartIndex(), request.getPageSize(), request.getClusterName(), request.getDbName(), request.getTableName());
DataInfo<ColumnInfoDetail> response = metaDataClient.getColumnByUserAndTable(getColumnByUserAndTableRequest);
GetAllResponse<ColumnInfoDetail> result = new GetAllResponse<>();
result.setTotal(response.getTotalCount());
result.setData(response.getContent());
LOGGER.info("Succeed to get column by table. table: {}.{}.{}", request.getClusterName(), request.getDbName(), request.getTableName());
return new GeneralResponse<>("200", "{&GET_COLUMN_SUCCESSFULLY}", result);
}
Aggregations