|
|
@@ -0,0 +1,18 @@
|
|
|
+# mvc层级
|
|
|
+- Controller 不要直接调用 mapper 里面的方法
|
|
|
+
|
|
|
+# mybatis-plus
|
|
|
+- mybatis 的联表sql,不要写在*mapper.java 文件中;
|
|
|
+- 如果只查单个表的方法,使用 mybatis-plus 在 mapper.java 文件中用default关键字方法去实现
|
|
|
+- 复杂的查询,你可以直接在 mapper.xml 文件写联表 sql,避免在 service多次调用mapper查询
|
|
|
+
|
|
|
+# swagger及po注释
|
|
|
+- When Swagger/OpenAPI annotations are present on classes, methods, fields, or parameters, do not add redundant code comments or JavaDoc that repeat the same meaning.
|
|
|
+- Prefer keeping only the annotations unless I explicitly ask for comments.
|
|
|
+
|
|
|
+# java 风格
|
|
|
+- 同一个 java 文件方法(仅限方法)之间的调用,加上 this
|
|
|
+- po 的组装,要帮我放在 assembler.java文件中,而非放在 service层
|
|
|
+- 一些po 转 dto 的代码,在 dto 中创建一个名为 of 的 static 方法实现
|
|
|
+- 数据的 setter 方法尽量不要在 *service.java 里面调用
|
|
|
+- 一个方法,代码行数不要超过 50
|