Tencent / APIJSON

🏆 实时 零代码、全功能、强安全 ORM 库 🚀 后端接口和文档零代码,前端(客户端) 定制返回 JSON 的数据和结构 🏆 Real-Time coding-free, powerful and secure ORM 🚀 providing APIs and Docs without coding by Backend, and the returned JSON of API can be customized by Frontend(Client) users
http://apijson.cn
Other
17.29k stars 2.16k forks source link

[Bug]字符 getMethodDefination(method,arguments,type,exceptions,language) 对应的远程函数 getMethodDefination(JSONObject request, String method, String arguments, String type, String exceptions, String language) 不在后端 apijson.demo.DemoFunctionParser 内,也不在父类中!如果需要则先新增对应方法! 请检查函数名和参数数量是否与已定义的函数一致! #682

Closed ansyxpf closed 9 months ago

ansyxpf commented 9 months ago

APIJSON Version/APIJSON 版本号

6.3.0

Database Type & Version/数据库类型及版本号

MySQL 8.0.19

Environment/环境信息

- JDK/基础库:1.8.0_342
- OS/系统:macOS Sonoma 14.2.1 (23C71)

APIAuto Screenshots/APIAuto 请求与结果完整截屏

https://sm.ms/image/SCmg9VMW4dbnvQ2

Current Behavior/问题描述

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2024-02-06 01:55:54.789: AbstractParser.DEBUG: DELETE/parseResponse  request = 
{"methodArgs":"methodArgs","result()":"getMethodArguments(methodArgs)"}

2024-02-06 01:55:54.789: AbstractParser.DEBUG: DELETE/parseResponse return response = 
{"result":"","methodArgs":"methodArgs","ok":true,"code":200,"msg":"success","debug:info|help":" \n提 bug 请发请求和响应的【完整截屏】,没图的自行解决! \n开发者有限的时间和精力主要放在【维护项目源码和文档】上! \n【描述不详细】 或 【文档/常见问题 已有答案】 的问题可能会被忽略!! \n【态度 不文明/不友善】的可能会被踢出群,问题也可能不予解答!!! \n\n **环境信息**  \n系统: Mac OS X 14.2.1 \n数据库: DEFAULT_DATABASE = MYSQL \nJDK: 20.0.1 x86_64 \nAPIJSON: 6.3.0 \n   \n【常见问题】:https://github.com/Tencent/APIJSON/issues/36 \n【通用文档】:https://github.com/Tencent/APIJSON/blob/master/Document.md \n【视频教程】:https://search.bilibili.com/all?keyword=APIJSON","time":1707198954789,"sql:generate|cache|execute|maxExecute":"0|0|0|200","depth:count|max":"1|5","time:start|duration|end|parse|sql":"1707198954789|0|1707198954789|0|0"}

2024-02-06 01:55:54.789: AbstractParser.DEBUG: DELETE/parseResponse  endTime = 1707198954789;  duration = 0
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

2024-02-06 01:55:54.789: AbstractParser.DEBUG: parseResponse  startTime = 1707198954789<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

2024-02-06 01:55:54.789: AbstractObjectParser.DEBUG: AbstractObjectParser  parentPath = null; name = null; table = null; alias = null
2024-02-06 01:55:54.789: AbstractObjectParser.DEBUG: AbstractObjectParser  type = 0; isTable = false; isArrayMainTable = false
2024-02-06 01:55:54.789: AbstractObjectParser.DEBUG: AbstractObjectParser  isEmpty = false; tri = false; drop = false
java.lang.IllegalArgumentException: 字符 getMethodDefination(method,arguments,type,exceptions,language) 对应的远程函数 getMethodDefination(JSONObject request, String method, String arguments, String type, String exceptions, String language) 不在后端 apijson.demo.DemoFunctionParser 内,也不在父类中!如果需要则先新增对应方法!
请检查函数名和参数数量是否与已定义的函数一致!
且必须为 function(key0,key1,...) 这种单函数格式!
function 必须符合 Java 函数命名,key 是用于在 curObj 内取值的键!
调用时不要有空格!apijson.demo.DemoFunctionParser.getMethodDefination(com.alibaba.fastjson.JSONObject,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)
    at apijson.orm.AbstractFunctionParser.invoke(AbstractFunctionParser.java:401)
    at apijson.orm.AbstractFunctionParser.invoke(AbstractFunctionParser.java:343)
    at apijson.framework.APIJSONParser.onFunctionParse(APIJSONParser.java:143)
    at apijson.orm.AbstractObjectParser.parseFunction(AbstractObjectParser.java:1035)
    at apijson.orm.AbstractObjectParser.onParse(AbstractObjectParser.java:503)
    at apijson.orm.AbstractObjectParser.parse(AbstractObjectParser.java:295)
    at apijson.orm.AbstractObjectParser.parse(AbstractObjectParser.java:38)
    at apijson.orm.AbstractParser.onObjectParse(AbstractParser.java:1125)
    at apijson.orm.AbstractParser.parseResponse(AbstractParser.java:527)
    at apijson.framework.APIJSONParser.parseResponse(APIJSONParser.java:117)
    at apijson.framework.APIJSONFunctionParser.init(APIJSONFunctionParser.java:306)
    at apijson.framework.APIJSONFunctionParser.init(APIJSONFunctionParser.java:133)
    at apijson.framework.APIJSONApplication.init(APIJSONApplication.java:95)
    at apijson.framework.APIJSONApplication.init(APIJSONApplication.java:44)
    at apijson.boot.DemoApplication.main(DemoApplication.java:89)
2024-02-06 01:55:54.845: 

AbstractParser.DEBUG: <<<<<<<<<<<<<<<<<<<<<<< close >>>>>>>>>>>>>>>>>>>>>>> 

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2024-02-06 01:55:54.845: AbstractParser.DEBUG: GET/parseResponse  request = 
{"method":"method","result()":"getMethodDefination(method,arguments,type,exceptions,language)"}

2024-02-06 01:55:54.847: AbstractParser.DEBUG: GET/parseResponse return response = 
{"method":"method","result()":"getMethodDefination(method,arguments,type,exceptions,language)","ok":false,"code":406,"msg":"字符 getMethodDefination(method,arguments,type,exceptions,language) 对应的远程函数 getMethodDefination(JSONObject request, String method, String arguments, String type, String exceptions, String language) 不在后端 apijson.demo.DemoFunctionParser 内,也不在父类中!如果需要则先新增对应方法!\n请检查函数名和参数数量是否与已定义的函数一致!\n且必须为 function(key0,key1,...) 这种单函数格式!\nfunction 必须符合 Java 函数命名,key 是用于在 curObj 内取值的键!\n调用时不要有空格!apijson.demo.DemoFunctionParser.getMethodDefination(com.alibaba.fastjson.JSONObject,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)","debug:info|help":"浏览器打开以下链接查看解答\n\n【APIAuto】: \n http://apijson.cn/api?type=JSON&url=http%3A%2F%2F127.0.0.1%3A8080%2Fget&json=%7B%22method%22%3A%22method%22%2C%22result%28%29%22%3A%22getMethodDefination%28method%2Carguments%2Ctype%2Cexceptions%2Clanguage%29%22%7D        \n\n【GitHub】: \n https://www.google.com/search?q=site%3Agithub.com%2FTencent%2FAPIJSON+++%E5%AD%97%E7%AC%A6+getMethodDefination%28method%2Carguments%2Ctype%2Cexceptions%2Clanguage%29+%E5%AF%B9%E5%BA%94%E7%9A%84%E8%BF%9C%E7%A8%8B%E5%87%BD%E6%95%B0+getMethodDefination%28JSONObject+request%2C+String+method%2C+String+arguments%2C+String+type%2C+String+exceptions%2C+String+language%29+%E4%B8%8D%E5%9C%A8%E5%90%8E%E7%AB%AF+apijson.demo.DemoFunctionParser+%E5%86%85%EF%BC%8C%E4%B9%9F%E4%B8%8D%E5%9C%A8%E7%88%B6%E7%B1%BB%E4%B8%AD%EF%BC%81%E5%A6%82%E6%9E%9C%E9%9C%80%E8%A6%81%E5%88%99%E5%85%88%E6%96%B0%E5%A2%9E%E5%AF%B9%E5%BA%94%E6%96%B9%E6%B3%95%EF%BC%81%0A%E8%AF%B7%E6%A3%80%E6%9F%A5%E5%87%BD%E6%95%B0%E5%90%8D%E5%92%8C%E5%8F%82%E6%95%B0%E6%95%B0%E9%87%8F%E6%98%AF%E5%90%A6%E4%B8%8E%E5%B7%B2%E5%AE%9A%E4%B9%89%E7%9A%84%E5%87%BD%E6%95%B0%E4%B8%80%E8%87%B4%EF%BC%81%0A%E4%B8%94%E5%BF%85%E9%A1%BB%E4%B8%BA+function%28key0%2Ckey1%2C...%29+%E8%BF%99%E7%A7%8D%E5%8D%95%E5%87%BD%E6%95%B0%E6%A0%BC%E5%BC%8F%EF%BC%81%0Afunction+%E5%BF%85%E9%A1%BB%E7%AC%A6%E5%90%88+Java+%E5%87%BD%E6%95%B0%E5%91%BD%E5%90%8D%EF%BC%8Ckey+%E6%98%AF%E7%94%A8%E4%BA%8E%E5%9C%A8+curObj+%E5%86%85%E5%8F%96%E5%80%BC%E7%9A%84%E9%94%AE%EF%BC%81%0A%E8%B0%83%E7%94%A8%E6%97%B6%E4%B8%8D%E8%A6%81%E6%9C%89%E7%A9%BA%E6%A0%BC%EF%BC%81apijson.demo.DemoFunctionParser.getMethodDefination%28com.alibaba.fastjson.JSONObject%2Cjava.lang.String%2Cjava.lang.String%2Cjava.lang.String%2Cjava.lang.String%2Cjava.lang.String%29        \n\n【Google】:\n https://www.google.com/search?q=%E5%AD%97%E7%AC%A6+getMethodDefination%28method%2Carguments%2Ctype%2Cexceptions%2Clanguage%29+%E5%AF%B9%E5%BA%94%E7%9A%84%E8%BF%9C%E7%A8%8B%E5%87%BD%E6%95%B0+getMethodDefination%28JSONObject+request%2C+String+method%2C+String+arguments%2C+String+type%2C+String+exceptions%2C+String+language%29+%E4%B8%8D%E5%9C%A8%E5%90%8E%E7%AB%AF+apijson.demo.DemoFunctionParser+%E5%86%85%EF%BC%8C%E4%B9%9F%E4%B8%8D%E5%9C%A8%E7%88%B6%E7%B1%BB%E4%B8%AD%EF%BC%81%E5%A6%82%E6%9E%9C%E9%9C%80%E8%A6%81%E5%88%99%E5%85%88%E6%96%B0%E5%A2%9E%E5%AF%B9%E5%BA%94%E6%96%B9%E6%B3%95%EF%BC%81%0A%E8%AF%B7%E6%A3%80%E6%9F%A5%E5%87%BD%E6%95%B0%E5%90%8D%E5%92%8C%E5%8F%82%E6%95%B0%E6%95%B0%E9%87%8F%E6%98%AF%E5%90%A6%E4%B8%8E%E5%B7%B2%E5%AE%9A%E4%B9%89%E7%9A%84%E5%87%BD%E6%95%B0%E4%B8%80%E8%87%B4%EF%BC%81%0A%E4%B8%94%E5%BF%85%E9%A1%BB%E4%B8%BA+function%28key0%2Ckey1%2C...%29+%E8%BF%99%E7%A7%8D%E5%8D%95%E5%87%BD%E6%95%B0%E6%A0%BC%E5%BC%8F%EF%BC%81%0Afunction+%E5%BF%85%E9%A1%BB%E7%AC%A6%E5%90%88+Java+%E5%87%BD%E6%95%B0%E5%91%BD%E5%90%8D%EF%BC%8Ckey+%E6%98%AF%E7%94%A8%E4%BA%8E%E5%9C%A8+curObj+%E5%86%85%E5%8F%96%E5%80%BC%E7%9A%84%E9%94%AE%EF%BC%81%0A%E8%B0%83%E7%94%A8%E6%97%B6%E4%B8%8D%E8%A6%81%E6%9C%89%E7%A9%BA%E6%A0%BC%EF%BC%81apijson.demo.DemoFunctionParser.getMethodDefination%28com.alibaba.fastjson.JSONObject%2Cjava.lang.String%2Cjava.lang.String%2Cjava.lang.String%2Cjava.lang.String%2Cjava.lang.String%29        \n\n【百度】:\n https://www.baidu.com/s?ie=UTF-8&wd=%E5%AD%97%E7%AC%A6+getMethodDefination%28method%2Carguments%2Ctype%2Cexceptions%2Clanguage%29+%E5%AF%B9%E5%BA%94%E7%9A%84%E8%BF%9C%E7%A8%8B%E5%87%BD%E6%95%B0+getMethodDefination%28JSONObject+request%2C+String+method%2C+String+arguments%2C+String+type%2C+String+exceptions%2C+String+language%29+%E4%B8%8D%E5%9C%A8%E5%90%8E%E7%AB%AF+apijson.demo.DemoFunctionParser+%E5%86%85%EF%BC%8C%E4%B9%9F%E4%B8%8D%E5%9C%A8%E7%88%B6%E7%B1%BB%E4%B8%AD%EF%BC%81%E5%A6%82%E6%9E%9C%E9%9C%80%E8%A6%81%E5%88%99%E5%85%88%E6%96%B0%E5%A2%9E%E5%AF%B9%E5%BA%94%E6%96%B9%E6%B3%95%EF%BC%81%0A%E8%AF%B7%E6%A3%80%E6%9F%A5%E5%87%BD%E6%95%B0%E5%90%8D%E5%92%8C%E5%8F%82%E6%95%B0%E6%95%B0%E9%87%8F%E6%98%AF%E5%90%A6%E4%B8%8E%E5%B7%B2%E5%AE%9A%E4%B9%89%E7%9A%84%E5%87%BD%E6%95%B0%E4%B8%80%E8%87%B4%EF%BC%81%0A%E4%B8%94%E5%BF%85%E9%A1%BB%E4%B8%BA+function%28key0%2Ckey1%2C...%29+%E8%BF%99%E7%A7%8D%E5%8D%95%E5%87%BD%E6%95%B0%E6%A0%BC%E5%BC%8F%EF%BC%81%0Afunction+%E5%BF%85%E9%A1%BB%E7%AC%A6%E5%90%88+Java+%E5%87%BD%E6%95%B0%E5%91%BD%E5%90%8D%EF%BC%8Ckey+%E6%98%AF%E7%94%A8%E4%BA%8E%E5%9C%A8+curObj+%E5%86%85%E5%8F%96%E5%80%BC%E7%9A%84%E9%94%AE%EF%BC%81%0A%E8%B0%83%E7%94%A8%E6%97%B6%E4%B8%8D%E8%A6%81%E6%9C%89%E7%A9%BA%E6%A0%BC%EF%BC%81apijson.demo.DemoFunctionParser.getMethodDefination%28com.alibaba.fastjson.JSONObject%2Cjava.lang.String%2Cjava.lang.String%2Cjava.lang.String%2Cjava.lang.String%2Cjava.lang.String%29        \n\n都没找到答案?打开这个链接 \n https://github.com/Tencent/APIJSON/issues/new?assignees=&labels=&template=--bug.md   \n然后提交问题,推荐用以下模板修改,注意要换行保持清晰可读。 \n【标题】:字符 getMethodDefination(method,arguments,type,exceptions,language) 对应的远程函数 getMethodDefination(JSONObject request, String method, String arguments, String type, String exceptions, String language) 不在后端 apijson.demo.DemoFunctionParser 内,也不在父类中!如果需要则先新增对应方法!\n请检查函数名和参数数量是否与已定义的函数一致!\n且必须为 function(key0,key1,...) 这种单函数格式!\nfunction 必须符合 Java 函数命名,key 是用于在 curObj 内取值的键!\n调用时不要有空格!apijson.demo.DemoFunctionParser.getMethodDefination(com.alibaba.fastjson.JSONObject,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String) \n【内容】: \n **环境信息**  \n 系统: Mac OS X 14.2.1 \n 数据库: <!-- 请填写,例如 MySQL 5.7。默认数据库为 MYSQL --> \n JDK: 20.0.1 x86_64 \n APIJSON: 6.3.0\n\n**问题描述**\n字符 getMethodDefination(method,arguments,type,exceptions,language) 对应的远程函数 getMethodDefination(JSONObject request, String method, String arguments, String type, String exceptions, String language) 不在后端 apijson.demo.DemoFunctionParser 内,也不在父类中!如果需要则先新增对应方法!\n请检查函数名和参数数量是否与已定义的函数一致!\n且必须为 function(key0,key1,...) 这种单函数格式!\nfunction 必须符合 Java 函数命名,key 是用于在 curObj 内取值的键!\n调用时不要有空格!apijson.demo.DemoFunctionParser.getMethodDefination(com.alibaba.fastjson.JSONObject,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String) \n\n<!-- 尽量完整截屏(至少包含请求和回包结果,还可以加上控制台报错日志),然后复制粘贴到这里 --> \n\nPOST http://127.0.0.1:8080/get \n发送请求 Request JSON:\n  \n 请填写,例如 { \"Users\":{} } \n \n\n返回结果 Response JSON:\n ```js \n 请填写,例如 { \"Users\": {}, \"code\": 401, \"msg\": \"Users 不允许 UNKNOWN 用户的 GET 请求!\" } \n```","time":1707198954845,"sql:generate|cache|execute|maxExecute":"0|0|0|200","depth:count|max":"1|5","time:start|duration|end|parse|sql":"1707198954789|56|1707198954845|56|0","trace:throw":"java.lang.IllegalArgumentException","trace:stack":[{"classLoaderName":"app","className":"apijson.orm.AbstractFunctionParser","fileName":"AbstractFunctionParser.java","lineNumber":401,"methodName":"invoke","nativeMethod":false},{"classLoaderName":"app","className":"apijson.orm.AbstractFunctionParser","fileName":"AbstractFunctionParser.java","lineNumber":343,"methodName":"invoke","nativeMethod":false},{"classLoaderName":"app","className":"apijson.framework.APIJSONParser","fileName":"APIJSONParser.java","lineNumber":143,"methodName":"onFunctionParse","nativeMethod":false},{"classLoaderName":"app","className":"apijson.orm.AbstractObjectParser","fileName":"AbstractObjectParser.java","lineNumber":1035,"methodName":"parseFunction","nativeMethod":false},{"classLoaderName":"app","className":"apijson.orm.AbstractObjectParser","fileName":"AbstractObjectParser.java","lineNumber":503,"methodName":"onParse","nativeMethod":false},{"classLoaderName":"app","className":"apijson.orm.AbstractObjectParser","fileName":"AbstractObjectParser.java","lineNumber":295,"methodName":"parse","nativeMethod":false},{"classLoaderName":"app","className":"apijson.orm.AbstractObjectParser","fileName":"AbstractObjectParser.java","lineNumber":38,"methodName":"parse","nativeMethod":false},{"classLoaderName":"app","className":"apijson.orm.AbstractParser","fileName":"AbstractParser.java","lineNumber":1125,"methodName":"onObjectParse","nativeMethod":false},{"classLoaderName":"app","className":"apijson.orm.AbstractParser","fileName":"AbstractParser.java","lineNumber":527,"methodName":"parseResponse","nativeMethod":false},{"classLoaderName":"app","className":"apijson.framework.APIJSONParser","fileName":"APIJSONParser.java","lineNumber":117,"methodName":"parseResponse","nativeMethod":false},{"classLoaderName":"app","className":"apijson.framework.APIJSONFunctionParser","fileName":"APIJSONFunctionParser.java","lineNumber":306,"methodName":"init","nativeMethod":false},{"classLoaderName":"app","className":"apijson.framework.APIJSONFunctionParser","fileName":"APIJSONFunctionParser.java","lineNumber":133,"methodName":"init","nativeMethod":false},{"classLoaderName":"app","className":"apijson.framework.APIJSONApplication","fileName":"APIJSONApplication.java","lineNumber":95,"methodName":"init","nativeMethod":false},{"classLoaderName":"app","className":"apijson.framework.APIJSONApplication","fileName":"APIJSONApplication.java","lineNumber":44,"methodName":"init","nativeMethod":false},{"classLoaderName":"app","className":"apijson.boot.DemoApplication","fileName":"DemoApplication.java","lineNumber":89,"methodName":"main","nativeMethod":false}]}

2024-02-06 01:55:54.847: AbstractParser.DEBUG: GET/parseResponse  endTime = 1707198954845;  duration = 56
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

2024-02-06 01:55:54.848: APIJSONFunctionParser.ERROR: 
远程函数文档测试未通过!
请新增 demo 里的函数,或修改 Function 表里的 demo 为已有的函数示例!
保证前端看到的远程函数文档是正确的!!!

原因:
字符 getMethodDefination(method,arguments,type,exceptions,language) 对应的远程函数 getMethodDefination(JSONObject request, String method, String arguments, String type, String exceptions, String language) 不在后端 apijson.demo.DemoFunctionParser 内,也不在父类中!如果需要则先新增对应方法!
请检查函数名和参数数量是否与已定义的函数一致!
且必须为 function(key0,key1,...) 这种单函数格式!
function 必须符合 Java 函数命名,key 是用于在 curObj 内取值的键!
调用时不要有空格!apijson.demo.DemoFunctionParser.getMethodDefination(com.alibaba.fastjson.JSONObject,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)

Process finished with exit code 1

Expected Behavior/期望结果

macOS新安装的运行的APIJSONBoot,数据库是MySQL8.0.19,启动报错:请检查函数名和参数数量是否与已定义的函数一致!,这个问题该如何解决?

Any additional comments?/其它补充说明?

No response

TommyLemon commented 9 months ago

issue 中搜下 getMethodDefination