리그 모델, 서비스 추가
This commit is contained in:
		
							parent
							
								
									c1008d044c
								
							
						
					
					
						commit
						c5869ebd0b
					
				
							
								
								
									
										12
									
								
								src/modules/game/model/league.model.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								src/modules/game/model/league.model.ts
									
									
									
									
									
										Normal 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;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										17
									
								
								src/modules/game/model/sports.model.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								src/modules/game/model/sports.model.ts
									
									
									
									
									
										Normal 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;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										19
									
								
								src/modules/game/service/league.service.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								src/modules/game/service/league.service.ts
									
									
									
									
									
										Normal 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`, {});
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user