优化详情显示
This commit is contained in:
49
types/api.ts
49
types/api.ts
@@ -30,6 +30,50 @@ export interface ApiListResponse<T> {
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface GoalEvent {
|
||||
time: string;
|
||||
home_scorer?: string;
|
||||
away_scorer?: string;
|
||||
score?: string;
|
||||
comment?: string;
|
||||
}
|
||||
|
||||
export interface CardEvent {
|
||||
time: string;
|
||||
home_fault?: string;
|
||||
away_fault?: string;
|
||||
card?: string;
|
||||
comment?: string;
|
||||
}
|
||||
|
||||
export interface SubstituteEvent {
|
||||
time: string;
|
||||
home_scorer?: string;
|
||||
away_scorer?: string;
|
||||
home_assist?: string;
|
||||
away_assist?: string;
|
||||
home_scorer_out?: string;
|
||||
away_scorer_out?: string;
|
||||
comment?: string;
|
||||
}
|
||||
|
||||
export interface MatchEvents {
|
||||
goalscorers: GoalEvent[];
|
||||
cards: CardEvent[];
|
||||
substitutes: SubstituteEvent[];
|
||||
}
|
||||
|
||||
export interface Player {
|
||||
// AllSports API 常见字段
|
||||
player?: string; // 有些接口用 player
|
||||
player_name?: string; // 有些接口用 player_name
|
||||
name?: string; // 兜底
|
||||
player_number?: number | string;
|
||||
number?: number | string;
|
||||
player_type?: string; // 位置/角色,例如 Goalkeepers
|
||||
position?: string; // 兜底位置字段
|
||||
}
|
||||
|
||||
export interface MatchDetailData {
|
||||
events: any[];
|
||||
match: {
|
||||
@@ -73,5 +117,10 @@ export interface MatchDetailData {
|
||||
eventType: string;
|
||||
eventToss: string;
|
||||
eventManOfMatch: string;
|
||||
events?: MatchEvents;
|
||||
players?: {
|
||||
home_team?: Player[];
|
||||
away_team?: Player[];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user