Browse Source

Merge pull request #506 from lgcareer/dev-1.1.0

update the ability for administrators to view all data sources by type
pull/2/head
lgcareer 6 years ago committed by GitHub
parent
commit
8464c3e074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      escheduler-api/src/main/java/cn/escheduler/api/service/DataSourceService.java
  2. 2
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/DataSourceMapper.java
  3. 1
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/DataSourceMapperProvider.java

2
escheduler-api/src/main/java/cn/escheduler/api/service/DataSourceService.java

@ -328,7 +328,7 @@ public class DataSourceService extends BaseService{
List<DataSource> datasourceList;
if (isAdmin(loginUser)) {
datasourceList = dataSourceMapper.listAllDataSourceByType();
datasourceList = dataSourceMapper.listAllDataSourceByType(type);
}else{
datasourceList = dataSourceMapper.queryDataSourceByType(loginUser.getId(), type);
}

2
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/DataSourceMapper.java

@ -227,6 +227,6 @@ public interface DataSourceMapper {
@Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE)
})
@SelectProvider(type = DataSourceMapperProvider.class, method = "listAllDataSourceByType")
List<DataSource> listAllDataSourceByType();
List<DataSource> listAllDataSourceByType(@Param("type") Integer type);
}

1
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/DataSourceMapperProvider.java

@ -239,6 +239,7 @@ public class DataSourceMapperProvider {
return new SQL() {{
SELECT("*");
FROM(TABLE_NAME);
WHERE("type = #{type}");
}}.toString();
}

Loading…
Cancel
Save