From d9af42a6cd04dd42df9934af70304b517eda82cf Mon Sep 17 00:00:00 2001 From: Roger Zander Date: Thu, 8 Feb 2018 21:54:50 +0100 Subject: [PATCH] New: diff parameters lindex and rindex New Paramter for Left-Index and Right-Index: lindex and rindex --- source/jaindb/Controllers/HomeController.cs | 11 ++++++++++- source/jaindb/jaindb.csproj | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/source/jaindb/Controllers/HomeController.cs b/source/jaindb/Controllers/HomeController.cs index ba2a5f8..8d9c2ae 100644 --- a/source/jaindb/Controllers/HomeController.cs +++ b/source/jaindb/Controllers/HomeController.cs @@ -185,10 +185,19 @@ public JObject Diff() if (!int.TryParse(query.FirstOrDefault(t => t.Key.ToLower() == "index").Value, out int index)) index = 0; + if (!int.TryParse(query.FirstOrDefault(t => t.Key.ToLower() == "lindex").Value, out int lindex)) + lindex = 0; + + if (index == 0) + index = lindex; + + if (!int.TryParse(query.FirstOrDefault(t => t.Key.ToLower() == "rindex").Value, out int rindex)) + rindex = -1; + if (!int.TryParse(query.FirstOrDefault(t => t.Key.ToLower() == "mode").Value, out int mode)) mode = 0; - return jDB.GetDiff(sKey, index, mode); + return jDB.GetDiff(sKey, index, mode, rindex); } return null; } diff --git a/source/jaindb/jaindb.csproj b/source/jaindb/jaindb.csproj index af4ff1c..bb11342 100644 --- a/source/jaindb/jaindb.csproj +++ b/source/jaindb/jaindb.csproj @@ -13,8 +13,8 @@ https://github.com/rzander/jaindb blockchain json 0.9.0 - 0.9.0.21 - 0.9.0.21 + 0.9.0.24 + 0.9.0.24 jaindb.Program fcfd6c0a-e53c-46cb-8a9d-b786c0579861