fix: 统一响应补 hint 字段(对齐 api-contract)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
liuyun 2026-10-21 15:00:25 +08:00
parent bbf87b2805
commit 497dbcc903
2 changed files with 2 additions and 1 deletions

View File

@ -58,6 +58,7 @@ export class AllExceptionsFilter implements ExceptionFilter {
code: code ?? status * 100,
message,
data: null,
hint: null,
});
}
}

View File

@ -20,6 +20,6 @@ function toUnixMs(value: unknown): unknown {
@Injectable()
export class TransformInterceptor<T> implements NestInterceptor<T, unknown> {
intercept(_context: ExecutionContext, next: CallHandler<T>): Observable<unknown> {
return next.handle().pipe(map((data) => ({ code: 0, message: 'ok', data: toUnixMs(data ?? null) })));
return next.handle().pipe(map((data) => ({ code: 0, message: 'ok', data: toUnixMs(data ?? null), hint: null })));
}
}