Merge branch 'feature/BETERAN-BACKEND-APP-BROWSER-init' of https://gitlab.loafle.net/bet/beteran-backend-app-browser into feature/BETERAN-BACKEND-APP-BROWSER-init

This commit is contained in:
이담 정 2022-08-19 08:36:12 +00:00
commit c59a1b50de
12 changed files with 351 additions and 26 deletions

View File

@ -28,6 +28,7 @@ import { MemberBankDepositModule } from 'app/modules/polyglot/member_bank_deposi
import { MemberBankWithdrawModule } from 'app/modules/polyglot/member_bank_withdraw/member_bank_withdraw.module';
import { MemberClassModule } from 'app/modules/polyglot/member_class/member_class.module';
import { MemberLevelModule } from 'app/modules/polyglot/member_level/member_level.module';
import { MemberReferrerModule } from 'app/modules/polyglot/member_referrer/member_referrer.module';
import { MemberModule } from 'app/modules/polyglot/member/member.module';
import { SiteModule } from 'app/modules/polyglot/site/site.module';
@ -70,6 +71,7 @@ const routerConfig: ExtraOptions = {
MemberBankWithdrawModule.forRoot(),
MemberClassModule.forRoot(),
MemberLevelModule.forRoot(),
MemberReferrerModule.forRoot(),
MemberModule.forRoot(),
SiteModule.forRoot(),

View File

@ -25,21 +25,23 @@
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef>
<mat-checkbox
(change)="$event ? __toggleAllRows() : null"
[checked]="selection.hasValue() && __isAllSelected()"
[indeterminate]="
selection.hasValue() && !__isAllSelected()
(change)="$event ? __registToggleAllRows() : null"
[checked]="
registSelection.hasValue() && __registIsAllSelected()
"
[aria-label]="__checkboxLabel()"
[indeterminate]="
registSelection.hasValue() && !__registIsAllSelected()
"
[aria-label]="__registCheckboxLabel()"
>
</mat-checkbox>
</th>
<td mat-cell *matCellDef="let row">
<mat-checkbox
(click)="$event.stopPropagation()"
(change)="$event ? selection.toggle(row) : null"
[checked]="selection.isSelected(row)"
[aria-label]="__checkboxLabel(row)"
(change)="$event ? registSelection.toggle(row) : null"
[checked]="registSelection.isSelected(row)"
[aria-label]="__registCheckboxLabel(row)"
>
</mat-checkbox>
</td>
@ -181,21 +183,23 @@
<ng-container matColumnDef="select">
<th mat-header-cell *matHeaderCellDef>
<mat-checkbox
(change)="$event ? __toggleAllRows() : null"
[checked]="selection.hasValue() && __isAllSelected()"
[indeterminate]="
selection.hasValue() && !__isAllSelected()
(change)="$event ? __removeToggleAllRows() : null"
[checked]="
removeSelection.hasValue() && __removeIsAllSelected()
"
[aria-label]="__checkboxLabel()"
[indeterminate]="
removeSelection.hasValue() && !__removeIsAllSelected()
"
[aria-label]="__removeCheckboxLabel()"
>
</mat-checkbox>
</th>
<td mat-cell *matCellDef="let row">
<mat-checkbox
(click)="$event.stopPropagation()"
(change)="$event ? selection.toggle(row) : null"
[checked]="selection.isSelected(row)"
[aria-label]="__checkboxLabel(row)"
(change)="$event ? removeSelection.toggle(row) : null"
[checked]="removeSelection.isSelected(row)"
[aria-label]="__removeCheckboxLabel(row)"
>
</mat-checkbox>
</td>

View File

@ -114,7 +114,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
selectedPartnerRecommendation?: PartnerRecommendation;
pagination?: PartnerRecommendationPagination;
selection = new SelectionModel<MemberModel>(true, []);
registSelection = new SelectionModel<MemberModel>(true, []);
removeSelection = new SelectionModel<MemberModel>(true, []);
addBtnConfigForm!: FormGroup;
removeBtnConfigForm!: FormGroup;
@ -236,30 +237,56 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
// -----------------------------------------------------------------------------------------------------
/** Selects all rows if they are not all selected; otherwise clear selection. */
__toggleAllRows() {
if (this.__isAllSelected()) {
this.selection.clear();
__registToggleAllRows() {
if (this.__registIsAllSelected()) {
this.registSelection.clear();
return;
}
this.selection.select(...this.registPartnerStoreDataSource.data);
this.registSelection.select(...this.registPartnerStoreDataSource.data);
}
__isAllSelected() {
const numSelected = this.selection.selected.length;
__registIsAllSelected() {
const numSelected = this.registSelection.selected.length;
const numRows = this.registPartnerStoreDataSource.data.length;
return numSelected === numRows;
}
/** The label for the checkbox on the passed row */
__checkboxLabel(row?: MemberModel): string {
__registCheckboxLabel(row?: MemberModel): string {
if (!row) {
return `${this.__isAllSelected() ? 'deselect' : 'select'} all`;
return `${this.__registIsAllSelected() ? 'deselect' : 'select'} all`;
}
return `${
this.selection.isSelected(row) ? 'deselect' : 'select'
this.registSelection.isSelected(row) ? 'deselect' : 'select'
} row ${row.getUsername()}`;
}
__removeToggleAllRows() {
if (this.__removeIsAllSelected()) {
this.removeSelection.clear();
return;
}
this.removeSelection.select(...this.removePartnerStoreDataSource.data);
}
__removeIsAllSelected() {
const numSelected = this.removeSelection.selected.length;
const numRows = this.removePartnerStoreDataSource.data.length;
return numSelected === numRows;
}
/** The label for the checkbox on the passed row */
__removeCheckboxLabel(row?: MemberModel): string {
if (!row) {
return `${this.__removeIsAllSelected() ? 'deselect' : 'select'} all`;
}
return `${
this.removeSelection.isSelected(row) ? 'deselect' : 'select'
} row ${row.getUsername()}`;
}
/**
* Create product
*/

View File

@ -0,0 +1,16 @@
import { ModuleWithProviders, NgModule } from '@angular/core';
import { SERVICES } from './services';
@NgModule({})
export class MemberReferrerRootModule {}
@NgModule({})
export class MemberReferrerModule {
public static forRoot(): ModuleWithProviders<MemberReferrerRootModule> {
return {
ngModule: MemberReferrerRootModule,
providers: [...SERVICES],
};
}
}

View File

@ -0,0 +1,5 @@
import { Type } from '@angular/core';
import { MemberReferrerService } from './member_referrer.service';
export const SERVICES: Type<any>[] = [MemberReferrerService];

View File

@ -0,0 +1,156 @@
import { Injectable } from '@angular/core';
import { NatsService } from 'app/core/nats/services/nats.service';
import * as nats from 'nats.ws';
import { Error } from 'app/modules/proto/protobuf/rpc_pb';
import {
ListMemberReferrersRequest,
ListMemberReferrersResponse,
CreateMemberReferrerRequest,
CreateMemberReferrerResponse,
UpdateMemberReferrerRequest,
UpdateMemberReferrerResponse,
DeleteMemberReferrerRequest,
DeleteMemberReferrerResponse,
GetMemberReferrerResponse,
GetMemberReferrerRequest,
} from 'app/modules/proto/c2se/member_referrer_pb';
import {
SUBJECT_LIST_MEMBER_REFERRERS,
SUBJECT_CREATE_MEMBER_REFERRER,
SUBJECT_UPDATE_MEMBER_REFERRER,
SUBJECT_DELETE_MEMBER_REFERRER,
SUBJECT_GET_MEMBER_REFERRER,
} from 'app/modules/proto/c2se/backend/member_referrer_pb';
@Injectable({
providedIn: 'root',
})
export class MemberReferrerService {
/**
* Constructor
*/
constructor(private __natsService: NatsService) {}
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
createMemberReferrer(): Promise<CreateMemberReferrerResponse.Result> {
return new Promise<CreateMemberReferrerResponse.Result>(
(resolve, reject) => {
let req = new CreateMemberReferrerRequest();
this.__natsService
.request<CreateMemberReferrerResponse.Result>(
SUBJECT_CREATE_MEMBER_REFERRER,
req.serializeBinary(),
CreateMemberReferrerResponse.deserializeBinary
)
.then((result) => {
console.log('success', result, result.getMemberReferrer());
return resolve(result);
})
.catch((e: Error) => {
console.log('failed', e);
return reject(e);
});
}
);
}
listMemberReferrers(): Promise<ListMemberReferrersResponse.Result> {
return new Promise<ListMemberReferrersResponse.Result>(
(resolve, reject) => {
let req = new ListMemberReferrersRequest();
this.__natsService
.request<ListMemberReferrersResponse.Result>(
SUBJECT_LIST_MEMBER_REFERRERS,
req.serializeBinary(),
ListMemberReferrersResponse.deserializeBinary
)
.then((result) => {
console.log('success', result, result.getMemberReferrersList());
return resolve(result);
})
.catch((e: Error) => {
console.log('failed', e);
reject(e);
});
}
);
}
getMemberReferrer(): Promise<GetMemberReferrerResponse.Result> {
return new Promise<GetMemberReferrerResponse.Result>((resolve, reject) => {
let req = new GetMemberReferrerRequest();
this.__natsService
.request<GetMemberReferrerResponse.Result>(
SUBJECT_GET_MEMBER_REFERRER,
req.serializeBinary(),
GetMemberReferrerResponse.deserializeBinary
)
.then((result) => {
console.log('success', result, result.getMemberReferrer());
return resolve(result);
})
.catch((e: Error) => {
console.log('failed', e);
return reject(e);
});
});
}
updateMemberReferrer(): Promise<UpdateMemberReferrerResponse.Result> {
return new Promise<UpdateMemberReferrerResponse.Result>(
(resolve, reject) => {
let req = new UpdateMemberReferrerRequest();
this.__natsService
.request<UpdateMemberReferrerResponse.Result>(
SUBJECT_UPDATE_MEMBER_REFERRER,
req.serializeBinary(),
UpdateMemberReferrerResponse.deserializeBinary
)
.then((result) => {
console.log('success', result, result.getMemberReferrer());
return resolve(result);
})
.catch((e: Error) => {
console.log('failed', e);
return reject(e);
});
}
);
}
deleteMemberReferrer(): Promise<DeleteMemberReferrerResponse.Result> {
return new Promise<DeleteMemberReferrerResponse.Result>(
(resolve, reject) => {
let req = new DeleteMemberReferrerRequest();
this.__natsService
.request<DeleteMemberReferrerResponse.Result>(
SUBJECT_DELETE_MEMBER_REFERRER,
req.serializeBinary(),
DeleteMemberReferrerResponse.deserializeBinary
)
.then((result) => {
console.log('success', result);
return resolve(result);
})
.catch((e: Error) => {
console.log('failed', e);
return reject(e);
});
}
);
}
}

View File

@ -0,0 +1,10 @@
// package: bet.beteran.c2se.backend.member_level
// file: c2se/backend/member_level.proto
import * as jspb from 'google-protobuf';
export const SUBJECT_CREATE_MEMBER_REFERRER: string;
export const SUBJECT_LIST_MEMBER_REFERRERS: string;
export const SUBJECT_GET_MEMBER_REFERRER: string;
export const SUBJECT_UPDATE_MEMBER_REFERRER: string;
export const SUBJECT_DELETE_MEMBER_REFERRER: string;

View File

@ -0,0 +1,39 @@
// source: c2se/backend/member_referrer.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require("google-protobuf");
var goog = jspb;
var global = function () {
return this || window || global || self || Function("return this")();
}.call(null);
goog.exportSymbol(
"proto.bet.beteran.c2se.backend.member_referrer",
null,
global
);
proto.bet.beteran.c2se.backend.member_referrer = {};
proto.bet.beteran.c2se.backend.member_referrer.SUBJECT_CREATE_MEMBER_REFERRER =
"bet.beteran.c2se.backend.member_referrer.CreateMemberReferrer";
proto.bet.beteran.c2se.backend.member_referrer.SUBJECT_LIST_MEMBER_REFERRERS =
"bet.beteran.c2se.backend.member_referrer.ListMemberReferrers";
proto.bet.beteran.c2se.backend.member_referrer.SUBJECT_GET_MEMBER_REFERRER =
"bet.beteran.c2se.backend.member_referrer.GetMemberReferrer";
proto.bet.beteran.c2se.backend.member_referrer.SUBJECT_UPDATE_MEMBER_REFERRER =
"bet.beteran.c2se.backend.member_referrer.UpdateMemberReferrer";
proto.bet.beteran.c2se.backend.member_referrer.SUBJECT_DELETE_MEMBER_REFERRER =
"bet.beteran.c2se.backend.member_referrer.DeleteMemberReferrer";
goog.object.extend(exports, proto.bet.beteran.c2se.backend.member_referrer);

View File

@ -0,0 +1,6 @@
// package: bet.beteran.c2se.frontend.api.game
// file: c2se/frontend/api/game.proto
import * as jspb from 'google-protobuf';
export const SUBJECT_LIST_GAMES: string;

View File

@ -0,0 +1,27 @@
// source: c2se/frontend/api/game.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require("google-protobuf");
var goog = jspb;
var global = function () {
return this || window || global || self || Function("return this")();
}.call(null);
goog.exportSymbol("proto.bet.beteran.c2se.frontend.api.game", null, global);
proto.bet.beteran.c2se.frontend.api.game = {};
proto.bet.beteran.c2se.frontend.api.game.SUBJECT_LIST_GAMES =
"bet.beteran.c2se.frontend.api.game.ListGames";
goog.object.extend(exports, proto.bet.beteran.c2se.frontend.api.game);

View File

@ -0,0 +1,6 @@
// package: bet.beteran.c2se.frontend.api.vendor
// file: c2se/frontend/api/vendor.proto
import * as jspb from 'google-protobuf';
export const SUBJECT_LIST_VENDORS: string;

View File

@ -0,0 +1,27 @@
// source: c2se/frontend/api/vendor.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require("google-protobuf");
var goog = jspb;
var global = function () {
return this || window || global || self || Function("return this")();
}.call(null);
goog.exportSymbol("proto.bet.beteran.c2se.frontend.api.vendor", null, global);
proto.bet.beteran.c2se.frontend.api.vendor = {};
proto.bet.beteran.c2se.frontend.api.vendor.SUBJECT_LIST_VENDORS =
"bet.beteran.c2se.frontend.api.vendor.ListVendors";
goog.object.extend(exports, proto.bet.beteran.c2se.frontend.api.vendor);