게임설정 수정 완료
This commit is contained in:
parent
c0e1345eec
commit
f20682f2be
|
@ -612,17 +612,26 @@
|
|||
>
|
||||
<div class="flex">
|
||||
<span class="w-1/3 pr-2">
|
||||
<mat-slide-toggle [color]="'primary'">
|
||||
<mat-slide-toggle
|
||||
[formControlName]="'canBetPowerball'"
|
||||
[color]="'primary'"
|
||||
>
|
||||
파워볼베팅
|
||||
</mat-slide-toggle>
|
||||
</span>
|
||||
<span class="w-1/3 pr-2">
|
||||
<mat-slide-toggle [color]="'primary'">
|
||||
<mat-slide-toggle
|
||||
[formControlName]="'canBetCasino'"
|
||||
[color]="'primary'"
|
||||
>
|
||||
카지노 베팅
|
||||
</mat-slide-toggle>
|
||||
</span>
|
||||
<span class="w-1/3 pr-2">
|
||||
<mat-slide-toggle [color]="'primary'">
|
||||
<mat-slide-toggle
|
||||
[formControlName]="'canBetSlot'"
|
||||
[color]="'primary'"
|
||||
>
|
||||
슬롯베팅
|
||||
</mat-slide-toggle>
|
||||
</span>
|
||||
|
|
|
@ -16,23 +16,13 @@ import {
|
|||
ValidatorFn,
|
||||
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 { Observable, Subject, takeUntil } from 'rxjs';
|
||||
import { fuseAnimations } from '@fuse/animations';
|
||||
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
||||
|
||||
import { User } from '../models/user';
|
||||
import { UserService } from '../services/user.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import {
|
||||
GetMemberResponse,
|
||||
|
@ -42,11 +32,9 @@ import {
|
|||
} from 'app/modules/proto/c2se/member_pb';
|
||||
import { MemberModel, MemberState } from 'app/modules/proto/models/member_pb';
|
||||
import { MemberService } from 'app/modules/polyglot/member/services/member.service';
|
||||
import { MemberLevelService } from 'app/modules/polyglot/member_level/services/member_level.service';
|
||||
import { BankService } from 'app/modules/polyglot/bank/services/bank.service';
|
||||
import { MemberLevel } from 'app/modules/proto/models/member_level_pb';
|
||||
import { Bank } from 'app/modules/proto/models/bank_pb';
|
||||
import { SiteService } from 'app/modules/polyglot/site/services/site.service';
|
||||
|
||||
import { Site } from 'app/modules/proto/models/site_pb';
|
||||
import { MatDrawer } from '@angular/material/sidenav';
|
||||
|
||||
|
@ -60,18 +48,16 @@ import {
|
|||
} from 'app/modules/proto/c2se/member_bank_account_pb';
|
||||
import { MemberBankAccountService } from 'app/modules/polyglot/member_bank_account/services/member_bank_account.service';
|
||||
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,
|
||||
UpdateMemberSettlementSettingRequest,
|
||||
} from 'app/modules/proto/c2se/member_settlement_setting_pb';
|
||||
import { UpdateMemberSettlementSettingRequest } from 'app/modules/proto/c2se/member_settlement_setting_pb';
|
||||
import {
|
||||
ManualPaymentType,
|
||||
MemberSettlementSetting,
|
||||
} from 'app/modules/proto/models/member_settlement_setting_pb';
|
||||
import { MemberSettlementSettingService } from 'app/modules/polyglot/member_settlement_setting/services/member_settlement_setting.service';
|
||||
import { UpdateMemberGameSettingRequest } from 'app/modules/proto/c2se/member_game_setting_pb';
|
||||
import { MemberGameSettingService } from 'app/modules/polyglot/member_game_setting/services/member_game_setting.service';
|
||||
|
||||
@Component({
|
||||
selector: 'user-view',
|
||||
|
@ -178,7 +164,8 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
private _formBuilder: FormBuilder,
|
||||
private _memberService: MemberService,
|
||||
private _memberBankAccountService: MemberBankAccountService,
|
||||
private _memberSettlementSettingService: MemberSettlementSettingService
|
||||
private _memberSettlementSettingService: MemberSettlementSettingService,
|
||||
private _memberGameSettingService: MemberGameSettingService
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
@ -230,7 +217,11 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
manualPaymentTypeForPartner: ['', [Validators.required]],
|
||||
});
|
||||
|
||||
this.memberGameSettingForm = this._formBuilder.group({});
|
||||
this.memberGameSettingForm = this._formBuilder.group({
|
||||
canBetPowerball: [],
|
||||
canBetCasino: [],
|
||||
canBetSlot: [],
|
||||
});
|
||||
|
||||
this.passwordConfirmConfigForm = this._formBuilder.group({
|
||||
title: '알림',
|
||||
|
@ -321,6 +312,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
this.sites = listSitesResult.getSitesList();
|
||||
|
||||
const memberSettlement = this.currentMember?.getMemberSettlementSetting();
|
||||
const memberGameSetting = this.currentMember?.getMemberGameSetting();
|
||||
|
||||
this.memberDefaultForm.patchValue({
|
||||
username: this.currentMember?.getUsername(),
|
||||
|
@ -340,8 +332,6 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
description: this.currentMember?.getBankAccount()?.getMemo(),
|
||||
});
|
||||
|
||||
console.log('canExchange: ', memberSettlement?.getCanExchange());
|
||||
|
||||
this.memberSettleForm.patchValue({
|
||||
rateCasinoBacara: memberSettlement?.getRateCasinoBacara(),
|
||||
rateCasinoRoulette: memberSettlement?.getRateCasinoRoulette(),
|
||||
|
@ -357,6 +347,12 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
memberSettlement?.getManualPaymentTypeForPartner(),
|
||||
});
|
||||
|
||||
this.memberGameSettingForm.patchValue({
|
||||
canBetPowerball: memberGameSetting?.getCanBetPowerball(),
|
||||
canBetCasino: memberGameSetting?.getCanBetCasino(),
|
||||
canBetSlot: memberGameSetting?.getCanBetSlot(),
|
||||
});
|
||||
|
||||
// Mark for check
|
||||
this._changeDetectorRef.markForCheck();
|
||||
});
|
||||
|
@ -428,6 +424,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
|
||||
break;
|
||||
case 'gameInfo':
|
||||
this.modifyMemberGameSettingInfo();
|
||||
break;
|
||||
case 'historyInfo':
|
||||
break;
|
||||
|
@ -568,6 +565,27 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
})
|
||||
.finally(() => this.closeChangePasswordAlert());
|
||||
}
|
||||
|
||||
private modifyMemberGameSettingInfo(): void {
|
||||
const { canBetPowerball, canBetCasino, canBetSlot } =
|
||||
this.memberGameSettingForm.value;
|
||||
|
||||
const updateGSReq = new UpdateMemberGameSettingRequest();
|
||||
updateGSReq.setId(this.currentMember?.getMemberGameSetting()?.getId()!);
|
||||
updateGSReq.setCanBetPowerball(canBetPowerball);
|
||||
updateGSReq.setCanBetCasino(canBetCasino);
|
||||
updateGSReq.setCanBetSlot(canBetSlot);
|
||||
|
||||
this._memberGameSettingService
|
||||
.updateMemberGameSetting(updateGSReq)
|
||||
.then((result) => {
|
||||
this.showAlert('success', '수정이 완료되었습니다.');
|
||||
})
|
||||
.catch((reson) => {
|
||||
this.showAlert('error', '수정 실패 잠시 후 다시 시도하세요.');
|
||||
})
|
||||
.finally(() => this.closeChangePasswordAlert());
|
||||
}
|
||||
/**
|
||||
* Navigate to the panel
|
||||
*
|
||||
|
|
|
@ -113,11 +113,11 @@ export class MemberGameSettingService {
|
|||
);
|
||||
}
|
||||
|
||||
updateMemberGameSetting(): Promise<UpdateMemberGameSettingResponse.Result> {
|
||||
updateMemberGameSetting(
|
||||
req: UpdateMemberGameSettingRequest
|
||||
): Promise<UpdateMemberGameSettingResponse.Result> {
|
||||
return new Promise<UpdateMemberGameSettingResponse.Result>(
|
||||
(resolve, reject) => {
|
||||
let req = new UpdateMemberGameSettingRequest();
|
||||
|
||||
this.__natsService
|
||||
.request<UpdateMemberGameSettingResponse.Result>(
|
||||
SUBJECT_UPDATE_MEMBER_GAME_SETTING,
|
||||
|
|
Loading…
Reference in New Issue
Block a user