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
67d4a95b
Commit
67d4a95b
authored
Jan 16, 2025
by
mingyard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修改swagger
parent
479bfe16
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
translateImageReq.dto.ts
src/controller/translate/dto/req/translateImageReq.dto.ts
+3
-2
translate.controller.ts
src/controller/translate/translate.controller.ts
+7
-1
No files found.
src/controller/translate/dto/req/translateImageReq.dto.ts
View file @
67d4a95b
...
...
@@ -5,14 +5,15 @@ import {
import
{
ApiProperty
}
from
'@nestjs/swagger'
;
import
{
Expose
}
from
'class-transformer'
;
import
{
IsEnum
,
IsNotEmpty
}
from
'class-validator'
;
import
{
Multer
}
from
'multer'
;
export
class
TranslateImageReqDto
{
@
ApiProperty
({
description
:
'要翻译的图片文件'
,
type
:
'string'
,
format
:
'binary'
,
example
:
'图片文件'
,
})
file
:
any
;
file
:
Multer
.
File
;
@
ApiProperty
({
description
:
'目标语言'
,
...
...
src/controller/translate/translate.controller.ts
View file @
67d4a95b
...
...
@@ -10,7 +10,12 @@ import {
}
from
'@nestjs/common'
;
import
{
TranslateService
}
from
'./translate.service'
;
import
{
Auth
}
from
'@/common/decorators/auth.decorator'
;
import
{
ApiTags
,
ApiOperation
,
ApiResponse
}
from
'@nestjs/swagger'
;
import
{
ApiTags
,
ApiOperation
,
ApiResponse
,
ApiConsumes
,
}
from
'@nestjs/swagger'
;
import
{
TranslateReqDto
}
from
'./dto/req/translateReq.dto'
;
import
{
TranslateResDto
}
from
'./dto/res/translateRes.dto'
;
import
{
FileInterceptor
}
from
'@nestjs/platform-express'
;
...
...
@@ -97,6 +102,7 @@ export class TranslateController {
// 翻译图片
@
Post
(
'image'
)
@
ApiOperation
({
summary
:
'翻译图片'
})
@
ApiConsumes
(
'multipart/form-data'
)
@
ApiResponse
({
status
:
200
,
description
:
'成功返回翻译结果'
,
...
...
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