use of com.webank.wedatasphere.qualitis.query.response.RuleQueryProject in project Qualitis by WeBankFinTech.
the class RuleQueryServiceImpl method query.
/**
* Query rule by creator
*
* @param queryParam
* @return List<RuleQueryProject>
*/
@Override
public List<RuleQueryProject> query(RuleQueryRequest queryParam) {
DataSourceQo param = new DataSourceQo(queryParam);
// Query project user by creator
List<ProjectUser> projectUsers = projectUserDao.findByUsernameAndPermissionsIn(param);
boolean projectUsersNull = (projectUsers == null || projectUsers.isEmpty());
if (projectUsersNull) {
LOGGER.info("[My DataSource] Find no projects of user:{},", queryParam.getUser());
return null;
}
Map<Long, RuleQueryProject> projectMap = new HashMap<>(4);
getProjectsByUserPerm(param, projectUsers, projectMap);
if (projectMap.values().isEmpty()) {
LOGGER.info("[My DataSource] Find no datasources/rules of user, user: {}", queryParam.getUser());
return null;
}
return new ArrayList<>(projectMap.values());
}
use of com.webank.wedatasphere.qualitis.query.response.RuleQueryProject in project Qualitis by WeBankFinTech.
the class RuleQueryServiceImpl method putIntoProject.
private void putIntoProject(RuleDataSource ds, Map<Long, RuleQueryProject> projectMap, Project project) {
Rule rule = ds.getRule();
Long projectId = ds.getProjectId();
// If contains
if (projectMap.containsKey(projectId)) {
RuleQueryProject queryProject = projectMap.get(projectId);
putIntoRuleOfProject(ds, queryProject);
return;
}
// If not contain
RuleQueryProject queryProject = newRuleQueryProject(project, rule, ds);
projectMap.put(projectId, queryProject);
}
Aggregations