Merge branch 'feature/BETERAN-BACKEND-APP-BROWSER-init' of https://gitlab.loafle.net/bet/beteran-backend-app-browser into feature/BETERAN-BACKEND-APP-BROWSER-init

This commit is contained in:
Park Byung Eun 2022-08-25 06:06:56 +00:00
commit 60f7417cdf
9 changed files with 181 additions and 86 deletions

View File

@ -57,20 +57,24 @@
<div fxLayout="row wrap" class="items-center mt-6 sm:mt-0 sm:ml-0"> <div fxLayout="row wrap" class="items-center mt-6 sm:mt-0 sm:ml-0">
<!-- Search --> <!-- Search -->
<!-- Card inception --> <!-- Card inception -->
<mat-form-field [floatLabel]="'always'"> <mat-form-field
[floatLabel]="'always'"
class="bet-mat-form-field-wrapper-mb-0 mr-2"
>
<input <input
matInput matInput
[matDatepicker]="picker1" [matDatepicker]="picker1"
[placeholder]="'Choose a date'" [placeholder]="'Choose a date'"
/> />
<mat-datepicker-toggle <mat-datepicker-toggle matSuffix [for]="picker1">
matSuffix </mat-datepicker-toggle>
[for]="picker1"
></mat-datepicker-toggle>
<mat-datepicker #picker1></mat-datepicker> <mat-datepicker #picker1></mat-datepicker>
</mat-form-field> </mat-form-field>
<!-- Card expiration --> <!-- Card expiration -->
<mat-form-field [floatLabel]="'always'"> <mat-form-field
[floatLabel]="'always'"
class="bet-mat-form-field-wrapper-mb-0 mr-2"
>
<input <input
matInput matInput
[matDatepicker]="picker2" [matDatepicker]="picker2"
@ -82,30 +86,25 @@
></mat-datepicker-toggle> ></mat-datepicker-toggle>
<mat-datepicker #picker2></mat-datepicker> <mat-datepicker #picker2></mat-datepicker>
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
<mat-select placeholder="리스트수">
<mat-option value="40">40</mat-option>
<mat-option value="60">60</mat-option>
<mat-option value="80">80</mat-option>
<mat-option value="100">100</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2"> <mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
<mat-select placeholder="레벨"> <mat-select placeholder="레벨">
<mat-option value="level1">LV.1</mat-option> <ng-container *ngIf="listMemberLevels$ | async as memberLevels">
<mat-option value="level2">LV.2</mat-option> <mat-option>None</mat-option>
<mat-option value="level3">LV.3</mat-option> <ng-container *ngFor="let ml of memberLevels; let i = index">
<mat-option value="level4">LV.4</mat-option> <mat-option [value]="ml.getId()">{{ ml.getName() }}</mat-option>
</ng-container>
</ng-container>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2"> <mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
<mat-select placeholder="상태"> <mat-select placeholder="상태">
<mat-option value="">정상</mat-option> <mat-option>None</mat-option>
<mat-option value="">대기</mat-option> <mat-option value="NORMAL">정상</mat-option>
<mat-option value="">탈퇴</mat-option> <mat-option value="PENDING">대기</mat-option>
<mat-option value="">휴면</mat-option> <mat-option value="WITHDRAWAL">탈퇴</mat-option>
<mat-option value="">블랙</mat-option> <mat-option value="DORMANCY">휴면</mat-option>
<mat-option value="">정지</mat-option> <mat-option value="BLACKLIST">블랙</mat-option>
<mat-option value="SUSPENDED">정지</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2"> <mat-form-field fxFlex class="bet-mat-form-field-wrapper-mb-0 mr-2">
@ -205,8 +204,6 @@
<div class="grid"> <div class="grid">
<!-- Header --> <!-- Header -->
<div <div
matSort
matSortDisableClear
class="user-grid z-10 sticky top-0 grid gap-4 py-4 px-6 md:px-8 shadow text-md font-semibold text-secondary bg-gray-50 dark:bg-black dark:bg-opacity-5" class="user-grid z-10 sticky top-0 grid gap-4 py-4 px-6 md:px-8 shadow text-md font-semibold text-secondary bg-gray-50 dark:bg-black dark:bg-opacity-5"
> >
<div style="text-align: center"> <div style="text-align: center">
@ -218,38 +215,39 @@
<div style="text-align: center">요율</div> <div style="text-align: center">요율</div>
<div style="text-align: center">상부</div> <div style="text-align: center">상부</div>
<div style="text-align: center"> <div style="text-align: center">
<div>아이디</div> <span>아이디</span>
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
닉네임 <span>닉네임</span>
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
연락처 <span>연락처</span>
</div> </div>
<div style="text-align: center"> <div style="text-align: center">
등급 <span>등급</span>
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
레벨 <span>레벨</span>
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
상태 <span>상태</span>
</div> </div>
<div class="hidden sm:block" style="text-align: center"> <div class="hidden sm:block" style="text-align: center">
예금주 <span>예금주</span>
</div> </div>
<div class="hidden md:block" style="text-align: center"> <div class="hidden md:block" style="text-align: center">
보유금 <span>보유금</span>
</div> </div>
<div class="hidden md:block" style="text-align: center"> <div class="hidden md:block" style="text-align: center">
게임중머니 <span>게임중머니</span>
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
금일콤프 <span>금일콤프</span>
</div> </div>
<div class="hidden md:block" style="text-align: center"> <div class="hidden md:block" style="text-align: center">
총입출 <span>총입출</span>
</div> </div>
<div class="hidden lg:block" style="text-align: center"> <div class="hidden lg:block" style="text-align: center">
카지노->캐쉬 <span>카지노->캐쉬</span>
</div>
<div class="hidden lg:block" style="text-align: center">
<span>로그</span>
</div> </div>
<div class="hidden lg:block" style="text-align: center">로그</div>
</div> </div>
<!-- Rows --> <!-- Rows -->
<ng-container *ngIf="listMembers$ | async as mebers"> <ng-container *ngIf="listMembers$ | async as mebers">

View File

@ -12,7 +12,7 @@ import {
} from '@angular/core'; } from '@angular/core';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort'; import { MatSort, Sort } from '@angular/material/sort';
import { import {
map, map,
merge, merge,
@ -42,6 +42,9 @@ import { MemberClass } from 'app/modules/proto/models/member_class_pb';
import { MemberClassService } from 'app/modules/polyglot/member_class/services/member_class.service'; import { MemberClassService } from 'app/modules/polyglot/member_class/services/member_class.service';
import { result } from 'lodash'; import { result } from 'lodash';
import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox';
import { ListMemberLevelsResponse } from 'app/modules/proto/c2se/member_level_pb';
import { MemberLevel } from 'app/modules/proto/models/member_level_pb';
import { ListMemberClassesResponse } from 'app/modules/proto/c2se/member_class_pb';
@Component({ @Component({
selector: 'user-list', selector: 'user-list',
@ -85,6 +88,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChildren('chkUsers') chkUsers!: QueryList<MatCheckbox>; @ViewChildren('chkUsers') chkUsers!: QueryList<MatCheckbox>;
listMembers$!: Observable<MemberModel[] | undefined>; listMembers$!: Observable<MemberModel[] | undefined>;
listMemberLevels$!: Observable<MemberLevel[] | undefined>;
__isSearchOpened = false; __isSearchOpened = false;
isLoading = false; isLoading = false;
@ -133,17 +137,19 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
}); });
// Get the products
this._memberClassService
.listMemberClasss()
.then((result) => (this.memberClasses = result.getMemberClassesList()));
// Get the products // Get the products
this._activatedRoute.data.subscribe((data) => { this._activatedRoute.data.subscribe((data) => {
let listMemberResult: ListMembersResponse.Result = data['listmembers']; let listMemberResult: ListMembersResponse.Result = data['listmembers'];
this.listMembers$ = of(listMemberResult.getMembersList()); this.listMembers$ = of(listMemberResult.getMembersList());
let listMemberLevelsResult: ListMemberLevelsResponse.Result =
data['listMemberLevels'];
this.listMemberLevels$ = of(listMemberLevelsResult.getMemberLevelsList());
let listMemberClassesResult: ListMemberClassesResponse.Result =
data['listMemberClasses'];
this.memberClasses = listMemberClassesResult.getMemberClassesList();
// Mark for check // Mark for check
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
}); });
@ -355,7 +361,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
} }
__getParentUsername(member: MemberModel): string { __getParentUsername(member: MemberModel): string {
if (!member.getParentMember()) { if (!member || !member.getParentMember()) {
return ''; return '';
} }
@ -371,6 +377,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
return `[${findClass.getName()}]${parentUsername}`; return `[${findClass.getName()}]${parentUsername}`;
} }
__onMatSortChangeUsers(sort: Sort): void {}
__getMemberState(member: MemberModel): string { __getMemberState(member: MemberModel): string {
const state = member.getState(); const state = member.getState();
let resultStr = ''; let resultStr = '';

View File

@ -53,6 +53,7 @@ import { MatDrawer } from '@angular/material/sidenav';
import { FuseMediaWatcherService } from '@fuse/services/media-watcher'; import { FuseMediaWatcherService } from '@fuse/services/media-watcher';
import { FuseAlertType } from '@fuse/components/alert'; import { FuseAlertType } from '@fuse/components/alert';
import { MatSelectChange } from '@angular/material/select'; import { MatSelectChange } from '@angular/material/select';
import { ListMemberLevelsResponse } from 'app/modules/proto/c2se/member_level_pb';
import { import {
UpdateMemberBankAccountForExchangePasswordRequest, UpdateMemberBankAccountForExchangePasswordRequest,
UpdateMemberBankAccountRequest, UpdateMemberBankAccountRequest,
@ -298,7 +299,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
}); });
this._memberLevelService.listMemberLevels().then((result) => { /* this._memberLevelService.listMemberLevels().then((result) => {
this.memberLevels = result this.memberLevels = result
.getMemberLevelsList() .getMemberLevelsList()
.filter((v) => !!v.getShow()); .filter((v) => !!v.getShow());
@ -307,7 +308,8 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
.get('levelName') .get('levelName')
?.setValue(this.currentMember?.getMemberLevel()?.getName()); ?.setValue(this.currentMember?.getMemberLevel()?.getName());
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
}); }); */
this._bankService.listBanks().then((result) => { this._bankService.listBanks().then((result) => {
this.memberBankForm.get('bankName')?.value; this.memberBankForm.get('bankName')?.value;
@ -340,6 +342,11 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
state: this.currentMember?.getState(), state: this.currentMember?.getState(),
nickname: this.currentMember?.getNickname(), nickname: this.currentMember?.getNickname(),
}); });
let listMemberLevelsResult: ListMemberLevelsResponse.Result =
data['listMemberLevels'];
this.memberLevels = listMemberLevelsResult.getMemberLevelsList();
// Mark for check // Mark for check
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
}); });

View File

@ -0,0 +1,53 @@
import { Injectable } from '@angular/core';
import {
ActivatedRouteSnapshot,
Resolve,
Router,
RouterStateSnapshot,
} from '@angular/router';
import { MemberClassService } from 'app/modules/polyglot/member_class/services/member_class.service';
import {
ListMemberClassesRequest,
ListMemberClassesResponse,
} from 'app/modules/proto/c2se/member_class_pb';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class ListMemberClassesResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(
private _router: Router,
private __memberClassService: MemberClassService
) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<ListMemberClassesResponse.Result>
| Promise<ListMemberClassesResponse.Result>
| ListMemberClassesResponse.Result {
let search = new ListMemberClassesRequest.Search();
search.setShow(true);
let req = new ListMemberClassesRequest();
req.setSearch(search);
return this.__memberClassService.listMemberClasss(req);
}
}

View File

@ -0,0 +1,54 @@
import { Injectable } from '@angular/core';
import {
ActivatedRouteSnapshot,
Resolve,
Router,
RouterStateSnapshot,
} from '@angular/router';
import { MemberLevelService } from 'app/modules/polyglot/member_level/services/member_level.service';
import {
ListMemberLevelsRequest,
ListMemberLevelsResponse,
} from 'app/modules/proto/c2se/member_level_pb';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class ListMemberLevelsResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(
private _router: Router,
private __memberLevelService: MemberLevelService
) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<ListMemberLevelsResponse.Result>
| Promise<ListMemberLevelsResponse.Result>
| ListMemberLevelsResponse.Result {
let search = new ListMemberLevelsRequest.Search();
search.setShow(true);
let req = new ListMemberLevelsRequest();
req.setSearch(search);
return this.__memberLevelService.listMemberLevels(req);
}
}

View File

@ -215,30 +215,3 @@ export class BanksResolver implements Resolve<any> {
return this._bankService.listBanks(); return this._bankService.listBanks();
} }
} }
export class MemberLevelsResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(private _memberLevelService: MemberLevelService) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<ListMemberLevelsResponse.Result>
| Promise<ListMemberLevelsResponse.Result>
| ListMemberLevelsResponse.Result {
return this._memberLevelService.listMemberLevels();
}
}

View File

@ -2,6 +2,8 @@ import { Route } from '@angular/router';
import { ListComponent } from 'app/modules/admin/member/user/components/list.component'; import { ListComponent } from 'app/modules/admin/member/user/components/list.component';
import { ViewComponent } from 'app/modules/admin/member/user/components/view.component'; import { ViewComponent } from 'app/modules/admin/member/user/components/view.component';
import { ListMemberClassesResolver } from './resolvers/member-class.resolver';
import { ListMemberLevelsResolver } from './resolvers/member-level.resolver';
import { MemberResolver, ListMemberResolver } from './resolvers/user.resolver'; import { MemberResolver, ListMemberResolver } from './resolvers/user.resolver';
@ -11,9 +13,8 @@ export const userRoutes: Route[] = [
component: ListComponent, component: ListComponent,
resolve: { resolve: {
listmembers: ListMemberResolver, listmembers: ListMemberResolver,
// listMemberLevels: MemberLevelsResolver, listMemberClasses: ListMemberClassesResolver,
// listSite: SitesResolver, listMemberLevels: ListMemberLevelsResolver,
// listBanks: BanksResolver,
}, },
}, },
{ {
@ -21,6 +22,7 @@ export const userRoutes: Route[] = [
component: ViewComponent, component: ViewComponent,
resolve: { resolve: {
member: MemberResolver, member: MemberResolver,
listMemberLevels: ListMemberLevelsResolver,
}, },
}, },
]; ];

View File

@ -62,10 +62,10 @@ export class MemberClassService {
}); });
} }
listMemberClasss(): Promise<ListMemberClassesResponse.Result> { listMemberClasss(
req: ListMemberClassesRequest
): Promise<ListMemberClassesResponse.Result> {
return new Promise<ListMemberClassesResponse.Result>((resolve, reject) => { return new Promise<ListMemberClassesResponse.Result>((resolve, reject) => {
let req = new ListMemberClassesRequest();
this.__natsService this.__natsService
.request<ListMemberClassesResponse.Result>( .request<ListMemberClassesResponse.Result>(
SUBJECT_LIST_MEMBER_CLASSES, SUBJECT_LIST_MEMBER_CLASSES,

View File

@ -62,10 +62,10 @@ export class MemberLevelService {
}); });
} }
listMemberLevels(): Promise<ListMemberLevelsResponse.Result> { listMemberLevels(
req: ListMemberLevelsRequest
): Promise<ListMemberLevelsResponse.Result> {
return new Promise<ListMemberLevelsResponse.Result>((resolve, reject) => { return new Promise<ListMemberLevelsResponse.Result>((resolve, reject) => {
let req = new ListMemberLevelsRequest();
this.__natsService this.__natsService
.request<ListMemberLevelsResponse.Result>( .request<ListMemberLevelsResponse.Result>(
SUBJECT_LIST_MEMBER_LEVELS, SUBJECT_LIST_MEMBER_LEVELS,