您的位置:首页 > 健康 > 美食 > 怎么查自己团员信息_装修加盟好项目_腾讯广告代理_百度快照投诉中心官网

怎么查自己团员信息_装修加盟好项目_腾讯广告代理_百度快照投诉中心官网

2024/12/23 1:31:17 来源:https://blog.csdn.net/w12515114096/article/details/143031539  浏览:    关键词:怎么查自己团员信息_装修加盟好项目_腾讯广告代理_百度快照投诉中心官网
怎么查自己团员信息_装修加盟好项目_腾讯广告代理_百度快照投诉中心官网

String json = “{\n” +
" “paths”: {\n" +
" “/dev-api/system/subjectResult/exportUserList”: {\n" +
" “post”: {\n" +
" “tags”: [\n" +
" “bd-subject-result-controller”\n" +
" ],\n" +
" “summary”: “导出对应成绩信息”,\n" +
" “operationId”: “exportUserListUsingPOST”,\n" +
" “parameters”: [\n" +
" {\n" +
" “name”: “batch”,\n" +
" “in”: “query”,\n" +
" “required”: false,\n" +
" “style”: “form”,\n" +
" “schema”: {\n" +
" “type”: “string”\n" +
" }\n" +
" },\n" +
" {\n" +
" “name”: “year”,\n" +
" “in”: “query”,\n" +
" “required”: false,\n" +
" “style”: “form”,\n" +
" “schema”: {\n" +
" “type”: “string”\n" +
" }\n" +
" }\n" +
" ]\n" +
" }\n" +
" },\n" +
" “/dev-api/system/subjectResult/test/{subjectId}”: {\n" +
" “get”: {\n" +
" “parameters”: [\n" +
" {\n" +
" “name”: “subjectId”,\n" +
" “in”: “path”,\n" +
" “description”: “subjectId”,\n" +
" “required”: true,\n" +
" “style”: “form”,\n" +
" “schema”: {\n" +
" “type”: “integer”,\n" +
" “format”: “int64”\n" +
" }\n" +
" },\n" +
" {\n" +
" “name”: “number”,\n" +
" “in”: “query”,\n" +
" “description”: “number”,\n" +
" “required”: true,\n" +
" “style”: “form”,\n" +
" “schema”: {\n" +
" “type”: “number”,\n" +
" “format”: “float”\n" +
" }\n" +
" },\n" +
" {\n" +
" “name”: “sort”,\n" +
" “in”: “query”,\n" +
" “description”: “sort”,\n" +
" “required”: true,\n" +
" “style”: “form”,\n" +
" “schema”: {\n" +
" “type”: “number”,\n" +
" “format”: “float”\n" +
" }\n" +
" }\n" +
" ]\n" +
" }\n" +
" }\n" +
" }\n" +
“}”;

ObjectMapper mapper = new ObjectMapper();
JsonNode rootNode = mapper.readTree(json);

StringBuilder result = new StringBuilder();

JsonNode pathsNode = rootNode.path(“paths”);
pathsNode.fieldNames().forEachRemaining(path -> {
JsonNode pathNode = pathsNode.path(path);
pathNode.fieldNames().forEachRemaining(method -> {
JsonNode methodNode = pathNode.path(method);
result.append(“### “).append(method.toUpperCase()).append(” request with dynamic variables\n”);
result.append(method.toUpperCase()).append(" http://{{host}}/{{staticurl}}“).append(path.replace(”{“, “{{”).replace(”}“, “}}”));
if (methodNode.has(“parameters”)) {
boolean firstQueryParam = true;
for (JsonNode param : methodNode.path(“parameters”)) {
String paramName = param.path(“name”).asText();
String paramIn = param.path(“in”).asText();
if (“query”.equals(paramIn)) {
if (firstQueryParam) {
result.append(”?“);
firstQueryParam = false;
} else {
result.append(”&“);
}
result.append(paramName).append(”=“).append(”{{“).append(paramName).append(”}}“);
}
}
}
result.append(”\nAccept: application/json\n\n");
});
});

System.out.println(result.toString());

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com