Search in sources :

Example 1 with GetColumnByUserAndTableRequest

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);
}
Also used : GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) GetColumnByUserAndTableRequest(com.webank.wedatasphere.qualitis.metadata.request.GetColumnByUserAndTableRequest) ColumnInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.column.ColumnInfoDetail) GetAllResponse(com.webank.wedatasphere.qualitis.response.GetAllResponse)

Aggregations

GetColumnByUserAndTableRequest (com.webank.wedatasphere.qualitis.metadata.request.GetColumnByUserAndTableRequest)1 ColumnInfoDetail (com.webank.wedatasphere.qualitis.metadata.response.column.ColumnInfoDetail)1 GeneralResponse (com.webank.wedatasphere.qualitis.response.GeneralResponse)1 GetAllResponse (com.webank.wedatasphere.qualitis.response.GetAllResponse)1