Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
Neos
Commits
3c38ffb5
Commit
3c38ffb5
authored
Apr 07, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: deck api
parent
5226ac18
Pipeline
#21138
failed with stages
in 6 minutes and 23 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
80 deletions
+93
-80
src/api/deck.json
src/api/deck.json
+0
-79
src/api/deck/deckManager.ts
src/api/deck/deckManager.ts
+32
-0
src/api/deck/index.ts
src/api/deck/index.ts
+1
-0
src/api/deck/structureDeck.ts
src/api/deck/structureDeck.ts
+48
-0
src/env.d.ts
src/env.d.ts
+12
-0
src/react-app-env.d.ts
src/react-app-env.d.ts
+0
-1
No files found.
src/api/deck.json
deleted
100644 → 0
View file @
5226ac18
{
"hero"
:
{
"main"
:
[
14124483
,
9411399
,
9411399
,
18094166
,
18094166
,
18094166
,
40044918
,
40044918
,
59392529
,
50720316
,
50720316
,
27780618
,
27780618
,
16605586
,
16605586
,
22865492
,
22865492
,
23434538
,
23434538
,
14558127
,
14558127
,
13650422
,
83965310
,
81439173
,
8949584
,
8949584
,
32807846
,
52947044
,
45906428
,
24094653
,
21143940
,
21143940
,
21143940
,
48130397
,
24224830
,
24224830
,
12071500
,
24299458
,
24299458
,
10045474
],
"extra"
:
[
86165817
,
41209827
,
29095552
,
40854197
,
60461804
,
60461804
,
22908820
,
58481572
,
58481572
,
89870349
,
46759931
,
63813056
,
1948619
,
58004362
,
58004362
],
"side"
:
[
27204311
,
34267821
,
34267821
,
43534808
,
43534808
,
94145021
,
94145021
,
18144506
,
54693926
,
54693926
,
43898403
,
43898403
,
65681983
,
23002292
]
}
}
src/api/deck.ts
→
src/api/deck
/deckManager
.ts
View file @
3c38ffb5
// import axios from "axios";
import
DECKS
from
"
./deck.json
"
;
import
{
DECKS
}
from
"
./structureDeck
"
;
const
DeckManager
=
_objToMap
(
DECKS
);
export
interface
IDeck
{
main
?:
number
[];
extra
?:
number
[];
side
?:
number
[];
}
/*
* 返回卡组资源。
*
...
...
@@ -20,13 +13,20 @@ export interface IDeck {
export
async
function
fetchDeck
(
deck
:
string
):
Promise
<
IDeck
>
{
const
res
=
DeckManager
.
get
(
deck
);
return
res
||
{
main
:
[],
extra
:
[],
side
:
[]
};
return
res
??
{
deckName
:
"
undefined
"
,
main
:
[],
extra
:
[],
side
:
[]
};
}
function
_objToMap
(
object
:
any
):
Map
<
string
,
IDeck
>
{
let
map
=
new
Map
();
function
_objToMap
(
object
:
IDeck
[]
):
Map
<
string
,
IDeck
>
{
const
map
:
Map
<
string
,
IDeck
>
=
new
Map
();
Object
.
keys
(
object
).
forEach
((
key
)
=>
map
.
set
(
key
,
object
[
key
]
));
object
.
forEach
((
value
)
=>
map
.
set
(
value
.
deckName
,
value
));
return
map
;
}
export
interface
IDeck
{
deckName
:
string
;
main
:
number
[];
extra
:
number
[];
side
:
number
[];
}
src/api/deck/index.ts
0 → 100644
View file @
3c38ffb5
export
*
from
"
./deckManager
"
;
src/api/deck/structureDeck.ts
0 → 100644
View file @
3c38ffb5
import
type
{
IDeck
}
from
"
.
"
;
/**
* 预设卡组。
*/
export
const
DECKS
:
IDeck
[]
=
[
{
deckName
:
"
hero
"
,
main
:
[
14124483
,
9411399
,
9411399
,
18094166
,
18094166
,
18094166
,
40044918
,
40044918
,
59392529
,
50720316
,
50720316
,
27780618
,
27780618
,
16605586
,
16605586
,
22865492
,
22865492
,
23434538
,
23434538
,
14558127
,
14558127
,
13650422
,
83965310
,
81439173
,
8949584
,
8949584
,
32807846
,
52947044
,
45906428
,
24094653
,
21143940
,
21143940
,
21143940
,
48130397
,
24224830
,
24224830
,
12071500
,
24299458
,
24299458
,
10045474
,
],
extra
:
[
86165817
,
41209827
,
29095552
,
40854197
,
60461804
,
60461804
,
22908820
,
58481572
,
58481572
,
89870349
,
46759931
,
63813056
,
1948619
,
58004362
,
58004362
,
],
side
:
[
27204311
,
34267821
,
34267821
,
43534808
,
43534808
,
94145021
,
94145021
,
18144506
,
54693926
,
54693926
,
43898403
,
43898403
,
65681983
,
23002292
,
],
},
{
deckName
:
"
Sky Striker Ace
"
,
main
:
[
27204311
,
33331231
,
37351133
,
37351133
,
26077387
,
26077387
,
26077387
,
23434538
,
23434538
,
23434538
,
14558127
,
14558127
,
14558127
,
97268402
,
97268402
,
18144506
,
25955749
,
99550630
,
35261759
,
35261759
,
73628505
,
63166095
,
63166095
,
46271408
,
67169062
,
32807846
,
70368879
,
70368879
,
51227866
,
9726840
,
9726840
,
52340444
,
24224830
,
24224830
,
98338152
,
98338152
,
24299458
,
24010609
,
24010609
,
97616504
,
50005218
,
67616300
,
10045474
,
10045474
,
],
extra
:
[
85289965
,
86066372
,
49202162
,
38342335
,
45819647
,
2857636
,
50588353
,
75147529
,
12421694
,
90673288
,
90673288
,
90673288
,
63288573
,
8491308
,
8491308
,
],
side
:
[
27204311
,
33331231
,
34267821
,
34267821
,
24508238
,
73642296
,
59438930
,
59438930
,
5133471
,
24299458
,
83326048
,
83326048
,
69452756
,
69452756
,
23002292
,
],
},
];
src/env.d.ts
0 → 100644
View file @
3c38ffb5
/// <reference types="react-scripts" />
/// <reference types="vite/client" />
interface
ImportMetaEnv
{
readonly
VITE_IS_AI_MODE
:
string
;
readonly
VITE_IS_AI_FIRST
:
string
;
readonly
VITE_AI_MODE_DEFAULT_DECK
:
string
;
}
interface
ImportMeta
{
readonly
env
:
ImportMetaEnv
;
}
src/react-app-env.d.ts
deleted
100644 → 0
View file @
5226ac18
/// <reference types="react-scripts" />
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