member-settlement, member-game create resolver

This commit is contained in:
Park Byung Eun 2022-08-25 08:37:51 +00:00
parent 15dacd7b52
commit 42c02fcd56
7 changed files with 213 additions and 3 deletions

View File

@ -447,6 +447,7 @@
type="text"
matInput
[formControlName]="'bacaraRate'"
style="width: 40%"
/>
<div class="mt-1 text-md text-hint">
%(최소 0 ~ 최대 0.2)
@ -458,6 +459,7 @@
type="text"
matInput
[formControlName]="'rulletRate'"
style="width: 40%"
/>
<div class="mt-1 text-md text-hint">
%(최소 0 ~ 최대 0.2)
@ -469,6 +471,7 @@
type="text"
matInput
[formControlName]="'dragonRate'"
style="width: 40%"
/>
<div class="mt-1 text-md text-hint">
%(최소 0 ~ 최대 0.2)
@ -479,7 +482,12 @@
<div class="flex">
<mat-form-field class="w-1/3 pr-2">
<mat-label>기타 게임 요율</mat-label>
<input type="text" matInput [formControlName]="'etcRate'" />
<input
type="text"
matInput
[formControlName]="'etcRate'"
style="width: 40%"
/>
<div class="mt-1 text-md text-hint">
%(최소 0 ~ 최대 0.2)
</div>
@ -490,6 +498,7 @@
type="text"
matInput
[formControlName]="'slotRate'"
style="width: 40%"
/>
<div class="mt-1 text-md text-hint">
%(최소 0 ~ 최대 0.2)
@ -501,6 +510,7 @@
type="text"
matInput
[formControlName]="'casinoRusingRate'"
style="width: 40%"
/>
<div class="mt-1 text-md text-hint">
%(최소 0 ~ 최대 0.2)
@ -514,6 +524,7 @@
type="text"
matInput
[formControlName]="'slotRusingRate'"
style="width: 40%"
/>
<div class="mt-1 text-md text-hint">
%(최소 0 ~ 최대 0.2)

View File

@ -62,6 +62,11 @@ import { MemberBankAccountService } from 'app/modules/polyglot/member_bank_accou
import { ListBanksResponse } from 'app/modules/proto/c2se/bank_pb';
import { ListMemberClassesResponse } from 'app/modules/proto/c2se/member_class_pb';
import { ListSitesResponse } from 'app/modules/proto/c2se/site_pb';
import {
GetMemberSettlementSettingResponse,
ListMemberSettlementSettingsResponse,
} from 'app/modules/proto/c2se/member_settlement_setting_pb';
import { MemberSettlementSetting } from 'app/modules/proto/models/member_settlement_setting_pb';
@Component({
selector: 'user-view',
@ -142,6 +147,8 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
selectedPanel: string = 'accountInfo';
memberLevels!: MemberLevel[];
memberSettlement!: MemberSettlementSetting;
banks!: Bank[];
sites!: Site[];
@ -306,6 +313,15 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
let listSitesResult: ListSitesResponse.Result = data['listSites'];
this.sites = listSitesResult.getSitesList();
/*
let memberSettlementResult: GetMemberSettlementSettingResponse.Result =
data['memberSettlement'];
const memberSettlement =
memberSettlementResult.getMemberSettlementSetting();
if (!!memberSettlement) {
this.memberSettlement = memberSettlement;
} */
this.memberDefaultForm.patchValue({
username: this.currentMember?.getUsername(),

View File

@ -0,0 +1,86 @@
import { Injectable } from '@angular/core';
import {
ActivatedRouteSnapshot,
Resolve,
Router,
RouterStateSnapshot,
} from '@angular/router';
import { MemberGameSettingService } from 'app/modules/polyglot/member_game_setting/services/member_game_setting.service';
import {
GetMemberGameSettingResponse,
ListMemberGameSettingsResponse,
} from 'app/modules/proto/c2se/member_game_setting_pb';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class ListMemberGameResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(
private _router: Router,
private __memberGameSettingService: MemberGameSettingService
) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<ListMemberGameSettingsResponse.Result>
| Promise<ListMemberGameSettingsResponse.Result>
| ListMemberGameSettingsResponse.Result {
return this.__memberGameSettingService.listMemberGameSettings();
}
}
@Injectable({
providedIn: 'root',
})
export class MemberGameSettingResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(
private _router: Router,
private __memberGameSettingService: MemberGameSettingService
) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<GetMemberGameSettingResponse.Result>
| Promise<GetMemberGameSettingResponse.Result>
| GetMemberGameSettingResponse.Result {
let memberId = route.paramMap.get('id');
if (!memberId) {
console.error('user.resolver memberId is null');
}
return this.__memberGameSettingService.getMemberGameSetting(memberId!);
}
}

View File

@ -0,0 +1,87 @@
import { Injectable } from '@angular/core';
import {
ActivatedRouteSnapshot,
Resolve,
Router,
RouterStateSnapshot,
} from '@angular/router';
import { MemberSettlementSettingService } from 'app/modules/polyglot/member_settlement_setting/services/member_settlement_setting.service';
import {
GetMemberSettlementSettingResponse,
ListMemberSettlementSettingsResponse,
} from 'app/modules/proto/c2se/member_settlement_setting_pb';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class ListMemberSettlementsResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(
private _router: Router,
private __memberSettlementSettingService: MemberSettlementSettingService
) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<ListMemberSettlementSettingsResponse.Result>
| Promise<ListMemberSettlementSettingsResponse.Result>
| ListMemberSettlementSettingsResponse.Result {
return this.__memberSettlementSettingService.listMemberSettlementSettings();
}
}
@Injectable({
providedIn: 'root',
})
export class MemberSettlementResolver implements Resolve<any> {
/**
* Constructor
*/
constructor(
private _router: Router,
private __memberSettlementSettingService: MemberSettlementSettingService
) {}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Resolver
*
* @param route
* @param state
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
):
| Observable<GetMemberSettlementSettingResponse.Result>
| Promise<GetMemberSettlementSettingResponse.Result>
| GetMemberSettlementSettingResponse.Result {
let memberId = route.paramMap.get('id');
if (!memberId) {
console.error('user.resolver memberId is null');
}
return this.__memberSettlementSettingService.getMemberSettlementSetting(
memberId!
);
}
}

View File

@ -5,7 +5,9 @@ import { ViewComponent } from 'app/modules/admin/member/user/components/view.com
import { SiteResolver } from 'app/shared/resolvers/site.resolver';
import { ListMemberBanksResolver } from './resolvers/member-bank.resolver';
import { ListMemberClassesResolver } from './resolvers/member-class.resolver';
import { MemberGameSettingResolver } from './resolvers/member-game-setting.resolver';
import { ListMemberLevelsResolver } from './resolvers/member-level.resolver';
import { MemberSettlementResolver } from './resolvers/member-settlement-setting.resolver';
import { MemberResolver, ListMemberResolver } from './resolvers/user.resolver';
@ -27,6 +29,8 @@ export const userRoutes: Route[] = [
listMemberLevels: ListMemberLevelsResolver,
listMemberBanks: ListMemberBanksResolver,
listSites: SiteResolver,
// memberSettlement: MemberSettlementResolver,
// memberGame: MemberGameSettingResolver,
},
},
];

View File

@ -87,10 +87,13 @@ export class MemberGameSettingService {
);
}
getMemberGameSetting(): Promise<GetMemberGameSettingResponse.Result> {
getMemberGameSetting(
id: string
): Promise<GetMemberGameSettingResponse.Result> {
return new Promise<GetMemberGameSettingResponse.Result>(
(resolve, reject) => {
let req = new GetMemberGameSettingRequest();
req.setId(id);
this.__natsService
.request<GetMemberGameSettingResponse.Result>(

View File

@ -91,10 +91,13 @@ export class MemberSettlementSettingService {
);
}
getMemberSettlementSetting(): Promise<GetMemberSettlementSettingResponse.Result> {
getMemberSettlementSetting(
id: string
): Promise<GetMemberSettlementSettingResponse.Result> {
return new Promise<GetMemberSettlementSettingResponse.Result>(
(resolve, reject) => {
let req = new GetMemberSettlementSettingRequest();
req.setId(id);
this.__natsService
.request<GetMemberSettlementSettingResponse.Result>(