리그 모델, 서비스 추가

This commit is contained in:
byung eun park 2019-09-02 18:52:59 +09:00
parent c1008d044c
commit c5869ebd0b
3 changed files with 48 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<Page<League>> {
return this.httpClient.get<Page<League>>(`${this.apiBaseUrl}/league`, {});
}
}