diff --git a/.cursor/rules/controller.mdc b/.cursor/rules/controller.mdc index 483c1cc..302c125 100644 --- a/.cursor/rules/controller.mdc +++ b/.cursor/rules/controller.mdc @@ -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 关联表用户表 diff --git a/.cursorrules b/.cursorrules index 736409e..ce26ca1 100644 --- a/.cursorrules +++ b/.cursorrules @@ -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';`,禁止修改层级 diff --git a/README.md b/README.md index 5cc42f1..e8d5a41 100644 --- a/README.md +++ b/README.md @@ -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)