From 1f3f60f59f18ebf8b1adfe02e5e2549ef8bb3ea0 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Fri, 12 Aug 2022 07:59:05 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=EC=A7=84=ED=96=89=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compose/regist-compose.component.html | 28 +++++++++++++++++-- .../compose/regist-compose.component.ts | 2 ++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/app/modules/admin/member/partner/compose/regist-compose.component.html b/src/app/modules/admin/member/partner/compose/regist-compose.component.html index bc2548e..2676df1 100644 --- a/src/app/modules/admin/member/partner/compose/regist-compose.component.html +++ b/src/app/modules/admin/member/partner/compose/regist-compose.component.html @@ -98,12 +98,23 @@ - + + + + 정산종류 + + + 롤링 + + + 정산종류는 필수 입력입니다. + @@ -116,12 +127,25 @@ 은행명 - + + + + {{ bank.getName() }} + + 은행명은 필수 입력입니다. + + 계좌번호 diff --git a/src/app/modules/admin/member/partner/compose/regist-compose.component.ts b/src/app/modules/admin/member/partner/compose/regist-compose.component.ts index 74d4491..70907ef 100644 --- a/src/app/modules/admin/member/partner/compose/regist-compose.component.ts +++ b/src/app/modules/admin/member/partner/compose/regist-compose.component.ts @@ -9,6 +9,7 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; import { IdentityService } from 'app/modules/polyglot/member/services/identity.service'; +import { Bank } from 'app/modules/protobuf/models/account/bank_pb'; import { Site } from 'app/modules/protobuf/models/domain/site_pb'; import { MemberModel } from 'app/modules/protobuf/models/member/member_pb'; @@ -16,6 +17,7 @@ export interface RegistComposeData { title: string; parent: MemberModel; sites: Site[]; + banks: Bank[]; } export interface RegistComposeResult { parentId: string; From bc2f869bd92543227f2cb2a7478f4b8edf49ff98 Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Fri, 12 Aug 2022 09:23:10 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=EA=B4=80=EB=A6=AC-=EC=88=98=EC=88=98?= =?UTF-8?q?=EB=A3=8C=EC=84=A4=EC=A0=95=20=ED=8C=9D=EC=97=85=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partner/components/list.component.html | 7 +- .../partner/components/list.component.ts | 10 ++ .../compose/commission-compose.component.html | 96 ++++++++++++++++++ .../compose/commission-compose.component.ts | 99 +++++++++++++++++++ .../admin/member/partner/compose/index.ts | 7 +- .../admin/member/partner/partner.module.ts | 2 + 6 files changed, 219 insertions(+), 2 deletions(-) create mode 100644 src/app/modules/admin/member/partner/compose/commission-compose.component.html create mode 100644 src/app/modules/admin/member/partner/compose/commission-compose.component.ts diff --git a/src/app/modules/admin/member/partner/components/list.component.html b/src/app/modules/admin/member/partner/components/list.component.html index ba78492..94d8247 100644 --- a/src/app/modules/admin/member/partner/components/list.component.html +++ b/src/app/modules/admin/member/partner/components/list.component.html @@ -93,7 +93,12 @@ - + diff --git a/src/app/modules/admin/member/partner/components/list.component.ts b/src/app/modules/admin/member/partner/components/list.component.ts index 584b05c..f2b3a92 100644 --- a/src/app/modules/admin/member/partner/components/list.component.ts +++ b/src/app/modules/admin/member/partner/components/list.component.ts @@ -34,6 +34,7 @@ import { PartnerService } from '../services/partner.service'; import { ActivatedRoute, Router } from '@angular/router'; import { RegistComposeComponent } from '../compose/regist-compose.component'; import { CashComposeComponent } from '../compose/cash-compose.component'; +import { CommissionComposeComponent } from '../compose/commission-compose.component'; import { MatDialog } from '@angular/material/dialog'; import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; @@ -256,6 +257,15 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { console.log('Compose dialog was closed!'); }); } + __onClickCommission(event: MouseEvent): void { + const dialogRef = this._matDialog.open(CommissionComposeComponent, { + data: { price: '', memo: '' }, + }); + + dialogRef.afterClosed().subscribe((result) => { + console.log('Compose dialog was closed!'); + }); + } __getRateTooltop(): string { const tempRate = 0; diff --git a/src/app/modules/admin/member/partner/compose/commission-compose.component.html b/src/app/modules/admin/member/partner/compose/commission-compose.component.html new file mode 100644 index 0000000..3c40fc8 --- /dev/null +++ b/src/app/modules/admin/member/partner/compose/commission-compose.component.html @@ -0,0 +1,96 @@ +
+ +
+
수수료 변경
+ +
+ + +
+
+
카지노 요율
+ + + 바카라 + 2.00 + + %(최소 2 ~ 최대 5)        + + + 룰렛 + 2.00 + + %(최소 1.8 ~ 최대 5) +
+ + + 드레곤타이거 + 2.00 + + %(최소 1.8 ~ 최대 5)      + + + 기타게임 + 2.00 + + %(최소 1.5 ~ 최대 5) +
+ + +
+ + 슬롯요율 + 5.00 + + %(최소 4 ~ 최대 5) +
+ +
+ + + 카지노 루징 + 50.00 + + %(최소 40 ~ 최대 50) +     + + + 슬롯 루징 + 50.00 + + %(최소 40 ~ 최대 50) +
+ +
+
+ + + + +
+
+
+
diff --git a/src/app/modules/admin/member/partner/compose/commission-compose.component.ts b/src/app/modules/admin/member/partner/compose/commission-compose.component.ts new file mode 100644 index 0000000..02c47df --- /dev/null +++ b/src/app/modules/admin/member/partner/compose/commission-compose.component.ts @@ -0,0 +1,99 @@ +import { + ChangeDetectorRef, + Component, + Inject, + OnInit, + ViewEncapsulation, +} from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; +import { IdentityService } from 'app/modules/polyglot/member/services/identity.service'; +import { Site } from 'app/modules/protobuf/models/domain/site_pb'; + +export interface CommissionComposeData { + price: string; + memo: string; +} +export interface CommissionComposeResult { + price: string; + memo: string; +} + +@Component({ + selector: 'app-commission-compose', + templateUrl: './commission-compose.component.html', + encapsulation: ViewEncapsulation.None, +}) +export class CommissionComposeComponent implements OnInit { + composeForm!: FormGroup; + sites: any[] = []; + // quillModules: any = { + // toolbar: [ + // ['bold', 'italic', 'underline'], + // [{ align: [] }, { list: 'ordered' }, { list: 'bullet' }], + // ['clean'], + // ], + // }; + + /** + * Constructor + */ + constructor( + public matDialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: CommissionComposeData, + private _formBuilder: FormBuilder, + private _identityService: IdentityService, + private _changeDetectorRef: ChangeDetectorRef + ) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On init + */ + ngOnInit(): void { + // Create the form + this.composeForm = this._formBuilder.group({ + bacaraRate: ['', [Validators.required]], + rouletteRate: ['', [Validators.required]], + dragonTigerRate: ['', [Validators.required]], + otherGameRate: ['', [Validators.required]], + slotRate: ['', [Validators.required]], + casinoLoosing: ['', [Validators.required]], + slotLoosing: ['', [Validators.required]], + }); + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Save and close + */ + saveAndClose(): void { + // Save the message as a draft + this.saveAsDraft(); + + // Close the dialog + this.matDialogRef.close(); + } + + /** + * Discard the message + */ + discard(): void {} + + /** + * Save the message as a draft + */ + saveAsDraft(): void {} + + /** + * Send the message + */ + send(): void {} +} diff --git a/src/app/modules/admin/member/partner/compose/index.ts b/src/app/modules/admin/member/partner/compose/index.ts index 5ebd8ef..9c9216f 100644 --- a/src/app/modules/admin/member/partner/compose/index.ts +++ b/src/app/modules/admin/member/partner/compose/index.ts @@ -1,4 +1,9 @@ import { RegistComposeComponent } from './regist-compose.component'; import { CashComposeComponent } from './cash-compose.component'; +import { CommissionComposeComponent } from './commission-compose.component'; -export const COMPOSE = [RegistComposeComponent, CashComposeComponent]; +export const COMPOSE = [ + RegistComposeComponent, + CashComposeComponent, + CommissionComposeComponent, +]; diff --git a/src/app/modules/admin/member/partner/partner.module.ts b/src/app/modules/admin/member/partner/partner.module.ts index 6a10331..e96fe66 100644 --- a/src/app/modules/admin/member/partner/partner.module.ts +++ b/src/app/modules/admin/member/partner/partner.module.ts @@ -16,6 +16,7 @@ import { MatTooltipModule } from '@angular/material/tooltip'; import { MatGridListModule } from '@angular/material/grid-list'; import { MatMenuModule } from '@angular/material/menu'; import { MatRadioModule } from '@angular/material/radio'; +import { MatDividerModule } from '@angular/material/divider'; import { TranslocoModule } from '@ngneat/transloco'; @@ -51,6 +52,7 @@ import { MatDialogModule } from '@angular/material/dialog'; MatGridListModule, MatMenuModule, MatRadioModule, + MatDividerModule, ], }) export class PartnerModule {} From f0a850bbebd7892abeb824098de840ff28d31e33 Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Fri, 12 Aug 2022 09:25:34 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=EC=98=A4=ED=83=80=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/components/list.component.html | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/app/modules/admin/settings/domain/components/list.component.html b/src/app/modules/admin/settings/domain/components/list.component.html index 601946d..9947e48 100644 --- a/src/app/modules/admin/settings/domain/components/list.component.html +++ b/src/app/modules/admin/settings/domain/components/list.component.html @@ -217,17 +217,24 @@
- -도메인 www.을 빼고 등록해야 합니다.(ex:demo.com) - -만료일은 도메인 구입처(구입당시)에서 확인가능합니다. (등록하지 - 않으면 등록날짜 기준으로 365 남은기간이 설정됩니다.) - -메모란을 등록하셔서 도메인을 관리하시면 좋습니다. (150자 이하로 - 등록해주세요.) +

+ -도메인 www.을 빼고 등록해야 합니다.(ex:demo.com) +

+

+ -만료일은 도메인 구입처(구입당시)에서 확인가능합니다. (등록하지 + 않으면 등록날짜 기준으로 365 남은기간이 설정됩니다.) +

+ +

+ -메모란을 등록하셔서 도메인을 관리하시면 좋습니다. (150자 이하로 + 등록해주세요.) +

From 9bf22f83d3405ada56fe2f6d8937ae2b4ac7a612 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Fri, 12 Aug 2022 09:28:56 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=ED=9A=8C=EC=9B=90=20=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partner/components/list.component.ts | 17 +++- .../compose/regist-compose.component.html | 15 ++- .../compose/regist-compose.component.ts | 92 ++++++++++++++----- .../admin/member/partner/partner.module.ts | 3 + .../member/services/member.service.ts | 64 +++++-------- 5 files changed, 120 insertions(+), 71 deletions(-) diff --git a/src/app/modules/admin/member/partner/components/list.component.ts b/src/app/modules/admin/member/partner/components/list.component.ts index 584b05c..d7739a5 100644 --- a/src/app/modules/admin/member/partner/components/list.component.ts +++ b/src/app/modules/admin/member/partner/components/list.component.ts @@ -22,6 +22,7 @@ import { startWith, Subject, switchMap, + take, takeUntil, timer, } from 'rxjs'; @@ -32,7 +33,10 @@ import { Partner } from '../models/partner'; import { PartnerPagination } from '../models/partner-pagination'; import { PartnerService } from '../services/partner.service'; import { ActivatedRoute, Router } from '@angular/router'; -import { RegistComposeComponent } from '../compose/regist-compose.component'; +import { + RegistComposeComponent, + RegistComposeResult, +} from '../compose/regist-compose.component'; import { CashComposeComponent } from '../compose/cash-compose.component'; import { MatDialog } from '@angular/material/dialog'; @@ -240,12 +244,15 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { __onClickRegist(event: MouseEvent, partner: MemberModel): void { const dialogRef = this._matDialog.open(RegistComposeComponent, { - data: { title: '대본 등록하기', parent: partner, sites: this.sites }, + data: { title: '대본 등록', parent: partner, sites: this.sites }, }); - dialogRef.afterClosed().subscribe((result) => { - console.log('Compose dialog was closed!'); - }); + dialogRef + .afterClosed() + .pipe(take(1)) + .subscribe((result: RegistComposeResult) => { + console.log('Compose dialog was closed: ', result); + }); } __onClickCash(event: MouseEvent): void { const dialogRef = this._matDialog.open(CashComposeComponent, { diff --git a/src/app/modules/admin/member/partner/compose/regist-compose.component.html b/src/app/modules/admin/member/partner/compose/regist-compose.component.html index 2676df1..12b7408 100644 --- a/src/app/modules/admin/member/partner/compose/regist-compose.component.html +++ b/src/app/modules/admin/member/partner/compose/regist-compose.component.html @@ -3,7 +3,7 @@
-
{{ data.title }} 등록
+
{{ data.title }}
+ + {{ alert.message }} + +
{{ bank.getName() }} + 국민은행 은행명은 필수 입력입니다. @@ -184,6 +196,7 @@ mat-flat-button [color]="'primary'" (click)="send()" + [disabled]="isSendDisable" > 등록 diff --git a/src/app/modules/admin/member/partner/compose/regist-compose.component.ts b/src/app/modules/admin/member/partner/compose/regist-compose.component.ts index 70907ef..d860139 100644 --- a/src/app/modules/admin/member/partner/compose/regist-compose.component.ts +++ b/src/app/modules/admin/member/partner/compose/regist-compose.component.ts @@ -7,11 +7,18 @@ import { } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { FuseAlertType } from '@fuse/components/alert'; import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; import { IdentityService } from 'app/modules/polyglot/member/services/identity.service'; +import { MemberService } from 'app/modules/polyglot/member/services/member.service'; +import { + CreateMemberRequest, + CreateMemberResponse, +} from 'app/modules/protobuf/c2se/backend/member_pb'; import { Bank } from 'app/modules/protobuf/models/account/bank_pb'; import { Site } from 'app/modules/protobuf/models/domain/site_pb'; import { MemberModel } from 'app/modules/protobuf/models/member/member_pb'; +import { fuseAnimations } from '@fuse/animations'; export interface RegistComposeData { title: string; @@ -20,35 +27,25 @@ export interface RegistComposeData { banks: Bank[]; } export interface RegistComposeResult { - parentId: string; - siteName: string; - signinId: string; - password: string; - exchangePassword: string; - nickname: string; - calculateType: string; - phoneNumber: string; - bankName: string; - accountNumber: string; - accountHolder: string; + choice: boolean; } @Component({ selector: 'app-regist-compose', templateUrl: './regist-compose.component.html', encapsulation: ViewEncapsulation.None, + animations: fuseAnimations, }) export class RegistComposeComponent implements OnInit { composeForm!: FormGroup; - sites: any[] = []; - // quillModules: any = { - // toolbar: [ - // ['bold', 'italic', 'underline'], - // [{ align: [] }, { list: 'ordered' }, { list: 'bullet' }], - // ['clean'], - // ], - // }; + alert: { type: FuseAlertType; message: string } = { + type: 'success', + message: '등록이 성공하였습니다.', + }; + + showAlert: boolean = false; + isSendDisable = false; /** * Constructor */ @@ -57,10 +54,9 @@ export class RegistComposeComponent implements OnInit { @Inject(MAT_DIALOG_DATA) public data: RegistComposeData, private _formBuilder: FormBuilder, private _identityService: IdentityService, + private _memberService: MemberService, private _changeDetectorRef: ChangeDetectorRef - ) { - this.data.sites.forEach((v) => console.log(v.getUrl())); - } + ) {} // ----------------------------------------------------------------------------------------------------- // @ Lifecycle hooks @@ -113,11 +109,61 @@ export class RegistComposeComponent implements OnInit { /** * Send the message + * + } */ send(): void { - console.log(this.composeForm.value); + if (!this.composeForm.valid) { + return; + } + + this.isSendDisable = true; + + const { + partnerId, + siteName, + signinId, + password, + exchangePassword, + nickname, + calculateType, + phoneNumber, + bankName, + accountNumber, + accountHolder, + } = this.composeForm.value; + + const member = new CreateMemberRequest(); + const site = new Site(); + site.setId(siteName); + + member.setSiteId(siteName); + member.setUsername(signinId); + member.setPassword('beteran'); + member.setMemberClassId('ae9b874e-5d0e-4c4d-8432-f45f02691ceb'); + member.setMemberLevelId('c56231ac-2120-4a81-a30a-5d41fafb6c57'); + member.setReferrerMemberUsername(this.data.parent.getUsername()); + member.setNickname(nickname); + member.setMobilePhoneNumber(phoneNumber); + + this._memberService + .createMember(member) + .then((res: CreateMemberResponse.Result) => { + console.log(res.getMember()); + this.showAlert = true; + }) + .catch((e) => { + this.showAlert = true; + this.alert = { type: 'error', message: '등록에 실패하였습니다.' }; + }) + .finally(() => (this.showAlert = false)); } + private close(): void { + this.matDialogRef.close({ + choice: true, + }); + } __checkSigninId(event: FocusEvent): void { const signinId = this.composeForm.get('signinId')?.value; // console.log(event, '::', signinId); diff --git a/src/app/modules/admin/member/partner/partner.module.ts b/src/app/modules/admin/member/partner/partner.module.ts index 6a10331..659d29a 100644 --- a/src/app/modules/admin/member/partner/partner.module.ts +++ b/src/app/modules/admin/member/partner/partner.module.ts @@ -26,6 +26,7 @@ import { COMPOSE } from './compose'; import { partnerRoutes } from './partner.routing'; import { MatDialogModule } from '@angular/material/dialog'; +import { FuseAlertModule } from '@fuse/components/alert'; @NgModule({ declarations: [COMPONENTS, COMPOSE], @@ -51,6 +52,8 @@ import { MatDialogModule } from '@angular/material/dialog'; MatGridListModule, MatMenuModule, MatRadioModule, + + FuseAlertModule, ], }) export class PartnerModule {} diff --git a/src/app/modules/polyglot/member/services/member.service.ts b/src/app/modules/polyglot/member/services/member.service.ts index a694a0a..ac31f64 100644 --- a/src/app/modules/polyglot/member/services/member.service.ts +++ b/src/app/modules/polyglot/member/services/member.service.ts @@ -17,8 +17,12 @@ import { UpdateMemberRequest, UpdateMemberResponse, SUBJECT_UPDATE_MEMBER, + CreateMemberResponse, + CreateMemberRequest, + SUBJECT_CREATE_MEMBER, } from 'app/modules/protobuf/c2se/backend/member_pb'; import { Pagination } from 'app/modules/protobuf/protobuf/pagination/pagination_pb'; +import { MemberModel } from 'app/modules/protobuf/models/member/member_pb'; @Injectable({ providedIn: 'root', @@ -157,46 +161,22 @@ export class MemberService { // classId: 4b014ef5-3bab-4413-aaf9-b0040a70ec77 // levelId: c56231ac-2120-4a81-a30a-5d41fafb6c57 - // createMember( - // siteId: string = '8429a7ab-b9de-400b-a209-28ff46e22bec', - // memberLevelId: string = 'c56231ac-2120-4a81-a30a-5d41fafb6c57', - // classId: string = '4b014ef5-3bab-4413-aaf9-b0040a70ec77', - // signinId: string, - // nickname: string, - // password: string, - // mobilePhoneNumber: string - // ): Promise { - // return new Promise((resolve, reject) => { - // let req = new UpdateMemberRequest(); - // req.setId(id); - - // if (!!siteId) { - // req.setSiteId(siteId); - // } - // if (!!memberLevelId) { - // req.setMemberLevelId(memberLevelId); - // } - // if (!!password) { - // req.setPassword(password); - // } - // if (!!mobilePhoneNumber) { - // req.setMobilePhoneNumber(mobilePhoneNumber); - // } - - // this.__natsService - // .request( - // SUBJECT_UPDATE_MEMBER, - // req.serializeBinary(), - // UpdateMemberResponse.deserializeBinary - // ) - // .then((result) => { - // console.log('updateMember Result: ', result); - // resolve(result); - // }) - // .catch((e: Error) => { - // console.log('failed', e); - // reject(e); - // }); - // }); - // } + createMember(req: CreateMemberRequest): Promise { + return new Promise((resolve, reject) => { + this.__natsService + .request( + SUBJECT_CREATE_MEMBER, + req.serializeBinary(), + CreateMemberResponse.deserializeBinary + ) + .then((result) => { + console.log('createMember Result: ', result); + resolve(result); + }) + .catch((e: Error) => { + console.log('failed', e); + reject(e); + }); + }); + } }