refazendo o order service

This commit is contained in:
unknown
2025-03-30 20:02:24 -03:00
parent 32bd7c14b3
commit 2fd5ae2b1f
13 changed files with 735 additions and 849 deletions

View File

@@ -0,0 +1,22 @@
// common/interceptors/response.interceptor.ts
import {
CallHandler,
ExecutionContext,
Injectable,
NestInterceptor,
} from '@nestjs/common';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ResultModel } from '../shared/ResultModel';
@Injectable()
export class ResponseInterceptor<T> implements NestInterceptor<T, ResultModel<T>> {
intercept(context: ExecutionContext, next: CallHandler<T>): Observable<ResultModel<T>> {
return next.handle().pipe(
map((data) => {
return ResultModel.success(data);
}),
);
}
}