Commit 2be96953513a62c3c0f4ecf575dfe4c9a2643f27
1 parent
4084b177
JSONRequester model
Showing
2 changed files
with
52 additions
and
0 deletions
services/JSONRequester/src/main/java/de/bht/beuthbot/JSONRequester/JSONRequestInterface.java
0 → 100644
1 | +package de.bht.beuthbot.messenger.facebook; | ||
2 | + | ||
3 | +import javax.ws.rs.*; | ||
4 | +import javax.ws.rs.core.MediaType; | ||
5 | +import javax.ws.rs.core.Response; | ||
6 | + | ||
7 | +/** | ||
8 | + * Created by oliver on 15.06.2017. | ||
9 | + */ | ||
10 | +@Path("/") | ||
11 | +public interface JSONRequestInterface { | ||
12 | + | ||
13 | + /** | ||
14 | + * send JSONRequest to URL and return JSON as String | ||
15 | + * | ||
16 | + * @param request_url --> url to call for JSON | ||
17 | + * @return answer of server | ||
18 | + */ | ||
19 | + @POST | ||
20 | + @Consumes("text/plain") | ||
21 | + Response sendRequest(); | ||
22 | +} |
services/JSONRequester/src/main/java/de/bht/beuthbot/JSONRequester/model/JSONRequestObject.java
0 → 100644
1 | +package de.bht.beuthbot.JSONRequester; | ||
2 | + | ||
3 | +public class JSONRequestObject { | ||
4 | + | ||
5 | + //URL as String to get JSONObject | ||
6 | + private String _requestUrl; | ||
7 | + | ||
8 | + //JSON Response String | ||
9 | + private String _jsonResponse; | ||
10 | + | ||
11 | + public JSONRequestObject(String url) { | ||
12 | + _requestUrl = url; | ||
13 | + } | ||
14 | + | ||
15 | + public String getRequestUrl() { | ||
16 | + return _requestUrl; | ||
17 | + } | ||
18 | + | ||
19 | + public void setRequestUrl(String requestUrl) { | ||
20 | + _requestUrl = requestUrl; | ||
21 | + } | ||
22 | + | ||
23 | + public String getJsonResponse() { | ||
24 | + return _jsonResponse; | ||
25 | + } | ||
26 | + | ||
27 | + public void setJsonResponse(String jsonResponse) { | ||
28 | + _jsonResponse = jsonResponse; | ||
29 | + } | ||
30 | +} |