|
@ -0,0 +1,190 @@
|
|
|
package gateway.processor;
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.Collection;
|
|
|
|
|
|
/**
|
|
|
* @author Airhead
|
|
|
* @since 2017/3/15.
|
|
|
*/
|
|
|
public class AppApi {
|
|
|
private String name;
|
|
|
private String type;
|
|
|
private String method;
|
|
|
private String protocol;
|
|
|
private String version;
|
|
|
private String activityType;
|
|
|
private String openLevel;
|
|
|
private String auditLevel;
|
|
|
private String methodName;
|
|
|
private String microServiceUri;
|
|
|
private String msMethodName;
|
|
|
private String microServiceName;
|
|
|
|
|
|
private Collection<Param> parameters;
|
|
|
|
|
|
public AppApi(String apiInfo) throws IOException {
|
|
|
this.parse(apiInfo);
|
|
|
}
|
|
|
|
|
|
public static AppApi parse(String apiInfo) throws IOException {
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
return objectMapper.readValue(apiInfo, AppApi.class);
|
|
|
}
|
|
|
|
|
|
public String getName() {
|
|
|
return name;
|
|
|
}
|
|
|
|
|
|
public void setName(String name) {
|
|
|
this.name = name;
|
|
|
}
|
|
|
|
|
|
public String getType() {
|
|
|
return type;
|
|
|
}
|
|
|
|
|
|
public void setType(String type) {
|
|
|
this.type = type;
|
|
|
}
|
|
|
|
|
|
public String getMethod() {
|
|
|
return method;
|
|
|
}
|
|
|
|
|
|
public void setMethod(String method) {
|
|
|
this.method = method;
|
|
|
}
|
|
|
|
|
|
public String getProtocol() {
|
|
|
return protocol;
|
|
|
}
|
|
|
|
|
|
public void setProtocol(String protocol) {
|
|
|
this.protocol = protocol;
|
|
|
}
|
|
|
|
|
|
public String getVersion() {
|
|
|
return version;
|
|
|
}
|
|
|
|
|
|
public void setVersion(String version) {
|
|
|
this.version = version;
|
|
|
}
|
|
|
|
|
|
public String getActivityType() {
|
|
|
return activityType;
|
|
|
}
|
|
|
|
|
|
public void setActivityType(String activityType) {
|
|
|
this.activityType = activityType;
|
|
|
}
|
|
|
|
|
|
public String getOpenLevel() {
|
|
|
return openLevel;
|
|
|
}
|
|
|
|
|
|
public void setOpenLevel(String openLevel) {
|
|
|
this.openLevel = openLevel;
|
|
|
}
|
|
|
|
|
|
public String getAuditLevel() {
|
|
|
return auditLevel;
|
|
|
}
|
|
|
|
|
|
public void setAuditLevel(String auditLevel) {
|
|
|
this.auditLevel = auditLevel;
|
|
|
}
|
|
|
|
|
|
public String getMethodName() {
|
|
|
return methodName;
|
|
|
}
|
|
|
|
|
|
public void setMethodName(String methodName) {
|
|
|
this.methodName = methodName;
|
|
|
}
|
|
|
|
|
|
public String getMicroServiceUri() {
|
|
|
return microServiceUri;
|
|
|
}
|
|
|
|
|
|
public void setMicroServiceUri(String microServiceUri) {
|
|
|
this.microServiceUri = microServiceUri;
|
|
|
}
|
|
|
|
|
|
public String getMsMethodName() {
|
|
|
return msMethodName;
|
|
|
}
|
|
|
|
|
|
public void setMsMethodName(String msMethodName) {
|
|
|
this.msMethodName = msMethodName;
|
|
|
}
|
|
|
|
|
|
public String getMicroServiceName() {
|
|
|
return microServiceName;
|
|
|
}
|
|
|
|
|
|
public void setMicroServiceName(String microServiceName) {
|
|
|
this.microServiceName = microServiceName;
|
|
|
}
|
|
|
|
|
|
public Collection<Param> getParameters() {
|
|
|
return parameters;
|
|
|
}
|
|
|
|
|
|
public void setParameters(Collection<Param> parameters) {
|
|
|
this.parameters = parameters;
|
|
|
}
|
|
|
|
|
|
static class Param {
|
|
|
private String name;
|
|
|
private String type;
|
|
|
private String dataType;
|
|
|
private String required;
|
|
|
private String defaultValue;
|
|
|
|
|
|
public String getName() {
|
|
|
return name;
|
|
|
}
|
|
|
|
|
|
public void setName(String name) {
|
|
|
this.name = name;
|
|
|
}
|
|
|
|
|
|
public String getType() {
|
|
|
return type;
|
|
|
}
|
|
|
|
|
|
public void setType(String type) {
|
|
|
this.type = type;
|
|
|
}
|
|
|
|
|
|
public String getDataType() {
|
|
|
return dataType;
|
|
|
}
|
|
|
|
|
|
public void setDataType(String dataType) {
|
|
|
this.dataType = dataType;
|
|
|
}
|
|
|
|
|
|
public String getRequired() {
|
|
|
return required;
|
|
|
}
|
|
|
|
|
|
public void setRequired(String required) {
|
|
|
this.required = required;
|
|
|
}
|
|
|
|
|
|
public String getDefaultValue() {
|
|
|
return defaultValue;
|
|
|
}
|
|
|
|
|
|
public void setDefaultValue(String defaultValue) {
|
|
|
this.defaultValue = defaultValue;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|