Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tabulator-another
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
tabulator-another
Commits
983f0333
Commit
983f0333
authored
Apr 23, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bump nicot and add manual relations
parent
6231c9fa
Pipeline
#35469
passed with stages
in 6 minutes and 58 seconds
Changes
9
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
41 additions
and
23 deletions
+41
-23
package-lock.json
package-lock.json
+4
-4
package.json
package.json
+1
-1
src/match/entities/match.entity.ts
src/match/entities/match.entity.ts
+0
-1
src/match/match.controller.ts
src/match/match.controller.ts
+4
-2
src/participant/entities/participant.entity.ts
src/participant/entities/participant.entity.ts
+0
-3
src/participant/participant.controller.ts
src/participant/participant.controller.ts
+4
-2
src/srvpro/srvpro.dto.ts
src/srvpro/srvpro.dto.ts
+5
-7
src/tournament/entities/Tournament.entity.ts
src/tournament/entities/Tournament.entity.ts
+2
-2
src/tournament/tournament.controller.ts
src/tournament/tournament.controller.ts
+21
-1
No files found.
package-lock.json
View file @
983f0333
...
...
@@ -22,7 +22,7 @@
"lodash"
:
"^4.17.21"
,
"nesties"
:
"^1.1.1"
,
"nestjs-mycard"
:
"^4.0.2"
,
"nicot"
:
"^1.1.
7
"
,
"nicot"
:
"^1.1.
9
"
,
"pg"
:
"^8.14.1"
,
"pg-native"
:
"^3.3.0"
,
"reflect-metadata"
:
"^0.2.2"
,
...
...
@@ -9034,9 +9034,9 @@
}
},
"node_modules/nicot"
:
{
"version"
:
"1.1.
7
"
,
"resolved"
:
"https://registry.npmjs.org/nicot/-/nicot-1.1.
7
.tgz"
,
"integrity"
:
"sha512-
vRNyHv42xA7ccIzJAUP7zrL+A6FDdsmgXtcclodxfuM1AX/AECAbx2spu9HmFkDaWKyfauyoofce22ql+R3sF
w=="
,
"version"
:
"1.1.
9
"
,
"resolved"
:
"https://registry.npmjs.org/nicot/-/nicot-1.1.
9
.tgz"
,
"integrity"
:
"sha512-
DG4SK6E0DQ8JBKn8xGL6cbpXBQxTfUdC2d6r6Pu2OSKM6yyz7EmhBHcviSGbNUNArShljmc06YCaj7sqqqRSy
w=="
,
"license"
:
"MIT"
,
"dependencies"
:
{
"lodash"
:
"^4.17.21"
,
...
...
package.json
View file @
983f0333
...
...
@@ -33,7 +33,7 @@
"
lodash
"
:
"
^4.17.21
"
,
"
nesties
"
:
"
^1.1.1
"
,
"
nestjs-mycard
"
:
"
^4.0.2
"
,
"
nicot
"
:
"
^1.1.
7
"
,
"
nicot
"
:
"
^1.1.
9
"
,
"
pg
"
:
"
^8.14.1
"
,
"
pg-native
"
:
"
^3.3.0
"
,
"
reflect-metadata
"
:
"
^0.2.2
"
,
...
...
src/match/entities/match.entity.ts
View file @
983f0333
...
...
@@ -121,7 +121,6 @@ export class Match extends IdBase() {
@
NotColumn
()
@
ManyToOne
(()
=>
Match
,
(
match
)
=>
match
.
parentMatches
)
@
NotInResult
()
childMatch
:
Match
;
@
NotColumn
()
@
OneToMany
(()
=>
Match
,
(
match
)
=>
match
.
childMatch
)
...
...
src/match/match.controller.ts
View file @
983f0333
import
{
Controller
}
from
'
@nestjs/common
'
;
import
{
MatchService
}
from
'
./match.service
'
;
import
{
ApiError
,
RestfulFactory
}
from
'
nicot
'
;
import
{
ApiError
,
Inner
,
RestfulFactory
}
from
'
nicot
'
;
import
{
Match
}
from
'
./entities/match.entity
'
;
import
{
ApiTags
}
from
'
@nestjs/swagger
'
;
import
{
ApiMycardUser
,
MycardUser
,
PutMycardUser
}
from
'
nestjs-mycard
'
;
const
factory
=
new
RestfulFactory
(
Match
);
const
factory
=
new
RestfulFactory
(
Match
,
{
relations
:
[
Inner
(
'
tournament
'
),
'
player1
'
,
'
player2
'
,
'
winner
'
],
});
class
FindMatchDto
extends
factory
.
findAllDto
{}
class
UpdateMatchDto
extends
factory
.
updateDto
{}
...
...
src/participant/entities/participant.entity.ts
View file @
983f0333
...
...
@@ -51,17 +51,14 @@ export class Participant extends NamedBase {
@
NotColumn
()
@
OneToMany
(()
=>
Match
,
(
match
)
=>
match
.
player1
)
@
NotInResult
()
matches1
:
Match
[];
@
NotColumn
()
@
OneToMany
(()
=>
Match
,
(
match
)
=>
match
.
player2
)
@
NotInResult
()
matches2
:
Match
[];
@
NotColumn
()
@
OneToMany
(()
=>
Match
,
(
match
)
=>
match
.
winner
)
@
NotInResult
()
wonMatches
:
Match
[];
@
NotColumn
({
...
...
src/participant/participant.controller.ts
View file @
983f0333
import
{
Controller
}
from
'
@nestjs/common
'
;
import
{
ParticipantService
}
from
'
./participant.service
'
;
import
{
Participant
}
from
'
./entities/participant.entity
'
;
import
{
ApiError
,
RestfulFactory
}
from
'
nicot
'
;
import
{
ApiError
,
Inner
,
RestfulFactory
}
from
'
nicot
'
;
import
{
ApiMycardUser
,
MycardUser
,
PutMycardUser
}
from
'
nestjs-mycard
'
;
import
{
ApiTags
}
from
'
@nestjs/swagger
'
;
const
factory
=
new
RestfulFactory
(
Participant
);
const
factory
=
new
RestfulFactory
(
Participant
,
{
relations
:
[
Inner
(
'
tournament
'
)],
});
class
CreateParticipantDto
extends
factory
.
createDto
{}
class
FindParticipantDto
extends
factory
.
findAllDto
{}
class
UpdateParticipantDto
extends
factory
.
updateDto
{}
...
...
src/srvpro/srvpro.dto.ts
View file @
983f0333
...
...
@@ -20,7 +20,10 @@ import { RestfulFactory } from 'nicot';
import
{
Match
,
MatchStatus
}
from
'
../match/entities/match.entity
'
;
import
{
Tournament
}
from
'
../tournament/entities/Tournament.entity
'
;
export
const
participantRestfulFactory
=
new
RestfulFactory
(
Participant
);
export
const
participantRestfulFactory
=
new
RestfulFactory
(
Participant
,
{
entityClassName
:
'
SRVProParticipant
'
,
relations
:
[],
});
export
class
WithApiKeyBody
{
@
IsString
()
...
...
@@ -119,14 +122,9 @@ export class SRVProUploadMatchDto extends WithApiKeyBody {
match
:
SRVProUploadMatch
;
}
export
class
SRVProParticipant
extends
OmitType
(
participantRestfulFactory
.
entityResultDto
,
[
'
tournament
'
],
)
{}
export
class
SRVProParticipantDto
{
@
ApiProperty
({
type
:
()
=>
SRVProParticipant
,
type
:
()
=>
participantRestfulFactory
.
entityResultDto
,
})
participant
:
Participant
;
...
...
src/tournament/entities/Tournament.entity.ts
View file @
983f0333
...
...
@@ -17,7 +17,7 @@ import {
NotQueryable
,
NotWritable
,
QueryEqual
,
Re
stfulFactory
,
Re
lationComputed
,
}
from
'
nicot
'
;
import
{
MycardUser
}
from
'
nestjs-mycard
'
;
import
{
DescBase
}
from
'
../../utility/NamedBase.entity
'
;
...
...
@@ -137,8 +137,8 @@ export class Tournament extends DescBase {
@
NotColumn
()
@
ApiProperty
({
description
:
'
对阵图树
'
,
type
:
()
=>
new
RestfulFactory
(
Match
).
entityResultDto
,
})
@
RelationComputed
()
matchTree
:
Match
;
async
beforeCreate
()
{
...
...
src/tournament/tournament.controller.ts
View file @
983f0333
...
...
@@ -10,7 +10,27 @@ import {
ApiTags
,
}
from
'
@nestjs/swagger
'
;
const
factory
=
new
RestfulFactory
(
Tournament
);
const
factory
=
new
RestfulFactory
(
Tournament
,
{
relations
:
[
'
participants
'
,
'
matches
'
,
'
matches.player1
'
,
'
matches.player2
'
,
'
matches.winner
'
,
'
matchTree
'
,
'
matchTree.player1
'
,
'
matchTree.player2
'
,
'
matchTree.winner
'
,
'
matchTree.parentMatches
'
,
'
matchTree.parentMatches.player1
'
,
'
matchTree.parentMatches.player2
'
,
'
matchTree.parentMatches.winner
'
,
'
matchTree.parentMatches.parentMatches
'
,
'
matchTree.parentMatches.parentMatches.player1
'
,
'
matchTree.parentMatches.parentMatches.player2
'
,
'
matchTree.parentMatches.parentMatches.winner
'
,
],
});
class
CreateTournamentDto
extends
factory
.
createDto
{}
class
FindTournamentDto
extends
factory
.
findAllDto
{}
class
UpdateTournamentDto
extends
factory
.
updateDto
{}
...
...
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