This commit is contained in:
xiaopeng 2025-02-09 23:50:09 +08:00
parent 2fcc7cdb39
commit 138311f24d
3 changed files with 15 additions and 4 deletions

View File

@ -137,6 +137,7 @@ export class AppDemoGoodsController extends BaseController {
| ------------------ | -------- | ------------------------------------------------------------- | ---- |
| prefix | String | 手动设置路由前缀 | |
| api | Array | 快速 API 接口可选`add` `delete` `update` `info` `list` `page` | |
| serviceApis | Array | 将 service 方法注册为 api通过 post 请求,直接调用 service 方法 | |
| pageQueryOp | QueryOp | 分页查询设置 | |
| listQueryOp | QueryOp | 列表查询设置 | |
| insertParam | Function | 请求插入参数,如新增的时候需要插入当前登录用户的 ID | |
@ -152,6 +153,7 @@ export class AppDemoGoodsController extends BaseController {
| where | Function | 其他查询条件 | |
| select | Array | 选择查询字段 | |
| fieldEq | Array | 筛选字段,字符串数组或者对象数组{ column: string, requestParam: string },如 type=1 | |
| fieldLike | Array | 模糊查询字段,字符串数组或者对象数组{ column: string, requestParam: string },如 title | |
| addOrderBy | Object | 排序 | |
| join | JoinOp[] | 关联表查询 | |
@ -214,6 +216,10 @@ import { DemoAppGoodsEntity } from "../../entity/goods";
fieldEq: ["type"],
// 多表关联,请求筛选字段与表字段不一致的情况
fieldEq: [{ column: "a.id", requestParam: "id" }],
// 让title字段支持模糊查询请求参数为title
fieldLike: ['a.title'],
// 让title字段支持模糊查询请求筛选字段与表字段不一致的情况
fieldLike: [{ column: "a.title", requestParam: "title" }],
// 指定返回字段,注意多表查询这个是必要的,否则会出现重复字段的问题
select: ["a.*", "b.name", "a.name AS userName"],
// 4.x置为过时 改用 join 关联表用户表

View File

@ -41,7 +41,8 @@
- `@midwayjs/decorator`,已弃用,使用`@midwayjs/core`
- 不要使用自定义sql来操作数据库而是使用typeorm的api统计相关的可以考虑使用原生sql
- Controller中不允许重写`add`、`delete`、`update`、`info`、`list`、`page`方法
- Controller的关联查询一般写在pageQueryOp中必要时需要创建关联查询
- Controller不需要加@Provide()注解
- page接口关联表查询一般写在Controller的pageQueryOp中尽量不要使用自定义sql
- Entity字段使用驼峰命名studentNo
- Entity不允许使用@ManyToOne、@OneToMany等外键关系
- Entity的BaseEntity引用固定为`import { BaseEntity } from '../../base/entity/base';`,禁止修改层级

View File

@ -12,12 +12,16 @@
## 特性
Ai时代很多老旧的框架已经无法满足现代化的开发需求Cool-Admin开发了一系列的功能让开发变得更简单、更快速、更高效。
Ai 时代很多老旧的框架已经无法满足现代化的开发需求Cool-Admin 开发了一系列的功能,让开发变得更简单、更快速、更高效。
- **Ai编码**通过微调大模型学习框架特有写法实现简单功能从Api接口到前端页面的一键生成
- **流程编排**:通过拖拽编排方式,即可实现类似像智能客服这样的功能
- **Ai 编码**:通过微调大模型学习框架特有写法,实现简单功能从 Api 接口到前端页面的一键生成[详情](https://node.cool-admin.com/src/guide/ai.html)
- **流程编排**:通过拖拽编排方式,即可实现类似像智能客服这样的功能[详情](https://node.cool-admin.com/src/guide/flow.html)
- **多租户**:支持多租户,采用全局动态注入查询条件[详情](https://node.cool-admin.com/src/guide/core/tenant.html)
- **多语言**:基于大模型自动翻译,无需更改原有代码[详情](https://node.cool-admin.com/src/guide/core/i18n.html)
- **原生打包**:打包成 exe 等安装包,打包完可以直接运行在 windows、mac、linux 等操作系统上[详情](https://node.cool-admin.com/src/guide/core/pkg.html)
- **模块化**:代码是模块化的,清晰明了,方便维护
- **插件化**:插件化的设计,可以通过安装插件的方式扩展如:支付、短信、邮件等功能
- ......
![](https://cool-show.oss-cn-shanghai.aliyuncs.com/admin/flow.png)