fix(user/ai-service): fix GET /users/kyc route conflict + add passport-jwt to ai-service
This commit is contained in:
parent
8fdc4e9365
commit
e9e875ac07
|
|
@ -17,6 +17,9 @@
|
|||
"@nestjs/config": "^3.1.0",
|
||||
"@nestjs/passport": "^10.0.3",
|
||||
"@nestjs/jwt": "^10.2.0",
|
||||
"passport": "^0.7.0",
|
||||
"passport-jwt": "^4.0.1",
|
||||
"@types/passport-jwt": "^4.0.1",
|
||||
"@nestjs/swagger": "^7.2.0",
|
||||
"@nestjs/throttler": "^5.1.0",
|
||||
"typeorm": "^0.3.19",
|
||||
|
|
|
|||
|
|
@ -2,13 +2,17 @@ import { Controller, Get, Put, Body, Param, Query, UseGuards, Req } from '@nestj
|
|||
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { UserProfileService } from '../../../application/services/user-profile.service';
|
||||
import { KycService } from '../../../application/services/kyc.service';
|
||||
import { UpdateProfileDto } from '../dto/update-profile.dto';
|
||||
import { UpdateSettingsDto } from '../dto/update-settings.dto';
|
||||
|
||||
@ApiTags('Users')
|
||||
@Controller('users')
|
||||
export class UserController {
|
||||
constructor(private readonly profileService: UserProfileService) {}
|
||||
constructor(
|
||||
private readonly profileService: UserProfileService,
|
||||
private readonly kycService: KycService,
|
||||
) {}
|
||||
|
||||
@Get('me')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
|
|
@ -46,6 +50,15 @@ export class UserController {
|
|||
return { code: 0, data: settings };
|
||||
}
|
||||
|
||||
@Get('kyc')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Get KYC status (alias to avoid :id route conflict)' })
|
||||
async getKycStatus(@Req() req: any) {
|
||||
const result = await this.kycService.getKycStatus(req.user.id);
|
||||
return { code: 0, data: result };
|
||||
}
|
||||
|
||||
@Get('payment-methods')
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
@ApiBearerAuth()
|
||||
|
|
|
|||
Loading…
Reference in New Issue