docs/cli/gen-service #188
Replies: 5 comments 2 replies
-
|
internal/service 中自动生成的Register 函数 在internal/logic init 后,如何使用? |
Beta Was this translation helpful? Give feedback.
-
|
2.9不推荐这么用了么 |
Beta Was this translation helpful? Give feedback.
-
|
这种方式很奇怪,既不符合接口的使用原则,也不符合go的编码哲学,耍小聪明的做法绕过循环依赖,而不是反思项目的架构设计 |
Beta Was this translation helpful? Give feedback.
-
|
感觉确实不太规范呀,虽然可以避免为循环依赖伤脑筋,看似是加快了业务开发速度,但在我的实际开发中,产生了下面问题,用之前可以先看看能不能接受:
|
Beta Was this translation helpful? Give feedback.
-
|
有个问题,即使 logic下的结构体名称不含小写s开头,如: User struct{} 也会在service目录生成一个与之对应的接口文件。按照文档上说,应该不会生成才对呀? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
docs/cli/gen-service
在GoFrame框架中对业务逻辑进行封装管理,通过生成模块接口定义和注册代码来简化业务逻辑与接口分离的实现过程。通过逻辑与接口的结构化编码提高模块透明性,并避免循环依赖。提供手动与自动两种实现模式,适用于不同开发环境。
https://goframe.org/docs/cli/gen-service
Beta Was this translation helpful? Give feedback.
All reactions