Well done. https://github.com/wg/wrk
El jue, 14 ene 2021 a las 20:20, Xiangdong Huang (<[email protected]>) escribió: > Hi, > Glad to say I finally finish generating restful code of Go and Java using > open API (well, took me about 2 weeks to learn openapi and go). > > When developing a restful framework, we have to write many trivial codes > (that will be also written in almost all restful services). So, generating > such codes is a good solution as we just need to develop real logic and do > not need to care to maintain the generated codes. > > PR[1] defines several restful APIs for serving Grafana and Prometheus, and > uses openapi-generator to generate the source codes of the restful > framework in Go and Java. (The generator can also generate client-sdk, but > I have not time to try it and we have no requirements). > > So, just run `mvn generate-sources` in `openapi`' module, and then develop > your logic in > > `openapi/java-rest/src/main/java/org/apache/iotdb/openapi/gen/handler/impl/V1ApiServiceImpl.java` > (for java) and`openapi/go-rest/src/iotdbrestimpl/api_service_impl.go` (for > Go). > > The only 3 things should to know are, > > 1. current openapi-generator has some bug for go-server codes, (I have > reported the bug to openapi-generator project), and I have written how to > fix it manually in go-rest/README.md > > 2. current openapi-generator can not generate java codes using native > Netty. But it seems developing such a generator is not easy for > openapi-generator. > > 3. I copy some generated codes to src folder. > > The author of PR #2400 [3] can consider using the generated Go-server > codes. (or, do some experiments to check whether the generated codes have > an acceptable performance). > > [1] https://github.com/apache/iotdb/pull/2497 > > [2] https://github.com/OpenAPITools/openapi-generator/issues/8448 > > [3] https://github.com/apache/iotdb/pull/2400 > > > Best, > ----------------------------------- > Xiangdong Huang > School of Software, Tsinghua University > > 黄向东 > 清华大学 软件学院 > -- Life is a chess game - Anonymous.
