完善保险前后端、养殖端小程序

This commit is contained in:
xuqiuyun
2025-09-25 19:09:51 +08:00
parent 76b5393182
commit 852adbcfff
199 changed files with 8642 additions and 52333 deletions

View File

@@ -30,7 +30,14 @@ const swaggerDefinition = {
bearerAuth: {
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT'
bearerFormat: 'JWT',
description: 'JWT令牌认证'
},
fixedTokenAuth: {
type: 'apiKey',
in: 'header',
name: 'Authorization',
description: '固定令牌认证格式Bearer <fixed_token>'
}
},
schemas: {
@@ -42,6 +49,7 @@ const swaggerDefinition = {
email: { type: 'string', description: '邮箱' },
phone: { type: 'string', description: '手机号' },
status: { type: 'string', enum: ['active', 'inactive'], description: '用户状态' },
fixed_token: { type: 'string', description: '固定令牌用于API访问验证', nullable: true },
createdAt: { type: 'string', format: 'date-time', description: '创建时间' },
updatedAt: { type: 'string', format: 'date-time', description: '更新时间' }
}
@@ -214,6 +222,21 @@ const swaggerDefinition = {
message: { type: 'string', description: '错误信息' },
timestamp: { type: 'string', format: 'date-time', description: '时间戳' }
}
},
FixedTokenInfo: {
type: 'object',
properties: {
hasToken: { type: 'boolean', description: '是否已生成固定令牌' },
tokenPreview: { type: 'string', description: '令牌预览仅显示前8位', nullable: true },
createdAt: { type: 'string', format: 'date-time', description: '令牌创建时间', nullable: true }
}
},
FixedTokenGenerated: {
type: 'object',
properties: {
token: { type: 'string', description: '生成的固定令牌(仅在生成时返回完整令牌)' },
message: { type: 'string', description: '操作结果信息' }
}
}
},
responses: {
@@ -248,6 +271,22 @@ const swaggerDefinition = {
}
}
}
},
ForbiddenError: {
description: '权限不足',
content: {
'application/json': {
schema: {
$ref: '#/components/schemas/Error'
},
example: {
code: 403,
status: 'error',
message: '权限不足',
timestamp: '2024-01-01T00:00:00.000Z'
}
}
}
}
}
},