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
6caf4810
Commit
6caf4810
authored
Apr 28, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove match tree
parent
345755c3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
6 deletions
+58
-6
package-lock.json
package-lock.json
+48
-4
package.json
package.json
+1
-1
src/match/entities/match.entity.ts
src/match/entities/match.entity.ts
+2
-0
src/tournament/entities/Tournament.entity.ts
src/tournament/entities/Tournament.entity.ts
+5
-1
src/tournament/tournament.controller.ts
src/tournament/tournament.controller.ts
+2
-0
No files found.
package-lock.json
View file @
6caf4810
...
...
@@ -22,7 +22,7 @@
"lodash"
:
"^4.17.21"
,
"nesties"
:
"^1.1.1"
,
"nestjs-mycard"
:
"^4.0.2"
,
"nicot"
:
"^1.1.1
3
"
,
"nicot"
:
"^1.1.1
7
"
,
"pg"
:
"^8.14.1"
,
"pg-native"
:
"^3.3.0"
,
"reflect-metadata"
:
"^0.2.2"
,
...
...
@@ -6352,6 +6352,12 @@
"node"
:
">= 0.6"
}
},
"node_modules/eventemitter3"
:
{
"version"
:
"4.0.7"
,
"resolved"
:
"https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz"
,
"integrity"
:
"sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
,
"license"
:
"MIT"
},
"node_modules/events"
:
{
"version"
:
"3.3.0"
,
"resolved"
:
"https://registry.npmjs.org/events/-/events-3.3.0.tgz"
,
...
...
@@ -9061,13 +9067,14 @@
}
},
"node_modules/nicot"
:
{
"version"
:
"1.1.1
3
"
,
"resolved"
:
"https://registry.npmjs.org/nicot/-/nicot-1.1.1
3
.tgz"
,
"integrity"
:
"sha512-
uBDjRUx/jmuUGxQeC/KtmkP8C/QIZYRYJMYJuszAV7M1Na+Um9hnHTcTWeSK+whrXoIEt8bJlERFn/CnRTi06
A=="
,
"version"
:
"1.1.1
7
"
,
"resolved"
:
"https://registry.npmjs.org/nicot/-/nicot-1.1.1
7
.tgz"
,
"integrity"
:
"sha512-
80Bj537a/KJZNbK5RyAf0NNzrmtygQuX0OOAkLGlmYwaTxmSqNTJ/NyWiao+ObUIu6GG3HM68erhcxSgK6ihh
A=="
,
"license"
:
"MIT"
,
"dependencies"
:
{
"lodash"
:
"^4.17.21"
,
"nesties"
:
"^1.1.2"
,
"p-queue"
:
"6.6.2"
,
"superjson"
:
"1.13.3"
,
"typed-reflector"
:
"^1.0.11"
},
...
...
@@ -9290,6 +9297,15 @@
"node"
:
">=12.20"
}
},
"node_modules/p-finally"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz"
,
"integrity"
:
"sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow=="
,
"license"
:
"MIT"
,
"engines"
:
{
"node"
:
">=4"
}
},
"node_modules/p-limit"
:
{
"version"
:
"3.1.0"
,
"resolved"
:
"https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz"
,
...
...
@@ -9322,6 +9338,34 @@
"url"
:
"https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-queue"
:
{
"version"
:
"6.6.2"
,
"resolved"
:
"https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz"
,
"integrity"
:
"sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ=="
,
"license"
:
"MIT"
,
"dependencies"
:
{
"eventemitter3"
:
"^4.0.4"
,
"p-timeout"
:
"^3.2.0"
},
"engines"
:
{
"node"
:
">=8"
},
"funding"
:
{
"url"
:
"https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-timeout"
:
{
"version"
:
"3.2.0"
,
"resolved"
:
"https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz"
,
"integrity"
:
"sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg=="
,
"license"
:
"MIT"
,
"dependencies"
:
{
"p-finally"
:
"^1.0.0"
},
"engines"
:
{
"node"
:
">=8"
}
},
"node_modules/p-try"
:
{
"version"
:
"2.2.0"
,
"resolved"
:
"https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz"
,
...
...
package.json
View file @
6caf4810
...
...
@@ -33,7 +33,7 @@
"
lodash
"
:
"
^4.17.21
"
,
"
nesties
"
:
"
^1.1.1
"
,
"
nestjs-mycard
"
:
"
^4.0.2
"
,
"
nicot
"
:
"
^1.1.1
3
"
,
"
nicot
"
:
"
^1.1.1
7
"
,
"
pg
"
:
"
^8.14.1
"
,
"
pg-native
"
:
"
^3.3.0
"
,
"
reflect-metadata
"
:
"
^0.2.2
"
,
...
...
src/match/entities/match.entity.ts
View file @
6caf4810
...
...
@@ -134,6 +134,7 @@ export class Match extends IdBase() {
return
this
.
player1Id
===
id
?
this
.
player2Id
:
this
.
player1Id
;
}
/*
clone() {
const match = new Match();
Object.assign(match, this);
...
...
@@ -146,4 +147,5 @@ export class Match extends IdBase() {
.map((match) => match.clone().buildTree(matches));
return this;
}
*/
}
src/tournament/entities/Tournament.entity.ts
View file @
6caf4810
...
...
@@ -158,12 +158,14 @@ export class Tournament extends DescBase {
@
OneToMany
(()
=>
Match
,
(
match
)
=>
match
.
tournament
)
matches
:
Match
[];
/*
@NotColumn()
@ApiProperty({
description: '对阵图树',
})
@RelationComputed()
matchTree: Match;
*/
async
beforeCreate
()
{
this
.
createdAt
=
new
Date
();
...
...
@@ -234,6 +236,7 @@ export class Tournament extends DescBase {
});
}
/*
calculateTree() {
const finalMatch = _.maxBy(
this.matches.filter((m) => !m.isThirdPlaceMatch),
...
...
@@ -241,6 +244,7 @@ export class Tournament extends DescBase {
);
this.matchTree = finalMatch.clone().buildTree(this.matches);
}
*/
analytics
()
{
if
(
!
this
.
participants
||
this
.
status
===
TournamentStatus
.
Ready
)
{
...
...
@@ -248,7 +252,7 @@ export class Tournament extends DescBase {
}
this
.
calculateScore
();
if
(
this
.
rule
===
TournamentRule
.
SingleElimination
)
{
this
.
calculateTree
();
//
this.calculateTree();
}
}
}
src/tournament/tournament.controller.ts
View file @
6caf4810
...
...
@@ -17,6 +17,7 @@ const factory = new RestfulFactory(Tournament, {
'
matches.player1
'
,
'
matches.player2
'
,
'
matches.winner
'
,
/*
'matchTree',
'matchTree.player1',
'matchTree.player2',
...
...
@@ -29,6 +30,7 @@ const factory = new RestfulFactory(Tournament, {
'matchTree.parentMatches.parentMatches.player1',
'matchTree.parentMatches.parentMatches.player2',
'matchTree.parentMatches.parentMatches.winner',
*/
],
});
class
CreateTournamentDto
extends
factory
.
createDto
{}
...
...
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