|
@@ -57,7 +57,7 @@ func ListNode(ids []string, importId []string) (*sdk.BaseResponse[sdk.PaginateRe
|
|
|
}
|
|
|
|
|
|
// 获取节点关系
|
|
|
-func GetNodeRelationShips(id, relationName, importId string) (*sdk.BaseResponse[[]map[string]any], *response.ErrCode) {
|
|
|
+func GetNodeRelationShip(id, relationName, importId string) (*sdk.BaseResponse[[]map[string]any], *response.ErrCode) {
|
|
|
var resp *sdk.BaseResponse[[]map[string]any]
|
|
|
resp, err := getReq[*sdk.BaseResponse[[]map[string]any]]("/graphService/open/node/relationship", gout.H{
|
|
|
"id": id,
|
|
@@ -79,6 +79,34 @@ func GetNodeRelationShips(id, relationName, importId string) (*sdk.BaseResponse[
|
|
|
return resp, nil
|
|
|
}
|
|
|
|
|
|
+// 获取节点关系
|
|
|
+func GetNodeRelationShips(id, relationName, importId string, inverse bool) (*sdk.BaseResponse[[]map[string]any], *response.ErrCode) {
|
|
|
+ var resp *sdk.BaseResponse[[]map[string]any]
|
|
|
+ var isInverse int64 = 0
|
|
|
+ if inverse {
|
|
|
+ isInverse = 1
|
|
|
+ }
|
|
|
+ resp, err := getReq[*sdk.BaseResponse[[]map[string]any]]("/graphService/open/node/relationships", gout.H{
|
|
|
+ "id": id,
|
|
|
+ "rName": relationName,
|
|
|
+ "importId": importId,
|
|
|
+ "inverse": isInverse,
|
|
|
+ })
|
|
|
+ if err != nil {
|
|
|
+ return nil, &response.ErrCode{
|
|
|
+ Code: response.PLATFORM_ERROR,
|
|
|
+ Msg: err.Error(),
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if resp.Code != 200 {
|
|
|
+ return nil, &response.ErrCode{
|
|
|
+ Code: resp.Code,
|
|
|
+ Msg: resp.Message,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return resp, nil
|
|
|
+}
|
|
|
+
|
|
|
// 获取节点关系
|
|
|
func GetNodeRelationd(id, relationName, importId string) (*sdk.BaseResponse[[]map[string]any], *response.ErrCode) {
|
|
|
var resp *sdk.BaseResponse[[]map[string]any]
|