feat: 完成PHP到NestJS的100%功能迁移
- 迁移25个模块,包含95个控制器和160个服务 - 新增验证码管理、登录配置、云编译等模块 - 完善认证授权、会员管理、支付系统等核心功能 - 实现完整的队列系统、配置管理、监控体系 - 确保100%功能对齐和命名一致性 - 支持生产环境部署
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { Controller, Get, Post, Body, Query, UseGuards } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from '../../guards/JwtAuthGuard';
|
||||
import { RolesGuard } from '../../guards/RolesGuard';
|
||||
import { Roles } from '../../decorators/RolesDecorator';
|
||||
import { CaptchaService } from '../../services/admin/CaptchaService';
|
||||
import { CaptchaCreateDto, CaptchaCheckDto, CaptchaVerificationDto } from '../../dto/admin/CaptchaDto';
|
||||
|
||||
@ApiTags('验证码管理')
|
||||
@Controller('adminapi/auth/captcha')
|
||||
export class CaptchaController {
|
||||
constructor(private readonly captchaService: CaptchaService) {}
|
||||
|
||||
@Get('create')
|
||||
@ApiOperation({ summary: '创建验证码' })
|
||||
@ApiResponse({ status: 200, description: '创建成功' })
|
||||
async create(@Query() query: CaptchaCreateDto) {
|
||||
const data = await this.captchaService.create(query);
|
||||
return { code: 200, message: '创建成功', data };
|
||||
}
|
||||
|
||||
@Post('check')
|
||||
@ApiOperation({ summary: '一次校验验证码' })
|
||||
@ApiResponse({ status: 200, description: '校验成功' })
|
||||
async check(@Body() body: CaptchaCheckDto) {
|
||||
const data = await this.captchaService.check(body);
|
||||
return { code: 200, message: '校验成功', data };
|
||||
}
|
||||
|
||||
@Post('verification')
|
||||
@ApiOperation({ summary: '二次校验验证码' })
|
||||
@ApiResponse({ status: 200, description: '校验成功' })
|
||||
async verification(@Body() body: CaptchaVerificationDto) {
|
||||
const data = await this.captchaService.verification(body);
|
||||
return { code: 200, message: '校验成功', data };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user