Browse Source

Added the ability for administrators to view all data sources by type

pull/2/head
lgcareer 5 years ago
parent
commit
49d0690a7d
  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; List<DataSource> datasourceList;
if (isAdmin(loginUser)) { if (isAdmin(loginUser)) {
datasourceList = dataSourceMapper.listAllDataSourceByType(); datasourceList = dataSourceMapper.listAllDataSourceByType(type);
}else{ }else{
datasourceList = dataSourceMapper.queryDataSourceByType(loginUser.getId(), type); 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) @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE)
}) })
@SelectProvider(type = DataSourceMapperProvider.class, method = "listAllDataSourceByType") @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() {{ return new SQL() {{
SELECT("*"); SELECT("*");
FROM(TABLE_NAME); FROM(TABLE_NAME);
WHERE("type = #{type}");
}}.toString(); }}.toString();
} }

Loading…
Cancel
Save