添加查询表结构的接口

master
冷调 2024-08-29 21:30:25 +08:00
parent c460af8b40
commit 6f41f53152
5 changed files with 47 additions and 10 deletions

View File

@ -0,0 +1,31 @@
package com.muyu.source.domain.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @ ToolIntelliJ IDEA
* @ AuthorCHX
* @ Date2024-08-29-19:57
* @ Version1.0
* @ Description
* @author Lenovo
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TableInfoModel {
/**
*
*/
private String tableName;
/**
*
*/
private String tableRemark;
/**
*
*/
private Long dataNum;
}

View File

@ -50,13 +50,7 @@ public class TableDataController extends BaseController {
@Autowired
private TableDataService tableDataService;
@Autowired
private ChildrenService childrenService;
@Autowired
private AssetDataSourceService assetDataSourceService;
@Autowired
private TableInfoService tableInfoService;
@Autowired
private StructureService structureService;
/**
* childrenId
*

View File

@ -1,10 +1,12 @@
package com.muyu.source.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.dtflys.forest.annotation.NotNull;
import com.muyu.common.core.domain.Result;
import com.muyu.source.domain.Structure;
import com.muyu.source.domain.TableInfo;
import com.muyu.source.domain.model.TableInfoModel;
import com.muyu.source.domain.rep.TableInfoRep;
import com.muyu.source.domain.rep.TableInfoResp;
import com.muyu.source.domain.rep.TableInfoTreeRep;
@ -67,10 +69,16 @@ public class TableInfoController {
).toList();
}
@GetMapping("/findStruceure/{id}")
public Result<List<Structure>> findStruceure(@PathVariable("id") Integer id) {
List<Structure> structureList = structureService.findStructurelistS(id);
return Result.success(structureList);
/**
* ,,
* @return
*/
@GetMapping("/selectColumn")
public Result<List<TableInfo>> selectColumn() {
List<TableInfo> list = tableInfoService.list(new LambdaQueryWrapper<>() {{
select(TableInfo::getTableName, TableInfo::getTableRemark, TableInfo::getDataNum);
}});
return Result.success(list);
}
}

View File

@ -65,4 +65,6 @@ public class TableServiceImpl extends ServiceImpl<TableInfoMapper, TableInfo> im
}});
return structureList;
}
}

View File

@ -17,4 +17,6 @@ public interface TableInfoService extends IService<TableInfo> {
List<TableInfoRep> findTablesList(Long id);
List<Structure> selectTableInfoById(Integer id);
}