From dbd7c4f76868b8240713d8d96675e0bbaaeb6d29 Mon Sep 17 00:00:00 2001 From: Fjodor <fjodor_rs@hotmail.com> Date: Mon, 14 Jun 2021 13:41:30 +0200 Subject: [PATCH] space at end of queries removed --- cypher/convertQuery.go | 1 + main/main.go | 79 ------------------------------------------ 2 files changed, 1 insertion(+), 79 deletions(-) diff --git a/cypher/convertQuery.go b/cypher/convertQuery.go index f20ebeb..cd869cb 100644 --- a/cypher/convertQuery.go +++ b/cypher/convertQuery.go @@ -179,6 +179,7 @@ func createQuery(JSONQuery *entity.IncomingQueryJSON) *string { } } + ret = TrimSuffix(ret, " ") return &ret } diff --git a/main/main.go b/main/main.go index ba1e4b9..dfb886b 100644 --- a/main/main.go +++ b/main/main.go @@ -33,85 +33,6 @@ func main() { "limit": 5000 }`) - // js := []byte(`{ - // "return": { - // "entities": [ - // 0, - // 1, - // 2 - // ], - // "relations": [ - // 0, - // 1 - // ] - // }, - // "entities": [ - // { - // "type": "airports", - // "constraints": [ - // { - // "attribute": "city", - // "value": "New York", - // "dataType": "string", - // "matchType": "exact" - // } - // ] - // }, - // { - // "type": "airports", - // "constraints": [ - // { - // "attribute": "city", - // "value": "San Francisco", - // "dataType": "string", - // "matchType": "exact" - // } - // ] - // }, - // { - // "type": "airports", - // "constraints": [ - // { - // "attribute": "state", - // "value": "HI", - // "dataType": "string", - // "matchType": "exact" - // } - // ] - // } - // ], - // "relations": [ - // { - // "type": "flights", - // "depth": { - // "min": 1, - // "max": 3 - // }, - // "entityFrom": 2, - // "entityTo": 1, - // "constraints": [ - // { - // "attribute": "Day", - // "value": "15", - // "dataType": "int", - // "matchType": "EQ" - // } - // ] - // }, - // { - // "type": "flights", - // "depth": { - // "min": 1, - // "max": 1 - // }, - // "entityFrom": 0, - // "entityTo": -1, - // "constraints": [] - // } - // ], - // "limit": 5000 - // }`) - var inc entity.IncomingQueryJSON json.Unmarshal(js, &inc) result, _ := queryservice.ConvertQuery(&inc) -- GitLab