优化规则文件,优化文件删除日志记录
This commit is contained in:
@@ -117,7 +117,7 @@ xtools-app-{module}-biz/
|
||||
|
||||
#### 3.1 注解使用规范
|
||||
- 控制器类使用`@RestController`注解
|
||||
- 服务实现类使用`@Service`和`@Primary`注解
|
||||
- 服务实现类使用`@Service`注解;实现API接口时需添加`@Primary`注解
|
||||
- BaseService类使用`@Component`注解
|
||||
- Mapper接口使用`@Mapper`注解
|
||||
- 转换器接口使用`@Mapper(componentModel = "spring")`注解(MapStruct)
|
||||
@@ -129,7 +129,7 @@ xtools-app-{module}-biz/
|
||||
|
||||
#### 3.2 继承关系规范
|
||||
- BaseService类继承`ServiceImpl<Mapper, Entity>`(MyBatis Plus),使用`@Component`注解
|
||||
- ServiceImpl类实现Service接口,注入BaseService和Convert进行业务操作
|
||||
- ServiceImpl类实现Service接口,注入BaseService和Convert进行业务操作;实现API接口时需添加`@Primary`注解
|
||||
- Controller类通过构造器注入Service接口
|
||||
- API接口定义为Java interface,方法返回`Result<T>`
|
||||
- 实体类继承`BaseEntity`(来自`xtools.boot.api.model.entity.BaseEntity`)
|
||||
@@ -179,7 +179,7 @@ xtools-app-{module}-biz/
|
||||
- 主键策略统一使用`IdType.ASSIGN_ID`
|
||||
|
||||
#### 4.4 Mapper规范
|
||||
- Mapper接口继承`BaseMapper<Entity>`(MyBatis Plus)
|
||||
- Mapper接口按需继承`BaseMapper<Entity>`(MyBatis Plus),并非所有Mapper都需要继承
|
||||
- 使用`@Mapper`注解
|
||||
- 复杂查询使用MyBatis XML映射文件,放置在`resources/mapper/`目录下
|
||||
- XML中使用`LambdaQueryWrapper`或动态SQL(`<where>`、`<if>`、`<foreach>`)
|
||||
@@ -272,10 +272,10 @@ xtools-app-{module}-biz/
|
||||
|
||||
#### 8.2 代码生成检查清单
|
||||
- [ ] 实体类继承`BaseEntity`,使用`IdType.ASSIGN_ID`主键策略
|
||||
- [ ] Mapper继承`BaseMapper<Entity>`,使用`@Mapper`注解
|
||||
- [ ] 需要CRUD操作的Mapper继承`BaseMapper<Entity>`,使用`@Mapper`注解
|
||||
- [ ] BaseService继承`ServiceImpl<Mapper, Entity>`,使用`@Component`注解
|
||||
- [ ] Service接口定义返回`Result<T>`的完整CRUD方法
|
||||
- [ ] ServiceImpl使用`@Service`、`@Primary`、`@RequiredArgsConstructor`注解
|
||||
- [ ] ServiceImpl使用`@Service`、`@RequiredArgsConstructor`注解;实现API接口时需添加`@Primary`注解
|
||||
- [ ] Convert使用`@Mapper(componentModel = "spring")`注解
|
||||
- [ ] Controller使用`@RestController`、`@Tag`、`@Operation`注解
|
||||
- [ ] 所有DTO字段添加`@Schema`注解
|
||||
|
||||
Reference in New Issue
Block a user