You need to sign in or sign up before continuing.
Commit 72371793 authored by mingyard's avatar mingyard

feat:控制返回字段

parent 29639ffa
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer'; import { Expose, Type } from 'class-transformer';
class CredentialsDto { class CredentialsDto {
@ApiProperty({ @ApiProperty({
...@@ -7,17 +7,20 @@ class CredentialsDto { ...@@ -7,17 +7,20 @@ class CredentialsDto {
example: example:
'7eRLMGMgdgO3dz3AT3FoFffZmSi4iaVaa772328643dbf876ce3b26670de0028ah9qYwLfndpoPilupmpzO4bEQYzKylSjiQe8JwhR4p88AEvzX2tOTYESaw9bAOLZwC9vytsGv0-e2Zun3TuPCHHYA0M8oxN1c6kKEW21071QK0Vi7XRErouyjx0HBBsVsE19JMAQqwm9CKziLyooOCWB_DqV0UkhGKJS4treZSXT3osKkqrokS61b52XxTQIh2HvdaoQy9UHob-TXMzDtkG24wJlpeMFttM4tvk3KOWBxp1gdinhKjZcFuxuqBRVAlrX5EO5jWslcZjNjnwKPphzGAoWMcAJkVacXnCpqWXPD7ghrJa-Y7VVuCBSU2By3XMG5Jp-W-hZAl-H0KUpeow', '7eRLMGMgdgO3dz3AT3FoFffZmSi4iaVaa772328643dbf876ce3b26670de0028ah9qYwLfndpoPilupmpzO4bEQYzKylSjiQe8JwhR4p88AEvzX2tOTYESaw9bAOLZwC9vytsGv0-e2Zun3TuPCHHYA0M8oxN1c6kKEW21071QK0Vi7XRErouyjx0HBBsVsE19JMAQqwm9CKziLyooOCWB_DqV0UkhGKJS4treZSXT3osKkqrokS61b52XxTQIh2HvdaoQy9UHob-TXMzDtkG24wJlpeMFttM4tvk3KOWBxp1gdinhKjZcFuxuqBRVAlrX5EO5jWslcZjNjnwKPphzGAoWMcAJkVacXnCpqWXPD7ghrJa-Y7VVuCBSU2By3XMG5Jp-W-hZAl-H0KUpeow',
}) })
@Expose()
Token: string; Token: string;
@ApiProperty({ @ApiProperty({
description: '临时凭证', description: '临时凭证',
example: example:
'AKIDotjS9M7qTbyk8AIZ3T8mnPXqX5MNVilKyFXe4H280hBPLyUEvTsT6_2TiCsbt5Bu', 'AKIDotjS9M7qTbyk8AIZ3T8mnPXqX5MNVilKyFXe4H280hBPLyUEvTsT6_2TiCsbt5Bu',
}) })
@Expose()
TmpSecretId: string; TmpSecretId: string;
@ApiProperty({ @ApiProperty({
description: '临时凭证', description: '临时凭证',
example: '0/PGctEjFv4lartXTmNCvi4hEn9vd1MBGG5HVdb2SWE=', example: '0/PGctEjFv4lartXTmNCvi4hEn9vd1MBGG5HVdb2SWE=',
}) })
@Expose()
TmpSecretKey: string; TmpSecretKey: string;
} }
...@@ -27,12 +30,14 @@ export class TxAsrResDto { ...@@ -27,12 +30,14 @@ export class TxAsrResDto {
type: Number, type: Number,
example: 1708249279, example: 1708249279,
}) })
@Expose()
ExpiredTime: number; ExpiredTime: number;
@ApiProperty({ @ApiProperty({
description: '过期时间', description: '过期时间',
type: String, type: String,
example: '2024-02-18T09:41:19Z', example: '2024-02-18T09:41:19Z',
}) })
@Expose()
Expiration: string; Expiration: string;
@ApiProperty({ @ApiProperty({
...@@ -46,6 +51,7 @@ export class TxAsrResDto { ...@@ -46,6 +51,7 @@ export class TxAsrResDto {
TmpSecretKey: '0/PGctEjFv4lartXTmNCvi4hEn9vd1MBGG5HVdb2SWE=', TmpSecretKey: '0/PGctEjFv4lartXTmNCvi4hEn9vd1MBGG5HVdb2SWE=',
}, },
}) })
@Expose()
@Type(() => CredentialsDto) @Type(() => CredentialsDto)
Credentials: CredentialsDto; Credentials: CredentialsDto;
......
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