// src/decorators/real-ip.decorator.ts
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
import { getRealIpInfo, RealIpInfo } from '../utils/ip.util';

export const RealIp = createParamDecorator((data: unknown, ctx: ExecutionContext): RealIpInfo => {
  const request = ctx.switchToHttp().getRequest();
  return getRealIpInfo(request);
});
