mirror of
https://git.oceanpay.cc/danial/kami_apple_exchage.git
synced 2025-12-18 22:29:09 +00:00
- 新增 CODEBUDDY.md、GEMINI.md、GEMINI_CN.md 等项目文档 - 更新 Dockerfile 和其他配置文件 - 优化部分代码结构,如 orders.py、tasks.py 等 - 新增 .dockerignore 文件
69 lines
1.7 KiB
TypeScript
69 lines
1.7 KiB
TypeScript
const orvalConfig = {
|
||
// 爬虫监控系统 API 配置
|
||
petstore: {
|
||
prettier: true,
|
||
output: {
|
||
mode: "tags",
|
||
target: "src/lib/api/generated/endpoints",
|
||
schemas: "src/lib/api/generated/schemas",
|
||
client: "react-query",
|
||
fileExtension: '.gen.ts',
|
||
mock: false,
|
||
clean: true, // 每次生成前清理目标目录
|
||
|
||
override: {
|
||
mutator: {
|
||
path: "src/lib/api/enhanced-axios-client.ts",
|
||
name: "axiosClient",
|
||
},
|
||
|
||
// 全局 Query 配置
|
||
query: {
|
||
useQuery: true,
|
||
useMutation: true,
|
||
useInfiniteQuery: false, // 项目暂不需要无限查询
|
||
signal: true, // 支持 AbortController
|
||
shouldExportMutatorHooks: true,
|
||
shouldExportHttpClient: false,
|
||
},
|
||
|
||
// 忽略特定操作(备用)
|
||
operations: {},
|
||
|
||
// 自定义 Hook 命名规则
|
||
requestOptions: {
|
||
second: true, // 支持第二个参数作为选项
|
||
},
|
||
|
||
// 响应类型优化
|
||
mock: {
|
||
type: 'msw', // 使用 MSW 进行 mock(如果需要)
|
||
delay: false,
|
||
},
|
||
},
|
||
},
|
||
|
||
hooks: {
|
||
// 生成前的预处理
|
||
beforeAllFilesWrite: [
|
||
"echo '🚀 开始生成 API 客户端代码...'",
|
||
],
|
||
// 生成后的后处理
|
||
afterAllFilesWrite: [
|
||
"prettier --write src/lib/api/generated/**/*.ts",
|
||
"echo '✅ API 客户端代码生成完成!'",
|
||
"echo '📁 生成位置: src/lib/api/generated/'",
|
||
],
|
||
},
|
||
|
||
input: {
|
||
target: "http://localhost:8000/openapi.json",
|
||
filters: {
|
||
mode: 'exclude',
|
||
tags: ['Health Check'],
|
||
},
|
||
},
|
||
},
|
||
};
|
||
|
||
export default orvalConfig; |