From 65a0075aad9749a8929c351eb1be49d4c81cdda5 Mon Sep 17 00:00:00 2001 From: SisMaker <1713699517@qq.com> Date: Wed, 1 Sep 2021 18:22:13 +0800 Subject: [PATCH] =?UTF-8?q?ft:=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agApi/agEdges.erl | 6 ++-- .../{agGeneralGraphs.erl => agGraphs.erl} | 31 ++++++++++--------- 2 files changed, 19 insertions(+), 18 deletions(-) rename src/agApi/{agGeneralGraphs.erl => agGraphs.erl} (98%) diff --git a/src/agApi/agEdges.erl b/src/agApi/agEdges.erl index b4f0aa3..4c8a05c 100644 --- a/src/agApi/agEdges.erl +++ b/src/agApi/agEdges.erl @@ -28,7 +28,7 @@ % 获取边 % GET /_api/edges/{collection-id} % 路径参数 -% collection-id(必填):边集合的ID或者边集合名。 +% collection-id(必填):边集合名。 % 查询参数 % vertex(必填):起始顶点的ID。 % direction(可选):选择 in or out 为边缘方向。如果未设置,则返回任何边。 @@ -37,6 +37,6 @@ % 200:如果找到边缘集合并检索到边缘,则返回。 % 400:如果请求包含无效参数,则返回。 % 404:如果未找到边缘集合,则返回。 -getEdges(PoolNameOrSocket, CollName, QueryPars) -> - Path = <<"/_api/edges/", CollName/binary>>, +getEdges(PoolNameOrSocket, EdgesCollName, QueryPars) -> + Path = <<"/_api/edges/", EdgesCollName/binary>>, agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, QueryPars). \ No newline at end of file diff --git a/src/agApi/agGeneralGraphs.erl b/src/agApi/agGraphs.erl similarity index 98% rename from src/agApi/agGeneralGraphs.erl rename to src/agApi/agGraphs.erl index d65f4ee..7548536 100644 --- a/src/agApi/agGeneralGraphs.erl +++ b/src/agApi/agGraphs.erl @@ -1,4 +1,4 @@ --module(agGeneralGraphs). +-module(agGraphs). -include("eArango.hrl"). -compile(inline). @@ -18,16 +18,19 @@ % error:如果有错误,则标记(true),否则(false)。这个回应是错误的。 % code:响应代码。 % 图表: -% graph:有关新创建的图的信息 -% name:图形名称 -% edgeDefinitions:图形关系的定义数组。每个都有以下类型: -% orphanCollections:其他顶点集合的数组。这些集合中的文档在此图中没有边。 -% numberOfShards:为图中的每个新集合创建的分片数。 -% _id:此图的内部ID值。 -% _rev:此图的修订版。可用于确保不覆盖对该图的并发修改。 -% ReplicationFactor:图形中每个新集合使用的复制因子。 -% isSmart:标记图形是否为SmartGraph(仅限企业版)。 -% smartGraphAttribute:智能图例中的分片属性名称(仅企业版) +% graphs: +% graph : 关于新创建的图的信息 +% name : 图的名称 +% edgeDefinitions:图形关系的定义数组。每个都有以下类型: +% orphanCollections:一组额外的顶点集合。这些集合中的文档在该图中没有边。 +% numberOfShards:为图中的每个新集合创建的分片数。 +% _id:此图的内部 id 值。 +% _rev:此图的修订版。可用于确保不会覆盖对此图的并发修改。 +% replicationFactor:用于图中每个新集合的复制因子。也可以"satellite"是 SmartGraph的字符串(仅限企业版)。 +% isSmart:图形是否为 SmartGraph(仅限企业版)。 +% isDisjoint:图形是否为 Disjoint SmartGraph(仅限企业版)。 +% smartGraphAttribute:SmartGraph 案例中的分片属性名称(仅限企业版)。 +% isSatellite:标记图形是否为 SatelliteGraph(仅限企业版)。 graphList(PoolNameOrSocket) -> agVstCli:callAgency(PoolNameOrSocket, ?AgGet, <<"/_api/gharial">>). @@ -77,12 +80,10 @@ graphList(PoolNameOrSocket) -> % errorNum:发生错误的ArangoDB错误号。 % errorMessage:为此错误创建的消息。 newGraph(PoolNameOrSocket, MapData) -> - BodyStr = eVPack:encodeBin(MapData), - agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/gharial">>, ?AgDefQuery, ?AgDefHeader, BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/gharial">>, ?AgDefQuery, ?AgDefHeader, eVPack:encodeBin(MapData)). newGraph(PoolNameOrSocket, MapData, QueryPars) -> - BodyStr = eVPack:encodeBin(MapData), - agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/gharial">>, QueryPars, ?AgDefHeader, BodyStr). + agVstCli:callAgency(PoolNameOrSocket, ?AgPost, <<"/_api/gharial">>, QueryPars, ?AgDefHeader, eVPack:encodeBin(MapData)). % 获取图表 % GET /_api/gharial/{graph}