xinli/z_Project change/进度汇总/0-代码生成器使用说明.md
2025-11-12 15:25:47 +08:00

57 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 代码生成器使用说明
## 说明
若依框架提供了强大的代码生成器功能可以自动生成完整的CRUD代码。
## 重要提示
⚠️ **本项目第一阶段采用手动编码方式**,不依赖代码生成器。
已手动创建的代码包括:
- 实体类PsyScale等5个
- Mapper层4个接口+XML
- Service层接口+实现)
- Controller层
- 前端页面Vue组件
手动代码的优势:
- ✅ 代码更灵活,可定制
- ✅ 避免模板编码问题
- ✅ 更符合项目实际需求
## 如何使用代码生成器(参考)
如果后续需要为其他表生成代码:
### 1. 配置生成器
修改 `ry-news-generator/src/main/resources/generator.yml`
```yaml
gen:
author: ddnai
packageName: com.ddnai.system.psychology
autoRemovePre: false
tablePrefix: sys_,ddn_,psy_
allowOverwrite: true
```
### 2. 使用步骤
1. 登录系统
2. 进入:系统工具 → 代码生成
3. 点击"导入"选择数据表
4. 配置生成信息
5. 点击"生成"下载代码
### 3. 注意事项
- 生成器模板可能存在编码问题
- 建议使用下载方式,然后手动调整
- 包路径需要与现有代码保持一致
## 建议
**保持手动编码方式**后续开发可参考现有PsyScale模块的代码结构。