Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestChanges.cpp @ 1247:32fcc5dc7562
abstraction
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 08 Dec 2014 13:54:27 +0100 |
parents | 83622b0f544c |
children | 6e7e5ed91c2d |
comparison
equal
deleted
inserted
replaced
1246:54bf0f0245f4 | 1247:32fcc5dc7562 |
---|---|
79 unsigned int limit; | 79 unsigned int limit; |
80 bool last; | 80 bool last; |
81 GetSinceAndLimit(since, limit, last, call); | 81 GetSinceAndLimit(since, limit, last, call); |
82 | 82 |
83 Json::Value result; | 83 Json::Value result; |
84 if ((!last && context.GetIndex().GetChanges(result, since, limit)) || | 84 if (last) |
85 ( last && context.GetIndex().GetLastChange(result))) | |
86 { | 85 { |
87 call.GetOutput().AnswerJson(result); | 86 context.GetIndex().GetLastChange(result); |
88 } | 87 } |
88 else | |
89 { | |
90 context.GetIndex().GetChanges(result, since, limit); | |
91 } | |
92 | |
93 call.GetOutput().AnswerJson(result); | |
89 } | 94 } |
90 | 95 |
91 | 96 |
92 static void DeleteChanges(RestApiDeleteCall& call) | 97 static void DeleteChanges(RestApiDeleteCall& call) |
93 { | 98 { |
106 unsigned int limit; | 111 unsigned int limit; |
107 bool last; | 112 bool last; |
108 GetSinceAndLimit(since, limit, last, call); | 113 GetSinceAndLimit(since, limit, last, call); |
109 | 114 |
110 Json::Value result; | 115 Json::Value result; |
111 if ((!last && context.GetIndex().GetExportedResources(result, since, limit)) || | 116 if (last) |
112 ( last && context.GetIndex().GetLastExportedResource(result))) | |
113 { | 117 { |
114 call.GetOutput().AnswerJson(result); | 118 context.GetIndex().GetLastExportedResource(result); |
115 } | 119 } |
120 else | |
121 { | |
122 context.GetIndex().GetExportedResources(result, since, limit); | |
123 } | |
124 | |
125 call.GetOutput().AnswerJson(result); | |
116 } | 126 } |
117 | 127 |
118 | 128 |
119 static void DeleteExports(RestApiDeleteCall& call) | 129 static void DeleteExports(RestApiDeleteCall& call) |
120 { | 130 { |