j2go / apijson-go Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
从某个版本的 Chrome 开始(好像是 87), Access-Allow-Origin 不能为 "*",需要改为访问该接口的 Origin
https://github.com/j2go/apijson-go/blob/main/handler/handler.go#L47
Document 存的是 HTTP API 接口相关信息,name 表示接口名
https://github.com/j2go/apijson-go/blob/main/test.http#L17
可以把条件改为
"id{}": ">1"
建议用 orderedmap 替代 Go 本身的 map
https://github.com/iancoleman/orderedmap
这是 Go 与 macOS 兼容问题导致,能支持比 1.16 更低的 Go 版本吗?
pocoproject/poco#1453
https://stackoverflow.com/questions/39544703/getting-error-dyld-symbol-not-found-clock-gettime
Windows 10 上最新版 GoLand 可以正常编译和运行,用 test.http 内的示例测试功能正常。
改了代码后也支持 APIAuto 直接测试
type TableObject struct {
}
Log.DEBUG = true 时返回
http://apijson.cn/api/?type=JSON&json={"User":{"ids": 82001},"[]":{"Comment":{"userId@":"User%2Fid"}}}
这个字段仅仅用来查看错误栈信息,不用来解析,所以数组内格式不需要和 Java 一致,内部简单地使用字符串即可,例如
"trace:stack": [
"sun.reflect.NativeConstructorAccessorImpl",
"apijson.orm.AbstractParser"
]
执行示例:
`
POST 127.0.0.1:8080/get
Content-Type: application/json
{
"Document": {
"id{}": ">1"
}
}
终端输出
2022/06/08 14:01:16 Debug Document -> parse id{} >1
2022/06/08 14:01:16 Debug parse Document: &{ctx:0xc000030b80 start:1654668076502673478 depth:0 running:false completed:false isList:false page: count: sqlExecutor:0xc00016ea20 primaryKey: relateKV:map[] Key:Document Path:Document RequestMap:map[id{}:>1] CurrentData:map[] ResultList:[] children:map[]}
2022/06/08 14:01:16 Debug exec SELECT * FROM Document WHERE id{}=? LIMIT 1, params: [>1]
2022/06/08 14:01:16 http: superfluous response.WriteHeader call from github.com/j2go/apijson/handler.commonHandle (handler.go:41)
`
返回信息
`
{"code":200,"msg":"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{}=? LIMIT 1' at line 1","ok":true}
`
phpmyadmin查询Document 表有数据存在
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.