mirror of
https://gitee.com/huoyo/ko-time.git
synced 2025-12-06 16:58:26 +08:00
修复/getApis在redis模式下很慢的问题
This commit is contained in:
parent
5bea7867ff
commit
6a1069e62d
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
*.iml
|
||||||
|
.idea/
|
||||||
|
rebel.xml
|
||||||
|
target/
|
||||||
|
.txlcn
|
||||||
|
*.log
|
||||||
@ -219,12 +219,12 @@ public class RedisBase implements GraphService {
|
|||||||
List<MethodInfo> methodInfos = new ArrayList<>();
|
List<MethodInfo> methodInfos = new ArrayList<>();
|
||||||
List<MethodNode> smethodNodes = searchList(methodPre, MethodNode.class);
|
List<MethodNode> smethodNodes = searchList(methodPre, MethodNode.class);
|
||||||
|
|
||||||
|
List<MethodRelation> methodRelations = searchList(methodRelationPre, MethodRelation.class);
|
||||||
|
Map<String, MethodRelation> methodRelationMap = methodRelations.stream().collect(Collectors.toMap(k -> k.getTargetId(), v -> v, (p1, p2) -> p1));
|
||||||
for (MethodNode methodNode : smethodNodes) {
|
for (MethodNode methodNode : smethodNodes) {
|
||||||
if (MethodType.Controller == methodNode.getMethodType()) {
|
if (MethodType.Controller == methodNode.getMethodType()) {
|
||||||
String id = methodNode.getId();
|
String id = methodNode.getId();
|
||||||
List<MethodRelation> smethodRelations = searchList(methodRelationPre, MethodRelation.class);
|
Optional<MethodRelation> relations = Optional.ofNullable(methodRelationMap.get(id));
|
||||||
|
|
||||||
Optional<MethodRelation> relations = smethodRelations.stream().filter(methodRelation -> methodRelation.getTargetId().equals(id)).findFirst();
|
|
||||||
MethodRelation relation = null;
|
MethodRelation relation = null;
|
||||||
if (relations.isPresent()) {
|
if (relations.isPresent()) {
|
||||||
relation = relations.get();
|
relation = relations.get();
|
||||||
@ -266,10 +266,11 @@ public class RedisBase implements GraphService {
|
|||||||
List<MethodInfo> methodInfos = new ArrayList<>();
|
List<MethodInfo> methodInfos = new ArrayList<>();
|
||||||
List<MethodNode> smethodNodes = searchList(methodPre, MethodNode.class);
|
List<MethodNode> smethodNodes = searchList(methodPre, MethodNode.class);
|
||||||
List<MethodRelation> methodRelationList = searchList(methodRelationPre, MethodRelation.class);
|
List<MethodRelation> methodRelationList = searchList(methodRelationPre, MethodRelation.class);
|
||||||
|
Map<String, MethodRelation> methodRelationMap = methodRelationList.stream().collect(Collectors.toMap(k -> k.getTargetId(), v -> v, (p1, p2) -> p1));
|
||||||
for (MethodNode methodNode : smethodNodes) {
|
for (MethodNode methodNode : smethodNodes) {
|
||||||
if (methodNode.getName().toLowerCase().contains(question.toLowerCase())) {
|
if (methodNode.getName().toLowerCase().contains(question.toLowerCase())) {
|
||||||
String id = methodNode.getId();
|
String id = methodNode.getId();
|
||||||
Optional<MethodRelation> relations = methodRelationList.stream().filter(methodRelation -> methodRelation.getTargetId().equals(id)).findFirst();
|
Optional<MethodRelation> relations = Optional.ofNullable(methodRelationMap.get(id));
|
||||||
MethodRelation relation = null;
|
MethodRelation relation = null;
|
||||||
if (relations.isPresent()) {
|
if (relations.isPresent()) {
|
||||||
relation = relations.get();
|
relation = relations.get();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user