JiShe.IOT.UI/.cursor/rules/api-client-readonly.mdc

12 lines
923 B
Plaintext
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.

---
description: 禁止手改 api-client更新接口仅允许 pnpm nswag 生成
alwaysApply: true
---
# api-client 目录只读
- **不得**编辑、删除或新增 `apps/web-antd/src/api-client/` 下的任何文件(含 `services.gen.ts`、`types.gen.ts`、`schemas.gen.ts`、`index.ts` 等)。
- 该目录为根据 OpenAPI 生成的客户端,手改会在下次生成时被覆盖,且易与后端契约不一致。
- **更新接口定义、类型与服务方法时,只允许**在 `apps/web-antd` 包内执行 **`pnpm nswag`**(脚本见该包 `package.json`,使用 `openapi-ts` 与 `src/api-client-config/config.ts`)重新生成 `api-client`**禁止**用其它命令或手工合并覆盖生成结果。
- 若仅需调整调用方式、拦截器或业务封装,请在 `apps/web-antd/src/api-client-config/`、`apps/web-antd/src/api/` 或具体业务模块中实现,不要改 `api-client` 目录。