import { Controller } from '@nestjs/common' import { GrpcMethod } from '@nestjs/microservices' import type { RefreshRequest, RefreshResponse, SendOtpRequest, SendOtpResponse, VerifyOtpRequest, VerifyOtpResponse } from '@teacinema/contracts/gen/ts/auth' import { AuthService } from './auth.service' @Controller() export class AuthController { constructor(private readonly authService: AuthService) {} @GrpcMethod('AuthService', 'SendOtp') public sendOtp(data: SendOtpRequest): Promise { return this.authService.sendOtp(data) } @GrpcMethod('AuthService', 'VerifyOtp') public VerifyOtp(data: VerifyOtpRequest): Promise { return this.authService.verifyOtp(data) } @GrpcMethod('AuthService', 'Refresh') public refresh(data: RefreshRequest): RefreshResponse { return this.authService.refresh(data) } }