# APIJSON测试 api/json/get 2024-10-08 14:22:32 主页: https://github.com/Tencent/APIJSON URL: XXXXX Header: token:38e7e088-a37d-4f53-86ab-36e2a77f9873 login-type:2 Request: { "@explain":true, "[]": { "join": "&/Tenant/id@,&/StationExtension/stationCode@", "Station": { "@column": "tenantId;stationCode;stationName;provinceName;cityName;countyName;stationCapacity;" }, "Tenant": { "id@": "/Station/tenantId", "@column": "name" }, "StationExtension":{ "stationCode@":"/Station/stationCode", "@column": "consumptionType" } } } Response: { "code": "406", "data": { "[]": { "Station": { "@column": "tenantId;stationCode;stationName;provinceName;cityName;countyName;stationCapacity;" }, "Tenant": { "id@": "/Station/tenantId", "@column": "name" }, "StationExtension": { "stationCode@": "/Station/stationCode", "@column": "consumptionType" }, "query": null, "compat": null, "count": null, "page": null, "join": "&/Tenant/id@,&/StationExtension/stationCode@" }, "debug:info|help": "浏览器打开以下链接查看解答\n\n【APIAuto】: \n http://apijson.cn/api?type=JSON&url=http%3A%2F%2F10.121.9.33%2Fapi%2Fjson%2Fget&json=%7B%22%40t%22%3A1%2C%22%5B%5D%22%3A%7B%22Station%22%3A%7B%22%40column%22%3A%22tenantId%3BstationCode%3BstationName%3BprovinceName%3BcityName%3BcountyName%3BstationCapacity%3B%22%7D%2C%22Tenant%22%3A%7B%22id%40%22%3A%22%2FStation%2FtenantId%22%2C%22%40column%22%3A%22name%22%7D%2C%22StationExtension%22%3A%7B%22stationCode%40%22%3A%22%2FStation%2FstationCode%22%2C%22%40column%22%3A%22consumptionType%22%7D%2C%22join%22%3A%22%26%2FTenant%2Fid%40%2C%26%2FStationExtension%2FstationCode%40%22%7D%7D \n\n【GitHub】: \n https://www.google.com/search?q=site%3Agithub.com%2FTencent%2FAPIJSON+++%E6%88%AA%E8%87%B3+StationExtension+%E5%B7%B2%E6%89%A7%E8%A1%8C+201+%E6%9D%A1+SQL%EF%BC%8C%E6%95%B0%E9%87%8F%E5%B7%B2%E8%B6%85%E9%99%90%EF%BC%8C%E5%BF%85%E9%A1%BB%E5%9C%A8+0-200+%E5%86%85+%21 \n\n【Google】:\n https://www.google.com/search?q=%E6%88%AA%E8%87%B3+StationExtension+%E5%B7%B2%E6%89%A7%E8%A1%8C+201+%E6%9D%A1+SQL%EF%BC%8C%E6%95%B0%E9%87%8F%E5%B7%B2%E8%B6%85%E9%99%90%EF%BC%8C%E5%BF%85%E9%A1%BB%E5%9C%A8+0-200+%E5%86%85+%21 \n\n【百度】:\n https://www.baidu.com/s?ie=UTF-8&wd=%E6%88%AA%E8%87%B3+StationExtension+%E5%B7%B2%E6%89%A7%E8%A1%8C+201+%E6%9D%A1+SQL%EF%BC%8C%E6%95%B0%E9%87%8F%E5%B7%B2%E8%B6%85%E9%99%90%EF%BC%8C%E5%BF%85%E9%A1%BB%E5%9C%A8+0-200+%E5%86%85+%21 \n\n都没找到答案?打开这个链接 \n https://github.com/Tencent/APIJSON/issues/new?assignees=&labels=&template=--bug.md \n然后提交问题,推荐用以下模板修改,注意要换行保持清晰可读。 \n【标题】:截至 StationExtension 已执行 201 条 SQL,数量已超限,必须在 0-200 内 ! \n【内容】: \n **环境信息** \n 系统: Linux 3.10.0-1127.el7.x86_64 \n 数据库: \n JDK: 1.8.0_312 amd64 \n APIJSON: 6.3.0\n\n**问题描述**\n截至 StationExtension 已执行 201 条 SQL,数量已超限,必须在 0-200 内 ! \n\n \n\nPOST http://10.121.9.33/api/json/get \n发送请求 Request JSON:\n ```js \n 请填写,例如 { \"Users\":{} } \n``` \n\n返回结果 Response JSON:\n ```js \n 请填写,例如 { \"Users\": {}, \"code\": 401, \"msg\": \"Users 不允许 UNKNOWN 用户的 GET 请求!\" } \n```", "time": 1728368518490, "sql:generate|cache|execute|maxExecute": "397|196|201|200", "depth:count|max": "3|5", "time:start|duration|end|parse|sql": "1728368503680|14810|1728368518490|12792|2018", "trace:throw": "java.lang.IllegalArgumentException", "trace:stack": [ { "className": "apijson.orm.AbstractParser", "fileName": "AbstractParser.java", "lineNumber": 2048, "methodName": "executeSQL", "nativeMethod": false }, { "className": "apijson.orm.AbstractObjectParser", "fileName": "AbstractObjectParser.java", "lineNumber": 1095, "methodName": "onSQLExecute", "nativeMethod": false }, { "className": "apijson.orm.AbstractObjectParser", "fileName": "AbstractObjectParser.java", "lineNumber": 933, "methodName": "executeSQL", "nativeMethod": false }, { "className": "apijson.orm.AbstractObjectParser", "fileName": "AbstractObjectParser.java", "lineNumber": 38, "methodName": "executeSQL", "nativeMethod": false }, { "className": "apijson.orm.AbstractParser", "fileName": "AbstractParser.java", "lineNumber": 1131, "methodName": "onObjectParse", "nativeMethod": false }, { "className": "apijson.orm.AbstractObjectParser", "fileName": "AbstractObjectParser.java", "lineNumber": 578, "methodName": "onChildParse", "nativeMethod": false }, { "className": "apijson.orm.AbstractObjectParser", "fileName": "AbstractObjectParser.java", "lineNumber": 282, "methodName": "parse", "nativeMethod": false }, { "className": "apijson.orm.AbstractObjectParser", "fileName": "AbstractObjectParser.java", "lineNumber": 38, "methodName": "parse", "nativeMethod": false }, { "className": "apijson.orm.AbstractParser", "fileName": "AbstractParser.java", "lineNumber": 1125, "methodName": "onObjectParse", "nativeMethod": false }, { "className": "apijson.orm.AbstractParser", "fileName": "AbstractParser.java", "lineNumber": 1354, "methodName": "onArrayParse", "nativeMethod": false }, { "className": "apijson.orm.AbstractObjectParser", "fileName": "AbstractObjectParser.java", "lineNumber": 558, "methodName": "onChildParse", "nativeMethod": false }, { "className": "apijson.orm.AbstractObjectParser", "fileName": "AbstractObjectParser.java", "lineNumber": 282, "methodName": "parse", "nativeMethod": false }, { "className": "apijson.orm.AbstractObjectParser", "fileName": "AbstractObjectParser.java", "lineNumber": 38, "methodName": "parse", "nativeMethod": false }, { "className": "apijson.orm.AbstractParser", "fileName": "AbstractParser.java", "lineNumber": 1125, "methodName": "onObjectParse", "nativeMethod": false }, { "className": "apijson.orm.AbstractParser", "fileName": "AbstractParser.java", "lineNumber": 527, "methodName": "parseResponse", "nativeMethod": false }, { "className": "apijson.framework.APIJSONParser", "fileName": "APIJSONParser.java", "lineNumber": 117, "methodName": "parseResponse", "nativeMethod": false }, { "className": "apijson.config.NesParser", "fileName": "NesParser.java", "lineNumber": 93, "methodName": "parseResponse", "nativeMethod": false }, { "className": "apijson.orm.AbstractParser", "fileName": "AbstractParser.java", "lineNumber": 442, "methodName": "parseResponse", "nativeMethod": false }, { "className": "apijson.config.NesParser", "fileName": "NesParser.java", "lineNumber": 112, "methodName": "parse", "nativeMethod": false }, { "className": "apijson.framework.APIJSONController", "fileName": "APIJSONController.java", "lineNumber": 93, "methodName": "parse", "nativeMethod": false }, { "className": "apijson.framework.APIJSONController", "fileName": "APIJSONController.java", "lineNumber": 135, "methodName": "get", "nativeMethod": false }, { "className": "apijson.controller.JsonController", "fileName": "JsonController.java", "lineNumber": 101, "methodName": "get", "nativeMethod": false }, { "className": "sun.reflect.GeneratedMethodAccessor1571", "fileName": null, "lineNumber": -1, "methodName": "invoke", "nativeMethod": false }, { "className": "sun.reflect.DelegatingMethodAccessorImpl", "fileName": "DelegatingMethodAccessorImpl.java", "lineNumber": 43, "methodName": "invoke", "nativeMethod": false }, { "className": "java.lang.reflect.Method", "fileName": "Method.java", "lineNumber": 498, "methodName": "invoke", "nativeMethod": false }, { "className": "org.springframework.web.method.support.InvocableHandlerMethod", "fileName": "InvocableHandlerMethod.java", "lineNumber": 190, "methodName": "doInvoke", "nativeMethod": false }, { "className": "org.springframework.web.method.support.InvocableHandlerMethod", "fileName": "InvocableHandlerMethod.java", "lineNumber": 138, "methodName": "invokeForRequest", "nativeMethod": false }, { "className": "org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod", "fileName": "ServletInvocableHandlerMethod.java", "lineNumber": 105, "methodName": "invokeAndHandle", "nativeMethod": false }, { "className": "org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter", "fileName": "RequestMappingHandlerAdapter.java", "lineNumber": 878, "methodName": "invokeHandlerMethod", "nativeMethod": false }, { "className": "org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter", "fileName": "RequestMappingHandlerAdapter.java", "lineNumber": 792, "methodName": "handleInternal", "nativeMethod": false }, { "className": "org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter", "fileName": "AbstractHandlerMethodAdapter.java", "lineNumber": 87, "methodName": "handle", "nativeMethod": false }, { "className": "org.springframework.web.servlet.DispatcherServlet", "fileName": "DispatcherServlet.java", "lineNumber": 1040, "methodName": "doDispatch", "nativeMethod": false }, { "className": "org.springframework.web.servlet.DispatcherServlet", "fileName": "DispatcherServlet.java", "lineNumber": 943, "methodName": "doService", "nativeMethod": false }, { "className": "org.springframework.web.servlet.FrameworkServlet", "fileName": "FrameworkServlet.java", "lineNumber": 1006, "methodName": "processRequest", "nativeMethod": false }, { "className": "org.springframework.web.servlet.FrameworkServlet", "fileName": "FrameworkServlet.java", "lineNumber": 909, "methodName": "doPost", "nativeMethod": false }, { "className": "javax.servlet.http.HttpServlet", "fileName": "HttpServlet.java", "lineNumber": 665, "methodName": "service", "nativeMethod": false }, { "className": "org.springframework.web.servlet.FrameworkServlet", "fileName": "FrameworkServlet.java", "lineNumber": 883, "methodName": "service", "nativeMethod": false }, { "className": "javax.servlet.http.HttpServlet", "fileName": "HttpServlet.java", "lineNumber": 750, "methodName": "service", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 227, "methodName": "internalDoFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 162, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.apache.tomcat.websocket.server.WsFilter", "fileName": "WsFilter.java", "lineNumber": 53, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 189, "methodName": "internalDoFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 162, "methodName": "doFilter", "nativeMethod": false }, { "className": "com.github.xiaoymin.knife4j.spring.filter.SecurityBasicAuthFilter", "fileName": "SecurityBasicAuthFilter.java", "lineNumber": 87, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 189, "methodName": "internalDoFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 162, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.springframework.web.filter.CorsFilter", "fileName": "CorsFilter.java", "lineNumber": 92, "methodName": "doFilterInternal", "nativeMethod": false }, { "className": "org.springframework.web.filter.OncePerRequestFilter", "fileName": "OncePerRequestFilter.java", "lineNumber": 119, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 189, "methodName": "internalDoFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 162, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.springframework.web.filter.RequestContextFilter", "fileName": "RequestContextFilter.java", "lineNumber": 100, "methodName": "doFilterInternal", "nativeMethod": false }, { "className": "org.springframework.web.filter.OncePerRequestFilter", "fileName": "OncePerRequestFilter.java", "lineNumber": 119, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 189, "methodName": "internalDoFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 162, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.springframework.web.filter.FormContentFilter", "fileName": "FormContentFilter.java", "lineNumber": 93, "methodName": "doFilterInternal", "nativeMethod": false }, { "className": "org.springframework.web.filter.OncePerRequestFilter", "fileName": "OncePerRequestFilter.java", "lineNumber": 119, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 189, "methodName": "internalDoFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 162, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.springframework.web.filter.CharacterEncodingFilter", "fileName": "CharacterEncodingFilter.java", "lineNumber": 201, "methodName": "doFilterInternal", "nativeMethod": false }, { "className": "org.springframework.web.filter.OncePerRequestFilter", "fileName": "OncePerRequestFilter.java", "lineNumber": 119, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 189, "methodName": "internalDoFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.ApplicationFilterChain", "fileName": "ApplicationFilterChain.java", "lineNumber": 162, "methodName": "doFilter", "nativeMethod": false }, { "className": "org.apache.catalina.core.StandardWrapperValve", "fileName": "StandardWrapperValve.java", "lineNumber": 202, "methodName": "invoke", "nativeMethod": false }, { "className": "org.apache.catalina.core.StandardContextValve", "fileName": "StandardContextValve.java", "lineNumber": 97, "methodName": "invoke", "nativeMethod": false }, { "className": "org.apache.catalina.authenticator.AuthenticatorBase", "fileName": "AuthenticatorBase.java", "lineNumber": 542, "methodName": "invoke", "nativeMethod": false }, { "className": "org.apache.catalina.core.StandardHostValve", "fileName": "StandardHostValve.java", "lineNumber": 143, "methodName": "invoke", "nativeMethod": false }, { "className": "org.apache.catalina.valves.ErrorReportValve", "fileName": "ErrorReportValve.java", "lineNumber": 92, "methodName": "invoke", "nativeMethod": false }, { "className": "org.apache.catalina.core.StandardEngineValve", "fileName": "StandardEngineValve.java", "lineNumber": 78, "methodName": "invoke", "nativeMethod": false }, { "className": "org.apache.catalina.connector.CoyoteAdapter", "fileName": "CoyoteAdapter.java", "lineNumber": 357, "methodName": "service", "nativeMethod": false }, { "className": "org.apache.coyote.http11.Http11Processor", "fileName": "Http11Processor.java", "lineNumber": 374, "methodName": "service", "nativeMethod": false }, { "className": "org.apache.coyote.AbstractProcessorLight", "fileName": "AbstractProcessorLight.java", "lineNumber": 65, "methodName": "process", "nativeMethod": false }, { "className": "org.apache.coyote.AbstractProtocol$ConnectionHandler", "fileName": "AbstractProtocol.java", "lineNumber": 893, "methodName": "process", "nativeMethod": false }, { "className": "org.apache.tomcat.util.net.NioEndpoint$SocketProcessor", "fileName": "NioEndpoint.java", "lineNumber": 1707, "methodName": "doRun", "nativeMethod": false }, { "className": "org.apache.tomcat.util.net.SocketProcessorBase", "fileName": "SocketProcessorBase.java", "lineNumber": 49, "methodName": "run", "nativeMethod": false }, { "className": "java.util.concurrent.ThreadPoolExecutor", "fileName": "ThreadPoolExecutor.java", "lineNumber": 1149, "methodName": "runWorker", "nativeMethod": false }, { "className": "java.util.concurrent.ThreadPoolExecutor$Worker", "fileName": "ThreadPoolExecutor.java", "lineNumber": 624, "methodName": "run", "nativeMethod": false }, { "className": "org.apache.tomcat.util.threads.TaskThread$WrappingRunnable", "fileName": "TaskThread.java", "lineNumber": 61, "methodName": "run", "nativeMethod": false }, { "className": "java.lang.Thread", "fileName": "Thread.java", "lineNumber": 748, "methodName": "run", "nativeMethod": false } ] }, "success": false, "message": "截至 StationExtension 已执行 201 条 SQL,数量已超限,必须在 0-200 内 !" } ## 解析 Response 的代码(Kotlin): var response: JSONObject = JSON.parseObject(resultJson) var code = response?.getString("code") println("response.code = " + code); run { // data <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< var data: JSONObject? = response?.getJSONObject("data") if (data == null) { data = JSONObject() } run { // [] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< var list: JSONObject? = data?.getJSONObject("[]") if (list == null) { list = JSONObject() } run { // Station <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< var station: JSONObject? = list?.getJSONObject("Station") if (station == null) { station = JSONObject() } var column = station?.getString("@column") println("station.column = " + column); } // Station >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> run { // Tenant <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< var tenant: JSONObject? = list?.getJSONObject("Tenant") if (tenant == null) { tenant = JSONObject() } var idAt = tenant?.getString("id@") println("tenant.idAt = " + idAt); var column = tenant?.getString("@column") println("tenant.column = " + column); } // Tenant >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> run { // StationExtension <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< var stationExtension: JSONObject? = list?.getJSONObject("StationExtension") if (stationExtension == null) { stationExtension = JSONObject() } var stationCodeAt = stationExtension?.getString("stationCode@") println("stationExtension.stationCodeAt = " + stationCodeAt); var column = stationExtension?.getString("@column") println("stationExtension.column = " + column); } // StationExtension >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> var query = list?.getJSONObject("query") println("list.query = " + query); var compat = list?.getJSONObject("compat") println("list.compat = " + compat); var count = list?.getJSONObject("count") println("list.count = " + count); var page = list?.getJSONObject("page") println("list.page = " + page); var join = list?.getString("join") println("list.join = " + join); } // [] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> var debugAsInfoOrhelp = data?.getString("debug:info|help") println("data.debugAsInfoOrhelp = " + debugAsInfoOrhelp); var time = data?.getLongValue("time") println("data.time = " + time); var sqlAsGenerateOrcacheOrexecuteOrmaxExecute = data?.getString("sql:generate|cache|execute|maxExecute") println("data.sqlAsGenerateOrcacheOrexecuteOrmaxExecute = " + sqlAsGenerateOrcacheOrexecuteOrmaxExecute); var depthAsCountOrmax = data?.getString("depth:count|max") println("data.depthAsCountOrmax = " + depthAsCountOrmax); var timeAsStartOrdurationOrendOrparseOrsql = data?.getString("time:start|duration|end|parse|sql") println("data.timeAsStartOrdurationOrendOrparseOrsql = " + timeAsStartOrdurationOrendOrparseOrsql); var traceAsThrow = data?.getString("trace:throw") println("data.traceAsThrow = " + traceAsThrow); run { // trace:stack <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< var traceAsStack1: JSONArray? = data?.getJSONArray("trace:stack") if (traceAsStack1 == null) { traceAsStack1 = JSONArray(); } var traceAsStack1Item1: JSONObject? for (i1 in 0..traceAsStack1.size - 1) { traceAsStack1Item1 = traceAsStack1?.getJSONObject(i1) if (traceAsStack1Item1 == null) { continue } println("\ntraceAsStack1Item1 = traceAsStack1[" + i1 + "] = \n" + traceAsStack1Item1 + "\n\n") // TODO 你的代码 var className = traceAsStack1Item1?.getString("className") println("traceAsStack1Item1.className = " + className); var fileName = traceAsStack1Item1?.getString("fileName") println("traceAsStack1Item1.fileName = " + fileName); var lineNumber = traceAsStack1Item1?.getIntValue("lineNumber") println("traceAsStack1Item1.lineNumber = " + lineNumber); var methodName = traceAsStack1Item1?.getString("methodName") println("traceAsStack1Item1.methodName = " + methodName); var nativeMethod = traceAsStack1Item1?.getBooleanValue("nativeMethod") println("traceAsStack1Item1.nativeMethod = " + nativeMethod); } } // trace:stack >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> } // data >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> var success = response?.getBooleanValue("success") println("response.success = " + success); var message = response?.getString("message") println("response.message = " + message);