fix: API 数据源

This commit is contained in:
taojinlong 2022-02-22 11:51:43 +08:00
parent cada5707d6
commit ea1b00ad9c
2 changed files with 2 additions and 4 deletions

View File

@ -13,7 +13,7 @@ public class ApiDefinitionRequest {
@Data
public class AuthManager{
public static class AuthManager{
private String password;
private String username;
private String verification = "";

View File

@ -124,7 +124,6 @@ public class ApiProvider extends DatasourceProvider{
String response = "";
HttpClientConfig httpClientConfig = new HttpClientConfig();
ApiDefinitionRequest apiDefinitionRequest = JSONObject.parseObject(apiDefinition.getRequest(), ApiDefinitionRequest.class);
System.out.println(new Gson().toJson(apiDefinitionRequest.getAuthManager()));
//headers
for (JSONObject header : apiDefinitionRequest.getHeaders()) {
if(StringUtils.isNotEmpty(header.getString("name")) && StringUtils.isNotEmpty(header.getString("value"))){
@ -174,7 +173,6 @@ public class ApiProvider extends DatasourceProvider{
default:
break;
}
System.out.println("response: " + response);
return response;
}
@ -187,7 +185,7 @@ public class ApiProvider extends DatasourceProvider{
int i = 0;
while (it.hasNext()){
Map.Entry entry = (Map.Entry)it.next();
row[i] = entry.getValue().toString();
row[i] = Optional.ofNullable(entry.getValue()).orElse("").toString();
i++;
}
dataList.add(row);