Commit 057dd961 by Eli Ben Baruch

Some changes

parent 070b16da
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
"apiList": [{ "apiList": [{
"id": "getroutes", "id": "getroutes",
"method": "GET", "method": "GET",
"headers": null,
"content": null,
"path": "getroutes", "path": "getroutes",
"QueryParams": [{ "QueryParams": [{
"key": "$config$chicago.transportation.key" "key": "$query.key"
}] }]
}] }]
} }
\ No newline at end of file
...@@ -8,4 +8,3 @@ server.port=50040 ...@@ -8,4 +8,3 @@ server.port=50040
server.host=0.0.0.0 server.host=0.0.0.0
server.worker.threads=6 server.worker.threads=6
chicago.transportation.key=gT2nciTKwRv6Jy5njqm8fe7LW
\ No newline at end of file
{ {
"services": [{ "services": [{
"apiId": "getroutes", "apiId": "routes",
"actions": [{ "actions": [{
"id": "forwardRequest", "id": "forwardRequest",
"adapterId": "adapter.chicago.transportation", "adapterId": "adapter.chicago.transportation",
......
...@@ -61,7 +61,7 @@ Flow ...@@ -61,7 +61,7 @@ Flow
GET http://www.ctabustracker.com/bustime/api/v1/getroutes?key=gT2nciTKwRv6Jy5njqm8fe7LW GET http://www.ctabustracker.com/bustime/api/v1/getroutes?key=gT2nciTKwRv6Jy5njqm8fe7LW
GET ../mde/{tenantId}/{serviceId}/{apiId} GET ../mde/{tenantId}/{serviceId}/{apiId}?key=gT2nciTKwRv6Jy5njqm8fe7LW
mde.HandleRequest(reqCtx) mde.HandleRequest(reqCtx)
{ {
......
...@@ -43,12 +43,10 @@ public class MdeHandler extends BaseHandler { ...@@ -43,12 +43,10 @@ public class MdeHandler extends BaseHandler {
public void doRead(RequestContext requestContext) { public void doRead(RequestContext requestContext) {
// GET ../mde/{tenantId}/{serviceId}/{apiId} // GET ../mde/{tenantId}/{serviceId}/{apiId}
String tenantId = requestContext.params[0];
String serviceId = requestContext.params[1];
String apiId = requestContext.params[2];
HttpAdapter httpAdapter = new HttpAdapter();
httpAdapter.handleRequest(requestContext); mdeManager.doRead(requestContext);
} }
@Override @Override
......
...@@ -2,6 +2,7 @@ package logic; ...@@ -2,6 +2,7 @@ package logic;
import logic.adapter.BaseAdapter; import logic.adapter.BaseAdapter;
import logic.adapter.HttpAdapter.HttpAdapter; import logic.adapter.HttpAdapter.HttpAdapter;
import microservice.RequestContext;
import microservice.io.iface.ILogger; import microservice.io.iface.ILogger;
import java.util.Map; import java.util.Map;
...@@ -36,4 +37,15 @@ public class MdeManager { ...@@ -36,4 +37,15 @@ public class MdeManager {
AdapterList.put("aaa", httpAdapter); AdapterList.put("aaa", httpAdapter);
} }
public void doRead(RequestContext requestContext) {
String tenantId = requestContext.params[0];
String serviceId = requestContext.params[1];
String apiId = requestContext.params[2];
HttpAdapter httpAdapter = new HttpAdapter();
httpAdapter.doRead(requestContext);
}
} }
...@@ -7,6 +7,9 @@ import microservice.RequestContext; ...@@ -7,6 +7,9 @@ import microservice.RequestContext;
*/ */
public abstract class BaseAdapter { public abstract class BaseAdapter {
public void handleRequest(RequestContext requestContext) { public void doRead(RequestContext requestContext) {};
} public void doCreate(RequestContext requestContext) {};
public void doUpdate(RequestContext requestContext) {};
public void doDelete(RequestContext requestContext) {};
} }
...@@ -19,7 +19,7 @@ public class HttpAdapter extends BaseAdapter { ...@@ -19,7 +19,7 @@ public class HttpAdapter extends BaseAdapter {
return LoadFromFile(id); return LoadFromFile(id);
} }
public void handleRequest(RequestContext requestContext) { public void doRead(RequestContext requestContext) {
String tenantId = requestContext.params[0]; String tenantId = requestContext.params[0];
String serviceId = requestContext.params[1]; String serviceId = requestContext.params[1];
......
package logic.adapter.HttpAdapter; package logic.adapter.HttpAdapter.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
......
package logic.adapter.HttpAdapter; package logic.adapter.HttpAdapter.model;
import java.util.List; import java.util.List;
...@@ -11,6 +11,7 @@ public class DataHttpAdapterApi { ...@@ -11,6 +11,7 @@ public class DataHttpAdapterApi {
public String method = null; public String method = null;
public String uri = null; public String uri = null;
public String content = null; public String content = null;
public List<String> headerList = null;
public List<String> pathList = null; public List<String> pathList = null;
public List<String> queryParamsList = null; public List<String> queryParamsList = null;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment