|
|
@@ -174,6 +174,27 @@ const getGamesList = () => {
|
|
|
return gamesListMap;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 获取比赛盘口
|
|
|
+ */
|
|
|
+const getGamesEvents = (platform) => {
|
|
|
+ if (platform) {
|
|
|
+ return Object.values(GAMES.Relations).map(rel => rel[platform] ?? {});
|
|
|
+ }
|
|
|
+ const gamesEvents = {};
|
|
|
+ Object.values(GAMES.Relations).forEach(rel => {
|
|
|
+ Object.keys(rel).forEach(platform => {
|
|
|
+ const game = rel[platform];
|
|
|
+ const { eventId, events, special } = game;
|
|
|
+ if (!gamesEvents[platform]) {
|
|
|
+ gamesEvents[platform] = {};
|
|
|
+ }
|
|
|
+ gamesEvents[platform][eventId] = { eventId, events: { ...events, ...special } };
|
|
|
+ });
|
|
|
+ });
|
|
|
+ return gamesEvents;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 更新关联比赛
|
|
|
*/
|
|
|
@@ -378,5 +399,5 @@ setInterval(() => {
|
|
|
module.exports = {
|
|
|
updateGamesList, updateGamesEvents, getGamesList,
|
|
|
updateGamesRelation, getGamesRelation, removeGamesRelation,
|
|
|
- getSolutions,
|
|
|
+ getGamesEvents, getSolutions,
|
|
|
}
|