mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
removed method and type from feature
This commit is contained in:
parent
ec7727e8bf
commit
bee9a106cc
@ -64,6 +64,7 @@ public class AnnotationUtil {
|
||||
private static final String PACKAGE_ORG_SPRINGFRAMEWORK = "org.springframework";
|
||||
private static final String STRING_ARR = "string_arr";
|
||||
private static final String STRING = "string";
|
||||
private static final String METHOD = "method";
|
||||
private Class<org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.Feature>
|
||||
featureAnnotationClazz;
|
||||
private ClassLoader classLoader;
|
||||
@ -147,8 +148,7 @@ public class AnnotationUtil {
|
||||
Map<String, Object> apiParams = new HashMap<>();
|
||||
for (int i = 0; i < annotations.length; i++) {
|
||||
Annotation currentAnnotation = annotations[i];
|
||||
String method = processHttpMethodAnnotation(feature, currentAnnotation);
|
||||
apiParams.put("method", method);
|
||||
processHttpMethodAnnotation(apiParams, currentAnnotation);
|
||||
if (currentAnnotation.annotationType().getName().equals(Path.class.getName())) {
|
||||
String uri = getPathAnnotationValue(currentMethod);
|
||||
apiParams.put("uri", uri);
|
||||
@ -200,25 +200,20 @@ public class AnnotationUtil {
|
||||
|
||||
/**
|
||||
* Read Method annotations indicating HTTP Methods
|
||||
* @param feature
|
||||
* @param currentAnnotation
|
||||
* @return
|
||||
*/
|
||||
private String processHttpMethodAnnotation(Feature feature, Annotation currentAnnotation) {
|
||||
private void processHttpMethodAnnotation(Map<String, Object> apiParams, Annotation currentAnnotation) {
|
||||
//Extracting method with which feature is exposed
|
||||
String method = null;
|
||||
if (currentAnnotation.annotationType().getName().equals(GET.class.getName())) {
|
||||
method = HttpMethod.GET;
|
||||
apiParams.put(METHOD, HttpMethod.GET);
|
||||
} else if (currentAnnotation.annotationType().getName().equals(POST.class.getName())) {
|
||||
method = HttpMethod.POST;
|
||||
apiParams.put(METHOD, HttpMethod.POST);
|
||||
} else if (currentAnnotation.annotationType().getName().equals(OPTIONS.class.getName())) {
|
||||
method = HttpMethod.OPTIONS;
|
||||
apiParams.put(METHOD, HttpMethod.OPTIONS);
|
||||
} else if (currentAnnotation.annotationType().getName().equals(DELETE.class.getName())) {
|
||||
method = HttpMethod.DELETE;
|
||||
apiParams.put(METHOD, HttpMethod.DELETE);
|
||||
} else if (currentAnnotation.annotationType().getName().equals(PUT.class.getName())) {
|
||||
method = HttpMethod.PUT;
|
||||
apiParams.put(METHOD, HttpMethod.PUT);
|
||||
}
|
||||
return method;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -45,9 +45,6 @@ var operationModule = function () {
|
||||
var feature;
|
||||
for (var i = 0; i < features.length; i++) {
|
||||
feature = {};
|
||||
if (features[i].type != operationType) {
|
||||
continue;
|
||||
} else if (features[i].type == 'monitor') {
|
||||
var analyticStreams = utility.getDeviceTypeConfig(deviceType)["analyticStreams"];
|
||||
if (analyticStreams) {
|
||||
for (var stream in analyticStreams) {
|
||||
@ -57,10 +54,9 @@ var operationModule = function () {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
feature["operation"] = features[i].code;
|
||||
feature["name"] = features[i].name;
|
||||
feature["method"] = features[i].method;
|
||||
feature["description"] = features[i].description;
|
||||
feature["deviceType"] = deviceType;
|
||||
feature["params"] = [];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user