portal icon indicating copy to clipboard operation
portal copied to clipboard

go-zero official documentation

Results 11 portal issues
Sort by recently updated
recently updated
newest added

增加数据转换用法

need more discussion

由于修改生成代码模板来修改返回数据格式的方法需要考虑goctl版本问题,而且不能自定义code和msg内容,所以研究了一下,可以在logic层使用response方法来统一格式的body响应。

严格来说,是model生成模块这里,有问题,原本插件自动生成的代码是usermodel_gen.go下面FindOneByNumber方法的这一行是query := fmt.Sprintf("select %s from %s where `number` = ? limit 1", userRows, m.table),但是少加了一个number。query := fmt.Sprintf("select %s from %s where `number` = ? limit 1", userRows, m.table,number)

在最新1.4.0版本中,使用中发现生成的代码中增加了${domain}client的包(这里是userclient包),相应的客户端代码也移到了这个包,这与原文描述不符

同步最新的代码

Corrected the styling of YAML configuration examples in the logging tutorial document. This ensures that users can properly set up their logging based on accurate configuration samples. File changed: docs/tutorials/log/log.md

原文为 [在 api 描述语言中,我们规定将所有 service 语法块声明的 HTTP 服务信息都放在 main api文件中,抽象结构体放在其他 api 文件中,然后在 main api 文件中引入其他 api 文件,这样可以让 main api 文件更加简洁,易于维护,而被引入的 api 文件中不允许出现 service 语法块,否则会报错。](https://github.com/zeromicro/portal/blob/feat/v3/docs/tutorials/api/import.md) 但是实际上,被引入的api文件中可以出现service 语法块,并不会在goctl时报错,**但是不能出现新命名的service语法块**。