/** * @swagger * tags: * name: 验证码 * description: 验证码生成和验证相关接口 */ /** * @swagger * /captcha/generate: * get: * summary: 生成图形验证码 * tags: [验证码] * responses: * 200: * description: 生成成功 * content: * application/json: * schema: * type: object * properties: * success: * type: boolean * example: true * data: * type: object * properties: * captchaId: * type: string * description: 验证码唯一标识 * captchaImage: * type: string * description: SVG格式的验证码图片 * 500: * description: 服务器错误 */ /** * @swagger * /captcha/verify: * post: * summary: 验证图形验证码 * tags: [验证码] * requestBody: * required: true * content: * application/json: * schema: * type: object * required: * - captchaId * - captchaText * properties: * captchaId: * type: string * description: 验证码唯一标识 * captchaText: * type: string * description: 用户输入的验证码文本 * responses: * 200: * description: 验证成功 * content: * application/json: * schema: * type: object * properties: * success: * type: boolean * example: true * message: * type: string * example: "验证码验证成功" * 400: * description: 验证失败 * content: * application/json: * schema: * type: object * properties: * success: * type: boolean * example: false * message: * type: string * examples: * invalid_params: * value: "验证码ID和文本不能为空" * not_found: * value: "验证码不存在或已过期" * incorrect: * value: "验证码错误" * 500: * description: 服务器错误 */