From c5869ebd0bde3848dd9b5e4aed58bd8caf9e0ec4 Mon Sep 17 00:00:00 2001 From: byung eun park Date: Mon, 2 Sep 2019 18:52:59 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A6=AC=EA=B7=B8=20=EB=AA=A8=EB=8D=B8,=20?= =?UTF-8?q?=EC=84=9C=EB=B9=84=EC=8A=A4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/game/model/league.model.ts | 12 ++++++++++++ src/modules/game/model/sports.model.ts | 17 +++++++++++++++++ src/modules/game/service/league.service.ts | 19 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 src/modules/game/model/league.model.ts create mode 100644 src/modules/game/model/sports.model.ts create mode 100644 src/modules/game/service/league.service.ts 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`, {}); + } +}