parent
							
								
									c7347e9970
								
							
						
					
					
						commit
						45fcbdfe60
					
				| 
						 | 
				
			
			@ -70,6 +70,17 @@ public class ApiEntity {
 | 
			
		|||
        this.requestBody = requestBody;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return "ApiEntity{" +
 | 
			
		||||
                "URL='" + URL + '\'' +
 | 
			
		||||
                ", method='" + method + '\'' +
 | 
			
		||||
                ", queryParams=" + queryParams +
 | 
			
		||||
                ", headers=" + headers +
 | 
			
		||||
                ", requestBody=" + requestBody +
 | 
			
		||||
                '}';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public ApiEntity() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -230,6 +230,7 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin {
 | 
			
		|||
        if ("shkd_testapi".equals(itemKey)) {
 | 
			
		||||
            //域名
 | 
			
		||||
            String domainName = dataEntity.getString("shkd_domainname");
 | 
			
		||||
            //url
 | 
			
		||||
            String url = dataEntity.getString("shkd_url");
 | 
			
		||||
            ApiEntity apiEntity = new ApiEntity();
 | 
			
		||||
            apiEntity.setURL(domainName + url);
 | 
			
		||||
| 
						 | 
				
			
			@ -239,10 +240,12 @@ public class ApiMappingBillPlugin extends AbstractFormPlugin implements Plugin {
 | 
			
		|||
            apiEntity.setHeaders(headMap);
 | 
			
		||||
            Map<String, Object> paramsMap = new HashMap<>();
 | 
			
		||||
            Map<String, Object> resultMap = ApiService.getBIPToken(domainName);
 | 
			
		||||
            logger.info("getBIPToken → 获取返回token:{}", resultMap.get("token"));
 | 
			
		||||
            paramsMap.put("access_token", resultMap.get("token"));
 | 
			
		||||
            apiEntity.setQueryParams(paramsMap);
 | 
			
		||||
            apiEntity.setRequestBody(codeEdit.getText());
 | 
			
		||||
            JSONObject responseBody = ApiEntity.getResponseBody(apiEntity);
 | 
			
		||||
            logger.info("调用接口实体对象apiEntity → 返回结果:{}", apiEntity);
 | 
			
		||||
            this.getView().showTipNotification("返回结果:" + responseBody.toJSONString());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue