From 30fc6c3afa79628c407442dec178c31b5461440c Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Fri, 2 Sep 2022 06:09:40 +0000 Subject: [PATCH] =?UTF-8?q?=EB=B0=B0=ED=8C=85=20=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=A1=A4=EB=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.routing.ts | 4 +- .../casino/components/list.component.html | 71 ++-- .../game/casino/components/list.component.ts | 131 ++++++- .../game/casino/resolvers/casino.resolver.ts | 9 +- .../admin/game/evolution/components/index.ts | 3 - .../evolution/components/list.component.html | 334 ------------------ .../evolution/components/list.component.ts | 202 ----------- .../admin/game/evolution/evolution.module.ts | 42 --- .../admin/game/evolution/evolution.routing.ts | 15 - .../evolution/models/evolution-pagination.ts | 8 - .../admin/game/evolution/models/evolution.ts | 52 --- .../evolution/resolvers/evolution.resolver.ts | 89 ----- .../evolution/services/evolution.service.ts | 156 -------- 13 files changed, 165 insertions(+), 951 deletions(-) delete mode 100644 src/app/modules/admin/game/evolution/components/index.ts delete mode 100644 src/app/modules/admin/game/evolution/components/list.component.html delete mode 100644 src/app/modules/admin/game/evolution/components/list.component.ts delete mode 100644 src/app/modules/admin/game/evolution/evolution.module.ts delete mode 100644 src/app/modules/admin/game/evolution/evolution.routing.ts delete mode 100644 src/app/modules/admin/game/evolution/models/evolution-pagination.ts delete mode 100644 src/app/modules/admin/game/evolution/models/evolution.ts delete mode 100644 src/app/modules/admin/game/evolution/resolvers/evolution.resolver.ts delete mode 100644 src/app/modules/admin/game/evolution/services/evolution.service.ts diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts index dde90a8..4afe1d5 100644 --- a/src/app/app.routing.ts +++ b/src/app/app.routing.ts @@ -296,8 +296,8 @@ export const appRoutes: Route[] = [ { path: 'evolution', loadChildren: () => - import('app/modules/admin/game/evolution/evolution.module').then( - (m: any) => m.EvolutionModule + import('app/modules/admin/game/casino/casino.module').then( + (m: any) => m.CasinoModule ), }, { diff --git a/src/app/modules/admin/game/casino/components/list.component.html b/src/app/modules/admin/game/casino/components/list.component.html index 3e5b39f..7621d4b 100644 --- a/src/app/modules/admin/game/casino/components/list.component.html +++ b/src/app/modules/admin/game/casino/components/list.component.html @@ -10,7 +10,7 @@ -
카지노배팅리스트
+
{{ title }}
-
- - -
-
-
-
기간
-
- 2022-06-01 00:00 ~ 2022-06-21 23:59 까지 -
-
- 총 유효배팅 | 배팅금액 -
-
816,335원 | 816,335원
-
- 당첨 | 취소 | 배팅-당첨-취소 -
-
717,335원 | 0원 98,847
-
- 본사롤링 | 대본롤링 | 부본롤링 | 총판 롤링 | 매장롤링 | 회원롤링 -
-
- 6,335원 | 1,663원 | 1,633원 | 2,304원 | 5,544원 | 6,119원 -
-
롤링합계
-
3,9041원
-
-
-
- - -
- -
- -
- - - - 전체 - 배팅100만미만 - 배팅100-300만 - 배팅300-500만 - 배팅500만이상 - 당첨1000만초과 - - - - - - - - - - - - - - - - - 아이디 - 게임아이디 - 닉네임 - 게임종류 - - - - - - - - - -
-
-
- - -
- -
- - -
- -
- - - - - - - - - -
- - - -
- - - - - -
-
- {{ - betHistory.pickBetType - }} - {{ - betHistory.betMoney - }} - {{ - betHistory.betWinMoney - }} -
-
- - - -
-
-
-
- - -
-
- - -
- There are no data! -
-
-
-
- diff --git a/src/app/modules/admin/game/evolution/components/list.component.ts b/src/app/modules/admin/game/evolution/components/list.component.ts deleted file mode 100644 index b83ab3d..0000000 --- a/src/app/modules/admin/game/evolution/components/list.component.ts +++ /dev/null @@ -1,202 +0,0 @@ -import { - AfterViewInit, - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - OnDestroy, - OnInit, - ViewChild, - ViewEncapsulation, -} from '@angular/core'; -import { - FormBuilder, - FormControl, - FormGroup, - Validators, -} from '@angular/forms'; -import { MatCheckboxChange } from '@angular/material/checkbox'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatSort } from '@angular/material/sort'; -import { - debounceTime, - map, - merge, - Observable, - Subject, - switchMap, - takeUntil, -} from 'rxjs'; -import { fuseAnimations } from '@fuse/animations'; -import { FuseConfirmationService } from '@fuse/services/confirmation'; - -import { Evolution } from '../models/evolution'; -import { EvolutionPagination } from '../models/evolution-pagination'; -import { EvolutionService } from '../services/evolution.service'; - -@Component({ - selector: 'evolution-list', - templateUrl: './list.component.html', - styles: [ - /* language=SCSS */ - ` - .evolution-grid { - /* 상부 유저 게임 금액 최종 */ - grid-template-columns: 80px 100px 150px 80px 80px auto 100px 150px 120px; - @screen sm { - /* 상부 유저 게임 금액 최종 배팅 */ - grid-template-columns: 80px 100px 150px 80px 80px auto 100px 150px 120px; - } - - @screen md { - /* 상부 유저 게임 금액 최종 배팅 데이터 콤프 */ - grid-template-columns: 80px 100px 150px 80px 80px auto 100px 150px 120px; - } - - @screen lg { - /* 상부 유저 게임 금액 최종 배팅 데이터&콤프 롤링 배팅시간 */ - grid-template-columns: 80px 100px 150px 60px 60px auto 80px 150px 120px; - } - } - `, - ], - encapsulation: ViewEncapsulation.None, - changeDetection: ChangeDetectionStrategy.OnPush, - animations: fuseAnimations, -}) -export class ListComponent implements OnInit, AfterViewInit, OnDestroy { - @ViewChild(MatPaginator) private _paginator!: MatPaginator; - @ViewChild(MatSort) private _sort!: MatSort; - - evolutions$!: Observable; - - __isSearchOpened = false; - isLoading = false; - searchInputControl = new FormControl(); - selectedEvolution?: Evolution; - pagination?: EvolutionPagination; - - private _unsubscribeAll: Subject = new Subject(); - - /** - * Constructor - */ - constructor( - private _changeDetectorRef: ChangeDetectorRef, - private _fuseConfirmationService: FuseConfirmationService, - private _formBuilder: FormBuilder, - private _evolutionService: EvolutionService - ) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Lifecycle hooks - // ----------------------------------------------------------------------------------------------------- - - /** - * On init - */ - ngOnInit(): void { - // Get the pagination - this._evolutionService.pagination$ - .pipe(takeUntil(this._unsubscribeAll)) - .subscribe((pagination: EvolutionPagination | undefined) => { - // Update the pagination - this.pagination = pagination; - - // Mark for check - this._changeDetectorRef.markForCheck(); - }); - - // Get the products - this.evolutions$ = this._evolutionService.evolutions$; - } - - /** - * After view init - */ - ngAfterViewInit(): void { - if (this._sort && this._paginator) { - // Set the initial sort - this._sort.sort({ - id: 'signinId', - start: 'asc', - disableClear: true, - }); - - // Mark for check - this._changeDetectorRef.markForCheck(); - - // If the evolution changes the sort order... - this._sort.sortChange - .pipe(takeUntil(this._unsubscribeAll)) - .subscribe(() => { - // Reset back to the first page - this._paginator.pageIndex = 0; - }); - - // Get products if sort or page changes - merge(this._sort.sortChange, this._paginator.page) - .pipe( - switchMap(() => { - this.isLoading = true; - return this._evolutionService.getEvolutions( - this._paginator.pageIndex, - this._paginator.pageSize, - this._sort.active, - this._sort.direction - ); - }), - map(() => { - this.isLoading = false; - }) - ) - .subscribe(); - } - } - - /** - * On destroy - */ - ngOnDestroy(): void { - // Unsubscribe from all subscriptions - this._unsubscribeAll.next(null); - this._unsubscribeAll.complete(); - } - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - // ----------------------------------------------------------------------------------------------------- - // @ Private methods - // ----------------------------------------------------------------------------------------------------- - - /** - * Create product - */ - __createProduct(): void {} - - /** - * Toggle product details - * - * @param productId - */ - __toggleDetails(productId: string): void {} - - /** - * toggle the search - * Used in 'bar' - */ - __onClickSearch(): void { - this.__isSearchOpened = !this.__isSearchOpened; - } - - /** - * Track by function for ngFor loops - * - * @param index - * @param item - */ - __trackByFn(index: number, item: any): any { - return item.id || index; - } -} diff --git a/src/app/modules/admin/game/evolution/evolution.module.ts b/src/app/modules/admin/game/evolution/evolution.module.ts deleted file mode 100644 index fe061f3..0000000 --- a/src/app/modules/admin/game/evolution/evolution.module.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import { MatButtonModule } from '@angular/material/button'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatPaginatorModule } from '@angular/material/paginator'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSortModule } from '@angular/material/sort'; -import { MatSelectModule } from '@angular/material/select'; -import { MatDatepickerModule } from '@angular/material/datepicker'; -import { MatMomentDateModule } from '@angular/material-moment-adapter'; - -import { TranslocoModule } from '@ngneat/transloco'; - -import { SharedModule } from 'app/shared/shared.module'; - -import { COMPONENTS } from './components'; - -import { evolutionRoutes } from './evolution.routing'; - -@NgModule({ - declarations: [COMPONENTS], - imports: [ - TranslocoModule, - SharedModule, - RouterModule.forChild(evolutionRoutes), - - MatButtonModule, - MatFormFieldModule, - MatIconModule, - MatInputModule, - MatPaginatorModule, - MatProgressBarModule, - MatSortModule, - MatSelectModule, - MatDatepickerModule, - MatMomentDateModule, - ], -}) -export class EvolutionModule {} diff --git a/src/app/modules/admin/game/evolution/evolution.routing.ts b/src/app/modules/admin/game/evolution/evolution.routing.ts deleted file mode 100644 index 78500d7..0000000 --- a/src/app/modules/admin/game/evolution/evolution.routing.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Route } from '@angular/router'; - -import { ListComponent } from './components/list.component'; - -import { EvolutionsResolver } from './resolvers/evolution.resolver'; - -export const evolutionRoutes: Route[] = [ - { - path: '', - component: ListComponent, - resolve: { - deposits: EvolutionsResolver, - }, - }, -]; diff --git a/src/app/modules/admin/game/evolution/models/evolution-pagination.ts b/src/app/modules/admin/game/evolution/models/evolution-pagination.ts deleted file mode 100644 index d1bff25..0000000 --- a/src/app/modules/admin/game/evolution/models/evolution-pagination.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface EvolutionPagination { - length: number; - size: number; - page: number; - lastPage: number; - startIndex: number; - endIndex: number; -} diff --git a/src/app/modules/admin/game/evolution/models/evolution.ts b/src/app/modules/admin/game/evolution/models/evolution.ts deleted file mode 100644 index 2924b20..0000000 --- a/src/app/modules/admin/game/evolution/models/evolution.ts +++ /dev/null @@ -1,52 +0,0 @@ -export interface Evolution { - id: string; - signinId?: string; - highRank?: string; - gameId?: string; - nickname?: string; - vendorName?: string; - gameName?: string; - bettingId?: string; - betStatus?: string; - betMoney?: string; - betWinMoney?: string; - betBeforeMoney?: string; - betProfitLossMoney?: string; - betAfterMoney?: string; - totalMoney?: string; - comp?: string; - betHistorys?: [ - { - pickBetType?: string; - betMoney?: string; - betWinMoney?: string; - } - ]; - mainInfo?: { - name?: string; - commissionRate?: string; - point?: string; - }; - branchInfo?: { - name?: string; - commissionRate?: string; - point?: string; - }; - divisionInfo?: { - name?: string; - commissionRate?: string; - point?: string; - }; - officeInfo?: { - name?: string; - commissionRate?: string; - point?: string; - }; - storeInfo?: { - name?: string; - commissionRate?: string; - point?: string; - }; - bettingregistrationDate?: string; - registrationDate?: string; -} diff --git a/src/app/modules/admin/game/evolution/resolvers/evolution.resolver.ts b/src/app/modules/admin/game/evolution/resolvers/evolution.resolver.ts deleted file mode 100644 index 4fc4dd8..0000000 --- a/src/app/modules/admin/game/evolution/resolvers/evolution.resolver.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { Injectable } from '@angular/core'; -import { - ActivatedRouteSnapshot, - Resolve, - Router, - RouterStateSnapshot, -} from '@angular/router'; -import { catchError, Observable, throwError } from 'rxjs'; - -import { Evolution } from '../models/evolution'; -import { EvolutionPagination } from '../models/evolution-pagination'; -import { EvolutionService } from '../services/evolution.service'; - -@Injectable({ - providedIn: 'root', -}) -export class EvolutionResolver implements Resolve { - /** - * Constructor - */ - constructor( - private _evolutionService: EvolutionService, - private _router: Router - ) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - /** - * Resolver - * - * @param route - * @param state - */ - resolve( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot - ): Observable { - return this._evolutionService - .getEvolutionById(route.paramMap.get('id')) - .pipe( - // Error here means the requested product is not available - catchError((error) => { - // Log the error - console.error(error); - - // Get the parent url - const parentUrl = state.url.split('/').slice(0, -1).join('/'); - - // Navigate to there - this._router.navigateByUrl(parentUrl); - - // Throw an error - return throwError(error); - }) - ); - } -} - -@Injectable({ - providedIn: 'root', -}) -export class EvolutionsResolver implements Resolve { - /** - * Constructor - */ - constructor(private _evolutionService: EvolutionService) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - /** - * Resolver - * - * @param route - * @param state - */ - resolve( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot - ): Observable<{ - pagination: EvolutionPagination; - evolutions: Evolution[]; - }> { - return this._evolutionService.getEvolutions(); - } -} diff --git a/src/app/modules/admin/game/evolution/services/evolution.service.ts b/src/app/modules/admin/game/evolution/services/evolution.service.ts deleted file mode 100644 index 396f0f7..0000000 --- a/src/app/modules/admin/game/evolution/services/evolution.service.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { - BehaviorSubject, - filter, - map, - Observable, - of, - switchMap, - take, - tap, - throwError, -} from 'rxjs'; - -import { Evolution } from '../models/evolution'; -import { EvolutionPagination } from '../models/evolution-pagination'; - -@Injectable({ - providedIn: 'root', -}) -export class EvolutionService { - // Private - private __pagination = new BehaviorSubject( - undefined - ); - private __evolution = new BehaviorSubject(undefined); - private __evolutions = new BehaviorSubject( - undefined - ); - - /** - * Constructor - */ - constructor(private _httpClient: HttpClient) {} - - // ----------------------------------------------------------------------------------------------------- - // @ Accessors - // ----------------------------------------------------------------------------------------------------- - - /** - * Getter for pagination - */ - get pagination$(): Observable { - return this.__pagination.asObservable(); - } - - /** - * Getter for evolution - */ - get evolution$(): Observable { - return this.__evolution.asObservable(); - } - - /** - * Getter for evolutions - */ - get evolutions$(): Observable { - return this.__evolutions.asObservable(); - } - - // ----------------------------------------------------------------------------------------------------- - // @ Public methods - // ----------------------------------------------------------------------------------------------------- - - /** - * Get evolutions - * - * - * @param page - * @param size - * @param sort - * @param order - * @param search - */ - getEvolutions( - page: number = 0, - size: number = 10, - sort: string = 'nickname', - order: 'asc' | 'desc' | '' = 'asc', - search: string = '' - ): Observable<{ - pagination: EvolutionPagination; - evolutions: Evolution[]; - }> { - return this._httpClient - .get<{ pagination: EvolutionPagination; evolutions: Evolution[] }>( - 'api/apps/game/evolution/evolutions', - { - params: { - page: '' + page, - size: '' + size, - sort, - order, - search, - }, - } - ) - .pipe( - tap((response) => { - this.__pagination.next(response.pagination); - this.__evolutions.next(response.evolutions); - }) - ); - } - - /** - * Get product by id - */ - getEvolutionById(id: string | null): Observable { - return this.__evolutions.pipe( - take(1), - map((evolutions) => { - // Find the product - const evolution = - evolutions?.find((item) => item.id === id) || undefined; - - // Update the product - this.__evolution.next(evolution); - - // Return the product - return evolution; - }), - switchMap((product) => { - if (!product) { - return throwError('Could not found product with id of ' + id + '!'); - } - - return of(product); - }) - ); - } - - /** - * Create product - */ - createEvolution(): Observable { - return this.evolutions$.pipe( - take(1), - switchMap((evolutions) => - this._httpClient - .post('api/apps/game/evolution/product', {}) - .pipe( - map((newEvolution) => { - // Update the evolutions with the new product - if (!!evolutions) { - this.__evolutions.next([newEvolution, ...evolutions]); - } - - // Return the new product - return newEvolution; - }) - ) - ) - ); - } -}