feat():资产模型基本信息

master
Wang XinLong 2024-04-24 08:59:44 +08:00
parent b644c2ad79
commit 1a4a7a54be
12 changed files with 133 additions and 2 deletions

View File

@ -188,4 +188,14 @@ public class DataSourceController extends BaseController {
return Result.success(countResp);
}
/**
* childrenId
* @return
*/
@GetMapping("/selectTableData/{id}")
public Result selectTableData(@PathVariable("id") Integer id){
List<TableData> tableDataList = dataSourceService.selectTableData(id);
return Result.success(tableDataList);
}
}

View File

@ -17,8 +17,20 @@ import lombok.experimental.SuperBuilder;
@AllArgsConstructor
public class AssetDataSource {
private Integer id;
/**
*
*/
private String name;
/**
*
*/
private String systemName;
/**
*
*/
private String databaseName;
/**
*
*/
private String type;
}

View File

@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
*
*
*
* @author CHX
* on 2024/4/22
@ -18,9 +18,24 @@ import lombok.experimental.SuperBuilder;
@AllArgsConstructor
public class Children {
private Integer id;
/**
*
*/
private String name;
/**
*
*/
private String as;
/**
*
*/
private Integer dataTotal;
/**
*
*/
private String type;
/**
* ID
*/
private Integer assetId;
}

View File

@ -6,7 +6,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
*
*
*
* @author CHX
* on 2024/4/21

View File

@ -17,16 +17,52 @@ import lombok.experimental.SuperBuilder;
@AllArgsConstructor
public class TableData {
private Integer id;
/**
*
*/
private String name;
/**
*
*/
private String comment;
/**
*
*/
private String isPrimaryKey;
/**
*
*/
private String type;
/**
*
*/
private String mappingType;
/**
*
*/
private Long length;
/**
*
*/
private Integer decimalPlaces;
/**
*
*/
private String isNull;
/**
*
*/
private String defaultValue;
/**
*
*/
private String isDict;
/**
*
*/
private String dictKey;
/**
* ID
*/
private Integer childrenId;
}

View File

@ -17,6 +17,13 @@ import lombok.experimental.SuperBuilder;
@NoArgsConstructor
@AllArgsConstructor
public class ShowTableReq {
/**
*
*/
private AssetDataSource assetStructure;
/**
*
*/
private String tableName;
}

View File

@ -16,12 +16,36 @@ import lombok.experimental.SuperBuilder;
@NoArgsConstructor
@AllArgsConstructor
public class ColumnResp {
/**
*
*/
private String columnName;
/**
*
*/
private String columnComment;
/**
*
*/
private String columnKey;
/**
*
*/
private String columnType;
/**
*
*/
private Long length;
/**
*
*/
private Integer numericScale;
/**
*
*/
private String isNullable;
/**
*
*/
private String columnDefault;
}

View File

@ -16,7 +16,16 @@ import lombok.experimental.SuperBuilder;
@NoArgsConstructor
@AllArgsConstructor
public class CountResp {
/**
*
*/
private Long assetStructureCount;
/**
*
*/
private Long assetStructureTableCount;
/**
*
*/
private Long assetStructureTableDataCount;
}

View File

@ -16,7 +16,16 @@ import lombok.experimental.SuperBuilder;
@NoArgsConstructor
@AllArgsConstructor
public class Table {
/**
*
*/
private String tableName;
/**
*
*/
private String tableComment;
/**
*
*/
private Integer tableRows;
}

View File

@ -46,4 +46,6 @@ public interface DataSourceService extends IService<DataSource> {
List<TableData> selectTableList();
CountResp selectTableDataCount();
List<TableData> selectTableData(Integer id);
}

View File

@ -225,6 +225,12 @@ public class DataSourceServiceImpl extends ServiceImpl<DataSourceMapper, DataSou
return countResp;
}
@Override
public List<TableData> selectTableData(Integer id) {
List<TableData> tableDataList = dataSourceMapper.getTableDataList(id);
return tableDataList;
}
public static String getJavaType(String driveClass, String url, String username, String password, String tableName, String columnName) {
Connection connection = buildConnection(driveClass, url, username, password);
PreparedStatement pst = null;

View File

@ -120,6 +120,7 @@
<select id="selectTableData" resultType="com.muyu.source.domain.TableData">
select * from table_data
</select>
<select id="selectChildrenList" resultType="com.muyu.source.domain.Children">
select * from children
</select>