diff --git a/src/modules/game/model/league.model.ts b/src/modules/game/model/league.model.ts new file mode 100644 index 0000000..29ae673 --- /dev/null +++ b/src/modules/game/model/league.model.ts @@ -0,0 +1,12 @@ +import { DateAudit } from 'src/modules/common/data/model/audit'; +import { Sports } from './sports.model'; + +export interface League extends DateAudit { + id?: number; + engName?: string; + korName?: string; + sevenName?: string; + engCountry?: string; + korCountry?: string; + sportsEntities?: Sports; +} diff --git a/src/modules/game/model/sports.model.ts b/src/modules/game/model/sports.model.ts new file mode 100644 index 0000000..dbbdb2e --- /dev/null +++ b/src/modules/game/model/sports.model.ts @@ -0,0 +1,17 @@ +import { DateAudit } from 'src/modules/common/data/model/audit'; + +export enum SportsName { + SOCCER = 'SOCCER', + BASEBALL = 'BASEBALL', + BASKET_BALL = 'BASKET_BALL', + E_SPORTS = 'E_SPORTS', + TENNIS = 'TENNIS', + TABLE_TENIS = 'TABLE_TENIS', + VALLEY_BALL = 'VALLEY_BALL', + HAND_BALL = 'HAND_BALL' +} + +export interface Sports extends DateAudit { + id: number; + name: SportsName; +} diff --git a/src/modules/game/service/league.service.ts b/src/modules/game/service/league.service.ts new file mode 100644 index 0000000..7ed9ae4 --- /dev/null +++ b/src/modules/game/service/league.service.ts @@ -0,0 +1,19 @@ +import { Injectable, Inject } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { League } from 'src/modules/game/model/league.model'; +import { API_BASE_URL } from 'src/modules/common/type/injection-token.type'; +import { Page } from 'src/modules/common/data/model/page'; +import { map } from 'rxjs/operators'; + +@Injectable() +export class LeagueService { + constructor( + @Inject(API_BASE_URL) private apiBaseUrl: string, + private httpClient: HttpClient + ) {} + + public getAllLeague(): Observable> { + return this.httpClient.get>(`${this.apiBaseUrl}/league`, {}); + } +}