Commit 7d8dc2d0 authored by nanahira's avatar nanahira

excep

parent 76ff78bc
Pipeline #4090 passed with stages
in 1 minute and 47 seconds
import { ApiProperty } from '@nestjs/swagger';
import { HttpException } from '@nestjs/common';
export class BlankReturnMessageDto {
@ApiProperty({ description: '返回状态' })
......@@ -12,6 +13,10 @@ export class BlankReturnMessageDto {
this.message = message || 'success';
this.success = statusCode < 400;
}
toException() {
return new HttpException(this, this.statusCode);
}
}
export class ReturnMessageDto<T> extends BlankReturnMessageDto {
......
import { ApiProperty } from '@nestjs/swagger';
import { HttpException } from '@nestjs/common';
export class BlankReturnMessageDto {
@ApiProperty({ description: '返回状态' })
......@@ -12,6 +13,10 @@ export class BlankReturnMessageDto {
this.message = message || 'success';
this.success = statusCode < 400;
}
toException() {
return new HttpException(this, this.statusCode);
}
}
export class ReturnMessageDto<T> extends BlankReturnMessageDto {
......
import { ApiProperty } from '@nestjs/swagger';
import { HttpException } from '@nestjs/common';
export class BlankReturnMessageDto {
@ApiProperty({ description: '返回状态' })
......@@ -12,6 +13,10 @@ export class BlankReturnMessageDto {
this.message = message || 'success';
this.success = statusCode < 400;
}
toException() {
return new HttpException(this, this.statusCode);
}
}
export class ReturnMessageDto<T> extends BlankReturnMessageDto {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment