签入版本
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
# 3.10 完整代码清单
|
||||
|
||||
:::tip 概述
|
||||
本节汇总 example(案例演示)模块涉及的所有文件,方便开发时快速定位。
|
||||
:::
|
||||
|
||||
## 后端文件清单
|
||||
|
||||
| 文件路径 | 说明 | 核心内容 |
|
||||
|----------|------|----------|
|
||||
| `app/model/Example.php` | 数据模型 | 继承 BaseModel,声明表名 `example` |
|
||||
| `app/validate/ExampleValidate.php` | 验证器 | name 字段必填,add/update 场景 |
|
||||
| `app/logic/ExampleLogic.php` | 业务逻辑 | 属性配置 + import/export 方法 |
|
||||
| `app/controller/ExampleController.php` | 控制器 | 9 个接口(page/list/detail/add/update/delete/batchDelete/import/export) |
|
||||
| `route/app.php` | 路由 | 第 371~383 行,9 条路由 |
|
||||
|
||||
## 前端文件清单
|
||||
|
||||
| 文件路径 | 说明 |
|
||||
|----------|------|
|
||||
| `ui/src/api/tool/example.ts` | API 接口模块(9 个函数) |
|
||||
| `ui/src/views/tool/example/index.vue` | 列表页 |
|
||||
| `ui/src/views/tool/example/edit.vue` | 新增/编辑弹窗 |
|
||||
| `ui/src/views/tool/example/detail.vue` | 详情弹窗 |
|
||||
| `ui/src/views/tool/example/columns.ts` | 表格列配置 |
|
||||
| `ui/src/views/tool/example/querySchemas.ts` | 查询条件配置 |
|
||||
|
||||
## 数据库
|
||||
|
||||
| 对象 | 说明 |
|
||||
|------|------|
|
||||
| `think_example` 表 | 案例演示数据表 |
|
||||
|
||||
## 权限节点
|
||||
|
||||
| 权限码 | 说明 |
|
||||
|--------|------|
|
||||
| `sys:example:page` | 案例演示分页列表 |
|
||||
| `sys:example:add` | 添加案例演示 |
|
||||
| `sys:example:update` | 修改案例演示 |
|
||||
| `sys:example:delete` | 删除案例演示 |
|
||||
| `sys:example:import` | 导入案例演示 |
|
||||
| `sys:example:export` | 导出案例演示 |
|
||||
|
||||
## 字典数据
|
||||
|
||||
| 字典编码 | 说明 | 字典项 |
|
||||
|---------|------|--------|
|
||||
| `example_type` | 案例类型 | 按实际配置 |
|
||||
| `example_status` | 案例状态 | 0=禁用, 1=启用 |
|
||||
|
||||
## 代码生成器替代方案
|
||||
|
||||
example 模块本身就是代码生成器的参考模板。如果需要生成类似模块:
|
||||
|
||||
1. 建好数据库表
|
||||
2. 访问代码生成器页面
|
||||
3. 选择表,点击生成
|
||||
4. 自动创建 Controller / Logic / Model / Validate / 前端文件
|
||||
Reference in New Issue
Block a user