docs/design/project-structure #24
Replies: 4 comments 1 reply
-
实际开发中常常纠结于controller与service的职责划分,也见识过很多别人设计的划分模式,比如所有逻辑都放service层controller仅作转发,或者在controller仅作转发,但service中再分出一个manager层。也有把绝大部分业务逻辑写在controller的,但可能一个controller方法数百行,一个controller类数千上万行。本章节提到的划分标准,是一个很有益的参考。需要特别强调的是,绝对不能在controller层跨层调用dao层,否则会留下难以处理的技术债。 |
Beta Was this translation helpful? Give feedback.
-
文中对model层的使用前后描述不一致~ |
Beta Was this translation helpful? Give feedback.
-
gf gen dao 是不是可以加一个参数选项 |
Beta Was this translation helpful? Give feedback.
-
“model 中的数据结构不应该直接暴露给外部使用”,但是举的例子里面api数据结构又直接引用了/model/entity里面的实体模型,这个前后矛盾,该如何理解 |
Beta Was this translation helpful? Give feedback.
-
docs/design/project-structure
工程目录设计是代码分层设计的进一步落地,建议您先仔细阅读: 代码分层设计
https://goframe.org/docs/design/project-structure
Beta Was this translation helpful? Give feedback.
All reactions