09041540:编写规则引擎要调用的接口

master
冷调 2024-09-04 15:40:53 +08:00
parent f357ab3037
commit 0559ebb209
1 changed files with 22 additions and 1 deletions

View File

@ -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);
}
}