Files
autoAiWorkSys/config/custom.schemas.js
张成 5d7444cd65 1
2025-11-24 13:23:42 +08:00

113 lines
2.1 KiB
JavaScript
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.
/**
* Swagger自定义Schema定义
* 用于生成API文档的数据模型定义
*/
module.exports = {
// 通用响应格式
ApiResponse: {
type: 'object',
properties: {
code: {
type: 'integer',
description: '状态码200表示成功',
example: 200
},
message: {
type: 'string',
description: '响应消息',
example: '操作成功'
},
data: {
type: 'object',
description: '响应数据'
}
}
},
// 分页响应格式
PageResponse: {
type: 'object',
properties: {
code: {
type: 'integer',
example: 200
},
message: {
type: 'string',
example: '查询成功'
},
data: {
type: 'object',
properties: {
total: {
type: 'integer',
description: '总记录数'
},
pageSize: {
type: 'integer',
description: '每页记录数'
},
currentPage: {
type: 'integer',
description: '当前页码'
},
list: {
type: 'array',
items: {
type: 'object'
},
description: '数据列表'
}
}
}
}
},
// 登录请求
LoginRequest: {
type: 'object',
required: ['username', 'password'],
properties: {
username: {
type: 'string',
description: '用户名',
example: 'admin'
},
password: {
type: 'string',
description: '密码',
example: '123456'
}
}
},
// 登录响应
LoginResponse: {
type: 'object',
properties: {
code: {
type: 'integer',
example: 200
},
message: {
type: 'string',
example: '登录成功'
},
data: {
type: 'object',
properties: {
token: {
type: 'string',
description: 'JWT Token'
},
userInfo: {
type: 'object',
description: '用户信息'
}
}
}
}
}
};