修改商城逻辑

This commit is contained in:
2025-08-28 09:14:56 +08:00
parent a1944a573e
commit 691789d5d3
28 changed files with 10842 additions and 292 deletions

41
swagger.js Normal file
View File

@@ -0,0 +1,41 @@
const swaggerJsdoc = require('swagger-jsdoc');
// Swagger定义
const options = {
definition: {
openapi: '3.0.0',
info: {
title: '融豆商城 API',
version: '1.0.0',
description: '融豆商城后端API文档',
contact: {
name: '技术支持',
email: 'support@example.com'
},
},
servers: [
{
url: '/api',
description: 'API服务器'
}
],
components: {
securitySchemes: {
bearerAuth: {
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT'
}
}
},
security: [{
bearerAuth: []
}]
},
// API文档扫描路径
apis: ['./routes/*.js', './admin/routes/*.js'],
};
const specs = swaggerJsdoc(options);
module.exports = specs;