09041540:编写规则引擎要调用的接口
parent
f357ab3037
commit
0559ebb209
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.source.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.dtflys.forest.annotation.NotNull;
|
||||
import com.dtflys.forest.springboot.annotation.ForestScannerRegister;
|
||||
|
@ -7,10 +8,12 @@ import com.muyu.common.core.domain.Result;
|
|||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.source.domain.Structure;
|
||||
import com.muyu.source.domain.TableInfo;
|
||||
import com.muyu.source.domain.rep.AssetAuthorizationRep;
|
||||
import com.muyu.source.domain.rep.TableInfoResp;
|
||||
import com.muyu.source.service.AssetAuthorizationService;
|
||||
import com.muyu.source.service.StructureService;
|
||||
import com.muyu.source.service.TableInfoService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
@ -19,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Lenovo
|
||||
|
@ -36,6 +40,8 @@ public class TableInfoController {
|
|||
private TableInfoService tableInfoService;
|
||||
@Autowired
|
||||
private AssetAuthorizationService assetAuthorizationService;
|
||||
@Autowired
|
||||
private StructureService structureService;
|
||||
|
||||
/**
|
||||
* 查询资产信息
|
||||
|
@ -246,7 +252,7 @@ public class TableInfoController {
|
|||
/**
|
||||
* 根据parentId向下查询出子表
|
||||
* @param id id
|
||||
* @return 返回tableInfo列表
|
||||
* @return 返回数据库结构列表
|
||||
*/
|
||||
@PostMapping("/findTableIdByParentId/{id}")
|
||||
@Operation(summary = "根据parentId向下查询出子表" , description = "根据parentId向下查询出子表")
|
||||
|
@ -255,4 +261,19 @@ public class TableInfoController {
|
|||
List<TableInfo> tableInfoList=tableInfoService.listByIds(structureIds);
|
||||
return Result.success(tableInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据parentId向下查询出子表
|
||||
* @param id id
|
||||
* @return 返回表结构列表
|
||||
*/
|
||||
@PostMapping("/findTableByStructure/{id}")
|
||||
@Operation(summary = "根据parentId向下查询出子表" , description = "根据parentId向下查询出子表")
|
||||
public Result<List<Structure>> findTableByStructure(@PathVariable("id") Long id) {
|
||||
List<Long> structureIds = tableInfoService.findTableIdByParentId(id);
|
||||
List<TableInfo> tableInfoList=tableInfoService.listByIds(structureIds);
|
||||
List<Long> tableInfoIds=tableInfoList.stream().map(TableInfo::getId).collect(Collectors.toList());
|
||||
List<Structure> structureList = structureService.listByIds(tableInfoIds);
|
||||
return Result.success(structureList);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue