|
1 | 1 | import { Provide, Inject } from 'bwcx-core'; |
2 | 2 | import type { User } from '@algoux/standard-ranklist'; |
| 3 | +import type * as srk from '@algoux/standard-ranklist'; |
3 | 4 | import axios, { type AxiosInstance, type AxiosResponse } from 'axios'; |
4 | 5 | import http from 'http'; |
5 | 6 | import https from 'https'; |
6 | | -import { LiveContest } from '@server/models/live-contest.model'; |
7 | | -import type { LiveContestMember } from '@server/models/live-contest-member.model'; |
8 | | -import MiscUtils from '@server/utils/misc.util'; |
9 | 7 | import LogicException from '@server/exceptions/logic.exception'; |
10 | 8 | import { ErrCode } from '@common/enums/err-code.enum'; |
11 | 9 |
|
12 | | -export type LiveContestMemberInput = Omit<LiveContestMember, 'contestId' | 'createdAt' | 'updatedAt'>; |
| 10 | +export interface LiveContest { |
| 11 | + alias: string; |
| 12 | + name: string; |
| 13 | + contest: srk.Contest; |
| 14 | + problems: srk.Problem[]; |
| 15 | + markers: srk.Marker[]; |
| 16 | + series: srk.RankSeries[]; |
| 17 | + sorter: srk.Sorter; |
| 18 | + contributors: srk.Contributor[]; |
| 19 | +} |
| 20 | + |
| 21 | +export type LiveContestMember = User & { |
| 22 | + banned: boolean; |
| 23 | + broadcasterToken?: string; |
| 24 | +}; |
13 | 25 |
|
14 | 26 | @Provide() |
15 | 27 | export default class LiveContestService { |
16 | 28 | private readonly apiClient: AxiosInstance; |
17 | 29 | private readonly baseUrl: string; |
18 | 30 |
|
19 | | - public constructor(@Inject() private readonly miscUtils: MiscUtils) { |
| 31 | + public constructor() { |
20 | 32 | this.baseUrl = (process.env.RL_API_URL || 'https://rl-api-v2.algoux.cn/api').trim(); |
21 | 33 |
|
22 | 34 | const httpAgent = new http.Agent({ |
|
0 commit comments