Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
translation-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinmingyuan
translation-server
Commits
adb1da20
Commit
adb1da20
authored
Jan 11, 2025
by
mingyard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:tx token dto
parent
43a9976e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
2 deletions
+65
-2
auth.controller.ts
src/controller/auth/auth.controller.ts
+7
-2
txAsrRes.dto.ts
src/controller/auth/dto/res/txAsrRes.dto.ts
+58
-0
No files found.
src/controller/auth/auth.controller.ts
View file @
adb1da20
...
...
@@ -16,6 +16,7 @@ import { RegisterDto } from './dto/req/register.dto';
import
{
Auth
}
from
'@/common/decorators/auth.decorator'
;
import
{
ApiTags
,
ApiOperation
,
ApiResponse
}
from
'@nestjs/swagger'
;
import
{
LoginResDto
}
from
'./dto/res/loginRes.dto'
;
import
{
TxAsrResDto
}
from
'./dto/res/txAsrRes.dto'
;
@
ApiTags
(
'auth'
)
@
Controller
(
'auth'
)
...
...
@@ -76,10 +77,14 @@ export class AuthController {
// 获取ASR token
@
ApiOperation
({
summary
:
'获取ASR token'
})
@
ApiResponse
({
status
:
200
,
description
:
'获取ASR token成功'
})
@
ApiResponse
({
status
:
200
,
description
:
'获取ASR token成功'
,
type
:
TxAsrResDto
,
})
@
Auth
()
@
Post
(
'getAsrToken'
)
async
getAsrToken
():
Promise
<
any
>
{
async
getAsrToken
():
Promise
<
TxAsrResDto
>
{
return
await
this
.
authService
.
getTxAsrToken
();
}
}
src/controller/auth/dto/res/txAsrRes.dto.ts
0 → 100644
View file @
adb1da20
import
{
ApiProperty
}
from
'@nestjs/swagger'
;
import
{
Type
}
from
'class-transformer'
;
class
CredentialsDto
{
@
ApiProperty
({
description
:
'临时凭证'
,
example
:
'7eRLMGMgdgO3dz3AT3FoFffZmSi4iaVaa772328643dbf876ce3b26670de0028ah9qYwLfndpoPilupmpzO4bEQYzKylSjiQe8JwhR4p88AEvzX2tOTYESaw9bAOLZwC9vytsGv0-e2Zun3TuPCHHYA0M8oxN1c6kKEW21071QK0Vi7XRErouyjx0HBBsVsE19JMAQqwm9CKziLyooOCWB_DqV0UkhGKJS4treZSXT3osKkqrokS61b52XxTQIh2HvdaoQy9UHob-TXMzDtkG24wJlpeMFttM4tvk3KOWBxp1gdinhKjZcFuxuqBRVAlrX5EO5jWslcZjNjnwKPphzGAoWMcAJkVacXnCpqWXPD7ghrJa-Y7VVuCBSU2By3XMG5Jp-W-hZAl-H0KUpeow'
,
})
Token
:
string
;
@
ApiProperty
({
description
:
'临时凭证'
,
example
:
'AKIDotjS9M7qTbyk8AIZ3T8mnPXqX5MNVilKyFXe4H280hBPLyUEvTsT6_2TiCsbt5Bu'
,
})
TmpSecretId
:
string
;
@
ApiProperty
({
description
:
'临时凭证'
,
example
:
'0/PGctEjFv4lartXTmNCvi4hEn9vd1MBGG5HVdb2SWE='
,
})
TmpSecretKey
:
string
;
}
export
class
TxAsrResDto
{
@
ApiProperty
({
description
:
'过期时间'
,
type
:
Number
,
example
:
1708249279
,
})
ExpiredTime
:
number
;
@
ApiProperty
({
description
:
'过期时间'
,
type
:
String
,
example
:
'2024-02-18T09:41:19Z'
,
})
Expiration
:
string
;
@
ApiProperty
({
description
:
'临时凭证'
,
type
:
Object
,
example
:
{
Token
:
'7eRLMGMgdgO3dz3AT3FoFffZmSi4iaVaa772328643dbf876ce3b26670de0028ah9qYwLfndpoPilupmpzO4bEQYzKylSjiQe8JwhR4p88AEvzX2tOTYESaw9bAOLZwC9vytsGv0-e2Zun3TuPCHHYA0M8oxN1c6kKEW21071QK0Vi7XRErouyjx0HBBsVsE19JMAQqwm9CKziLyooOCWB_DqV0UkhGKJS4treZSXT3osKkqrokS61b52XxTQIh2HvdaoQy9UHob-TXMzDtkG24wJlpeMFttM4tvk3KOWBxp1gdinhKjZcFuxuqBRVAlrX5EO5jWslcZjNjnwKPphzGAoWMcAJkVacXnCpqWXPD7ghrJa-Y7VVuCBSU2By3XMG5Jp-W-hZAl-H0KUpeow'
,
TmpSecretId
:
'AKIDotjS9M7qTbyk8AIZ3T8mnPXqX5MNVilKyFXe4H280hBPLyUEvTsT6_2TiCsbt5Bu'
,
TmpSecretKey
:
'0/PGctEjFv4lartXTmNCvi4hEn9vd1MBGG5HVdb2SWE='
,
},
})
@
Type
(()
=>
CredentialsDto
)
Credentials
:
CredentialsDto
;
@
ApiProperty
({
description
:
'请求ID'
,
type
:
String
,
example
:
'425928a3-dc93-4f3e-8ad8-9713b1ee14dc'
,
})
RequestId
:
string
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment