add contest detail.

This commit is contained in:
2023-01-23 22:56:50 +08:00
parent b060262f70
commit 7def5a4d83
8 changed files with 118 additions and 11 deletions

View File

@@ -14,6 +14,17 @@ export enum SubmissionStatus {
submitting = 9,
}
export enum ContestStatus {
not_started = "1",
underway = "0",
finished = "-1",
}
export enum ContestType {
public = "Public",
private = "Password Protected",
}
export const JUDGE_STATUS: {
[key in SUBMISSION_RESULT]: {
name: string
@@ -71,7 +82,7 @@ export const JUDGE_STATUS: {
}
export const CONTEST_STATUS: {
[key in "1" | "-1" | "0"]: {
[key in ContestStatus]: {
name: string
type: "error" | "success" | "warning"
}

View File

@@ -1,3 +1,5 @@
import { ContestStatus, ContestType } from "./constants"
export interface Profile {
id: number
user: User
@@ -206,8 +208,8 @@ export interface Contest {
username: string
real_name: null
}
status: "-1" | "0" | "1"
contest_type: "Password Protected" | "Public"
status: ContestStatus
contest_type: ContestType
title: string
description: string
real_time_rank: boolean