게임설정 수정 완료

This commit is contained in:
Park Byung Eun 2022-08-26 06:43:18 +00:00
parent c0e1345eec
commit f20682f2be
3 changed files with 58 additions and 31 deletions

View File

@ -612,17 +612,26 @@
> >
<div class="flex"> <div class="flex">
<span class="w-1/3 pr-2"> <span class="w-1/3 pr-2">
<mat-slide-toggle [color]="'primary'"> <mat-slide-toggle
[formControlName]="'canBetPowerball'"
[color]="'primary'"
>
파워볼베팅 파워볼베팅
</mat-slide-toggle> </mat-slide-toggle>
</span> </span>
<span class="w-1/3 pr-2"> <span class="w-1/3 pr-2">
<mat-slide-toggle [color]="'primary'"> <mat-slide-toggle
[formControlName]="'canBetCasino'"
[color]="'primary'"
>
카지노 베팅 카지노 베팅
</mat-slide-toggle> </mat-slide-toggle>
</span> </span>
<span class="w-1/3 pr-2"> <span class="w-1/3 pr-2">
<mat-slide-toggle [color]="'primary'"> <mat-slide-toggle
[formControlName]="'canBetSlot'"
[color]="'primary'"
>
슬롯베팅 슬롯베팅
</mat-slide-toggle> </mat-slide-toggle>
</span> </span>

View File

@ -16,23 +16,13 @@ import {
ValidatorFn, ValidatorFn,
Validators, Validators,
} from '@angular/forms'; } from '@angular/forms';
import { MatCheckboxChange } from '@angular/material/checkbox';
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort'; import { MatSort } from '@angular/material/sort';
import { import { Observable, Subject, takeUntil } from 'rxjs';
debounceTime,
map,
merge,
Observable,
Subject,
switchMap,
takeUntil,
} from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmationService } from '@fuse/services/confirmation'; import { FuseConfirmationService } from '@fuse/services/confirmation';
import { User } from '../models/user';
import { UserService } from '../services/user.service';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { import {
GetMemberResponse, GetMemberResponse,
@ -42,11 +32,9 @@ import {
} from 'app/modules/proto/c2se/member_pb'; } from 'app/modules/proto/c2se/member_pb';
import { MemberModel, MemberState } from 'app/modules/proto/models/member_pb'; import { MemberModel, MemberState } from 'app/modules/proto/models/member_pb';
import { MemberService } from 'app/modules/polyglot/member/services/member.service'; 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 { MemberLevel } from 'app/modules/proto/models/member_level_pb';
import { Bank } from 'app/modules/proto/models/bank_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 { Site } from 'app/modules/proto/models/site_pb';
import { MatDrawer } from '@angular/material/sidenav'; import { MatDrawer } from '@angular/material/sidenav';
@ -60,18 +48,16 @@ import {
} from 'app/modules/proto/c2se/member_bank_account_pb'; } from 'app/modules/proto/c2se/member_bank_account_pb';
import { MemberBankAccountService } from 'app/modules/polyglot/member_bank_account/services/member_bank_account.service'; import { MemberBankAccountService } from 'app/modules/polyglot/member_bank_account/services/member_bank_account.service';
import { ListBanksResponse } from 'app/modules/proto/c2se/bank_pb'; 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 { ListSitesResponse } from 'app/modules/proto/c2se/site_pb';
import { import { UpdateMemberSettlementSettingRequest } from 'app/modules/proto/c2se/member_settlement_setting_pb';
GetMemberSettlementSettingResponse,
ListMemberSettlementSettingsResponse,
UpdateMemberSettlementSettingRequest,
} from 'app/modules/proto/c2se/member_settlement_setting_pb';
import { import {
ManualPaymentType, ManualPaymentType,
MemberSettlementSetting, MemberSettlementSetting,
} from 'app/modules/proto/models/member_settlement_setting_pb'; } from 'app/modules/proto/models/member_settlement_setting_pb';
import { MemberSettlementSettingService } from 'app/modules/polyglot/member_settlement_setting/services/member_settlement_setting.service'; 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({ @Component({
selector: 'user-view', selector: 'user-view',
@ -178,7 +164,8 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private _memberService: MemberService, private _memberService: MemberService,
private _memberBankAccountService: MemberBankAccountService, 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]], manualPaymentTypeForPartner: ['', [Validators.required]],
}); });
this.memberGameSettingForm = this._formBuilder.group({}); this.memberGameSettingForm = this._formBuilder.group({
canBetPowerball: [],
canBetCasino: [],
canBetSlot: [],
});
this.passwordConfirmConfigForm = this._formBuilder.group({ this.passwordConfirmConfigForm = this._formBuilder.group({
title: '알림', title: '알림',
@ -321,6 +312,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
this.sites = listSitesResult.getSitesList(); this.sites = listSitesResult.getSitesList();
const memberSettlement = this.currentMember?.getMemberSettlementSetting(); const memberSettlement = this.currentMember?.getMemberSettlementSetting();
const memberGameSetting = this.currentMember?.getMemberGameSetting();
this.memberDefaultForm.patchValue({ this.memberDefaultForm.patchValue({
username: this.currentMember?.getUsername(), username: this.currentMember?.getUsername(),
@ -340,8 +332,6 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
description: this.currentMember?.getBankAccount()?.getMemo(), description: this.currentMember?.getBankAccount()?.getMemo(),
}); });
console.log('canExchange: ', memberSettlement?.getCanExchange());
this.memberSettleForm.patchValue({ this.memberSettleForm.patchValue({
rateCasinoBacara: memberSettlement?.getRateCasinoBacara(), rateCasinoBacara: memberSettlement?.getRateCasinoBacara(),
rateCasinoRoulette: memberSettlement?.getRateCasinoRoulette(), rateCasinoRoulette: memberSettlement?.getRateCasinoRoulette(),
@ -357,6 +347,12 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
memberSettlement?.getManualPaymentTypeForPartner(), memberSettlement?.getManualPaymentTypeForPartner(),
}); });
this.memberGameSettingForm.patchValue({
canBetPowerball: memberGameSetting?.getCanBetPowerball(),
canBetCasino: memberGameSetting?.getCanBetCasino(),
canBetSlot: memberGameSetting?.getCanBetSlot(),
});
// Mark for check // Mark for check
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
}); });
@ -428,6 +424,7 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
break; break;
case 'gameInfo': case 'gameInfo':
this.modifyMemberGameSettingInfo();
break; break;
case 'historyInfo': case 'historyInfo':
break; break;
@ -568,6 +565,27 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy {
}) })
.finally(() => this.closeChangePasswordAlert()); .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 * Navigate to the panel
* *

View File

@ -113,11 +113,11 @@ export class MemberGameSettingService {
); );
} }
updateMemberGameSetting(): Promise<UpdateMemberGameSettingResponse.Result> { updateMemberGameSetting(
req: UpdateMemberGameSettingRequest
): Promise<UpdateMemberGameSettingResponse.Result> {
return new Promise<UpdateMemberGameSettingResponse.Result>( return new Promise<UpdateMemberGameSettingResponse.Result>(
(resolve, reject) => { (resolve, reject) => {
let req = new UpdateMemberGameSettingRequest();
this.__natsService this.__natsService
.request<UpdateMemberGameSettingResponse.Result>( .request<UpdateMemberGameSettingResponse.Result>(
SUBJECT_UPDATE_MEMBER_GAME_SETTING, SUBJECT_UPDATE_MEMBER_GAME_SETTING,