Skip to content

Commit fd15991

Browse files
committed
Initial REST support for favorites
1 parent 781ff15 commit fd15991

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

MDX2JSON/REST.cls.xml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ Example: send HTTP GET request to web application with Dispatch class <b>MDX2JSO
6868
6969
<!-- Get info about user config-->
7070
<Route Url="/Config" Method="POST" Call="SetConfig" Body="Application"/>
71-
<Route Url="/Config/:Application" Method="GET" Call="GetConfig" />
71+
<Route Url="/Config/:Application" Method="GET" Call="GetConfig" />
72+
73+
<!-- Get info about user favorites-->
74+
<Route Url="/Favorites" Method="GET" Call="GetFavotites"/>
75+
<Route Url="/Favorites/:Item" Method="POST" Call="AddFavorite" />
76+
<Route Url="/Favorites/:Item" Method="DELETE" Call="RemoveFavorite" />
7277
7378
<!-- Valid but illicit, do not use-->
7479
<Route Url="/MDX/:query" Method="GET" Call="WriteJSONfromMDXURL"/>
@@ -274,5 +279,34 @@ Wrapper for ##class(MDX2JSON.Users).GetConfig()</Description>
274279
return $$$OK
275280
]]></Implementation>
276281
</Method>
282+
283+
<Method name="GetFavorites">
284+
<ClassMethod>1</ClassMethod>
285+
<ReturnType>%String</ReturnType>
286+
<Implementation><![CDATA[
287+
do ##class(MDX2JSON.Users).GetFavorites()
288+
return 1
289+
]]></Implementation>
290+
</Method>
291+
292+
<Method name="AddFavorite">
293+
<ClassMethod>1</ClassMethod>
294+
<FormalSpec>Name:%String</FormalSpec>
295+
<ReturnType>%Status</ReturnType>
296+
<Implementation><![CDATA[
297+
do ##class(MDX2JSON.Users).AddFavorite(Name)
298+
return 1
299+
]]></Implementation>
300+
</Method>
301+
302+
<Method name="RemoveFavorite">
303+
<ClassMethod>1</ClassMethod>
304+
<FormalSpec>Name:%String</FormalSpec>
305+
<ReturnType>%Status</ReturnType>
306+
<Implementation><![CDATA[
307+
do ##class(MDX2JSON.Users).RemoveFavorite(Name)
308+
return 1
309+
]]></Implementation>
310+
</Method>
277311
</Class>
278312
</Export>

0 commit comments

Comments
 (0)