Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-deckform-filler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-deckform-filler
Commits
3842efdd
Commit
3842efdd
authored
Oct 22, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
readme
parent
d57d031a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
9 deletions
+35
-9
README.md
README.md
+2
-2
src/app.controller.ts
src/app.controller.ts
+10
-2
src/dto/file-upload.dto.ts
src/dto/file-upload.dto.ts
+1
-0
src/dto/fill-options.dto.ts
src/dto/fill-options.dto.ts
+20
-3
src/main.ts
src/main.ts
+2
-2
No files found.
README.md
View file @
3842efdd
#
App name
#
ygopro-deckform-filler
App description.
上传 YGOPro YDK 卡组文件,生成可打印的卡组登记表 PDF。
## Installation
...
...
src/app.controller.ts
View file @
3842efdd
...
...
@@ -14,7 +14,7 @@ import {
import
{
FileInterceptor
}
from
'
@nestjs/platform-express
'
;
import
{
FileUploadDto
}
from
'
./dto/file-upload.dto
'
;
import
YGOProDeck
from
'
ygopro-deck-encode
'
;
import
{
DataQuery
}
from
'
nesties
'
;
import
{
ApiError
,
BlankReturnMessageDto
,
DataQuery
}
from
'
nesties
'
;
import
{
FillOptionsDto
}
from
'
./dto/fill-options.dto
'
;
@
Controller
()
...
...
@@ -34,11 +34,19 @@ export class AppController {
format
:
'
binary
'
,
},
})
@
ApiError
(
400
,
'
不是有效的 YDK 文件
'
)
@
ApiError
(
404
,
'
有卡片数据未找到
'
)
@
ApiError
(
500
,
'
服务器内部错误
'
)
async
fillDeckForm
(
@
UploadedFile
()
file
:
Express
.
Multer
.
File
,
@
DataQuery
()
dto
:
FillOptionsDto
,
)
{
const
ydk
=
YGOProDeck
.
fromYdkString
(
file
.
buffer
.
toString
(
'
utf-8
'
));
const
ydk
=
new
YGOProDeck
();
try
{
ydk
.
fromYdkString
(
file
.
buffer
.
toString
(
'
utf-8
'
));
}
catch
(
e
)
{
throw
new
BlankReturnMessageDto
(
400
,
'
Invalid YDK file
'
).
toException
();
}
return
this
.
appService
.
fillDeckForm
(
ydk
,
dto
);
}
}
src/dto/file-upload.dto.ts
View file @
3842efdd
...
...
@@ -4,6 +4,7 @@ export class FileUploadDto {
@
ApiProperty
({
type
:
'
string
'
,
format
:
'
binary
'
,
description
:
'
上传的 YGOPro YDK 卡组文件
'
,
})
file
:
string
;
}
src/dto/fill-options.dto.ts
View file @
3842efdd
import
{
IsDate
,
IsNotEmpty
,
IsOptional
,
IsString
}
from
'
class-validator
'
;
import
{
IsDateString
,
IsOptional
,
IsString
}
from
'
class-validator
'
;
import
{
ApiProperty
}
from
'
@nestjs/swagger
'
;
import
moment
from
'
moment
'
;
export
class
FillOptionsDto
{
@
IsString
()
@
IsOptional
()
@
ApiProperty
({
description
:
'
参赛者姓名
'
,
})
name
?:
string
;
@
IsDate
()
@
IsDate
String
()
@
IsOptional
()
date
?:
Date
;
@
ApiProperty
({
type
:
String
,
format
:
'
date
'
,
example
:
moment
().
format
(
'
YYYY-MM-DD
'
),
description
:
'
参赛日期,格式为 YYYY-MM-DD 或者其他符合 ISO 8601 的日期格式
'
,
})
date
?:
string
;
@
IsString
()
@
IsOptional
()
@
ApiProperty
({
description
:
'
比赛名称
'
,
})
event
?:
string
;
@
IsString
()
@
IsOptional
()
@
ApiProperty
({
description
:
'
座位号 / 姓氏首字母
'
,
})
lastInitial
?:
string
;
}
src/main.ts
View file @
3842efdd
...
...
@@ -13,8 +13,8 @@ async function bootstrap() {
const
config
=
app
.
get
(
ConfigService
);
if
(
!
config
.
get
(
'
NO_OPENAPI
'
))
{
const
documentConfig
=
new
DocumentBuilder
()
.
setTitle
(
'
app
'
)
.
setDescription
(
'
The app
'
)
.
setTitle
(
'
ygopro-deckform-filler
'
)
.
setDescription
(
'
上传 YGOPro YDK 卡组文件,生成可打印的卡组登记表 PDF。
'
)
.
setVersion
(
'
1.0
'
)
.
build
();
...
...
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