cloudwego / cwgo

An all-in-one code generation tool for CloudWeGo
Apache License 2.0
102 stars 52 forks source link

cwgo 生成 handler 代码 #189

Closed darrenxyue closed 4 months ago

darrenxyue commented 4 months ago

这个错误码没有很好的遵循 HTTP status & RESTful API 规范,正常来说 client 侧不符合预期应该是 4xx 错误吗、服务端处理错误为 5xx,这里可以修改下吗?

image
li-jin-gou commented 4 months ago

使用自定义模版吧自己实现一个模版吧,现在这个模版修改了可能对用户造成影响,有风险。

darrenxyue commented 4 months ago

猜到会这么回答了,算了,还是用 gin 吧

li-jin-gou commented 4 months ago

其实如果你用 gin 没有脚手架的话,和纯用 hertz 的框架没啥区别,区别就在脚手架上。

li-jin-gou commented 3 months ago

@darrenxyue 新增了一个 V2 模版。https://github.com/yuxialuozi/standard_v2/blob/main/biz/handler/hello3/hello_service.go#L20