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..fddc3fe 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,8 +33,12 @@ 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 { CommissionComposeComponent } from '../compose/commission-compose.component'; import { MatDialog } from '@angular/material/dialog'; import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; @@ -240,15 +245,27 @@ 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() + .pipe(take(1)) + .subscribe((result: RegistComposeResult) => { + console.log('Compose dialog was closed: ', result); + }); + } + __onClickCash(event: MouseEvent): void { + const dialogRef = this._matDialog.open(CashComposeComponent, { + data: { price: '', memo: '' }, }); dialogRef.afterClosed().subscribe((result) => { console.log('Compose dialog was closed!'); }); } - __onClickCash(event: MouseEvent): void { - const dialogRef = this._matDialog.open(CashComposeComponent, { + __onClickCommission(event: MouseEvent): void { + const dialogRef = this._matDialog.open(CommissionComposeComponent, { data: { price: '', memo: '' }, }); 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/compose/regist-compose.component.html b/src/app/modules/admin/member/partner/compose/regist-compose.component.html index bc2548e..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 }} + +
- + + + + 정산종류 + + + 롤링 + + + 정산종류는 필수 입력입니다. + @@ -116,12 +138,26 @@ 은행명 - + + + + {{ bank.getName() }} + + 국민은행 + 은행명은 필수 입력입니다. + + 계좌번호 @@ -160,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 74d4491..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,46 +7,45 @@ 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; parent: MemberModel; sites: Site[]; + 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 */ @@ -55,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 @@ -111,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..cd90cff 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'; @@ -26,6 +27,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 +53,9 @@ import { MatDialogModule } from '@angular/material/dialog'; MatGridListModule, MatMenuModule, MatRadioModule, + MatDividerModule, + + FuseAlertModule, ], }) export class PartnerModule {} 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자 이하로 + 등록해주세요.) +

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); + }); + }); + } }