import { createParamDecorator, ExecutionContext } from '@nestjs/common';
import { PageInfoEntity } from '../entities/page-info.entity';

export const PageInfo = createParamDecorator(
  (data: unknown, ctx: ExecutionContext) => {
    return new PageInfoEntity(ctx.switchToHttp().getRequest().query);
  },
);
