spectial model

This commit is contained in:
byung eun park 2019-10-27 20:02:57 +09:00
parent 4abdaec91a
commit 97776df744
28 changed files with 88 additions and 53 deletions

View File

@ -295,7 +295,7 @@ export const navigation: FuseNavigation[] = [
translate: 'NAV.SITE.ACCOUNT_SEPARATE.TITLE', translate: 'NAV.SITE.ACCOUNT_SEPARATE.TITLE',
type: 'item', type: 'item',
icon: 'email', icon: 'email',
url: '/pages/sites/management/bank-info' url: '/pages/sites/management/bank-accounts'
}, },
{ {
id: 'set_bet_amount', id: 'set_bet_amount',

View File

@ -1,4 +1,4 @@
<div id="bank-info" class="page-layout simple fullwidth" fxLayout="column"> <div id="bank-accounts" class="page-layout simple fullwidth" fxLayout="column">
<!-- <div id="orders" class="page-layout carded fullwidth inner-scroll"> --> <!-- <div id="orders" class="page-layout carded fullwidth inner-scroll"> -->
<!-- HEADER --> <!-- HEADER -->
<div <div

View File

@ -1,7 +1,7 @@
@import 'src/@fuse/scss/fuse'; @import 'src/@fuse/scss/fuse';
app-page-sites-bank-info-list { app-page-sites-bank-accounts-list {
#bank-info { #bank-accounts {
.top-bg { .top-bg {
@include media-breakpoint('xs') { @include media-breakpoint('xs') {
height: 224px; height: 224px;

View File

@ -10,8 +10,8 @@ import {
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { fuseAnimations } from 'src/@fuse/animations'; import { fuseAnimations } from 'src/@fuse/animations';
import { BankInfoListDataSource } from './bank-info-list.data-source'; import { BankAccountsListDataSource } from './bank-accounts-list.data-source';
import { BankInfoService } from 'src/modules/sites/service/bank-info.service'; import { BankAccountsService } from 'src/modules/sites/service/bank-accounts.service';
import { import {
FormGroup, FormGroup,
FormBuilder, FormBuilder,
@ -21,15 +21,16 @@ import {
} from '@angular/forms'; } from '@angular/forms';
@Component({ @Component({
selector: 'app-page-sites-bank-info-list', selector: 'app-bank-accounts-list',
templateUrl: './bank-info-list.component.html', templateUrl: './bank-accounts-list.component.html',
styleUrls: ['./bank-info-list.component.scss'], styleUrls: ['./bank-accounts-list.component.scss'],
animations: fuseAnimations, animations: fuseAnimations,
encapsulation: ViewEncapsulation.None encapsulation: ViewEncapsulation.None
}) })
export class BankInfoListComponent implements OnInit, OnDestroy, AfterViewInit { export class BankAccountsListComponent
dataSource: BankInfoListDataSource = new BankInfoListDataSource( implements OnInit, OnDestroy, AfterViewInit {
this.bankInfoService dataSource: BankAccountsListDataSource = new BankAccountsListDataSource(
this.bankAccountsService
); );
displayedColumns = ['id', 'name', 'number', 'holder', 'description']; displayedColumns = ['id', 'name', 'number', 'holder', 'description'];
@ -43,7 +44,7 @@ export class BankInfoListComponent implements OnInit, OnDestroy, AfterViewInit {
private _unsubscribeAll: Subject<any>; private _unsubscribeAll: Subject<any>;
constructor( constructor(
private bankInfoService: BankInfoService, private bankAccountsService: BankAccountsService,
private fb: FormBuilder private fb: FormBuilder
) { ) {
this._unsubscribeAll = new Subject(); this._unsubscribeAll = new Subject();

View File

@ -5,27 +5,27 @@ import { map } from 'rxjs/operators';
import { CollectionViewer } from '@angular/cdk/collections'; import { CollectionViewer } from '@angular/cdk/collections';
import { BankInfo } from 'src/modules/sites/model/bank-info.model'; import { BankAccounts } from 'src/modules/sites/model/bank-accounts.model';
import { BankInfoService } from 'src/modules/sites/service/bank-info.service'; import { BankAccountsService } from 'src/modules/sites/service/bank-accounts.service';
import { FormControl, FormGroup, Validators, FormArray } from '@angular/forms'; import { FormControl, FormGroup, Validators, FormArray } from '@angular/forms';
export class BankInfoListDataSource extends DataSource<BankInfo> { export class BankAccountsListDataSource extends DataSource<BankAccounts> {
private _objectStore: BankInfo[] = []; private _objectStore: BankAccounts[] = [];
private _ObjectsSubject$ = new BehaviorSubject<BankInfo[]>([]); private _ObjectsSubject$ = new BehaviorSubject<BankAccounts[]>([]);
private _loadingSubject$ = new BehaviorSubject<boolean>(false); private _loadingSubject$ = new BehaviorSubject<boolean>(false);
public loading$ = this._loadingSubject$.asObservable(); public loading$ = this._loadingSubject$.asObservable();
public formg: FormGroup; public formg: FormGroup;
constructor(private bankInfoService: BankInfoService) { constructor(private bankAccountsService: BankAccountsService) {
super(); super();
} }
connect(collectionViewer: CollectionViewer): Observable<BankInfo[]> { connect(collectionViewer: CollectionViewer): Observable<BankAccounts[]> {
return this.bankInfoService.getAllAsFormArray().pipe( return this.bankAccountsService.getAllAsFormArray().pipe(
map(res => { map(res => {
res.forEach(m => this._objectStore.push(m as BankInfo)); res.forEach(m => this._objectStore.push(m as BankAccounts));
this._ObjectsSubject$.next(this._objectStore); this._ObjectsSubject$.next(this._objectStore);
let fa = <FormArray>this.formg.get('formarray'); let fa = <FormArray>this.formg.get('formarray');
res.forEach(r => fa.push(this.createRowFormGroup(r))); res.forEach(r => fa.push(this.createRowFormGroup(r)));
@ -34,7 +34,7 @@ export class BankInfoListDataSource extends DataSource<BankInfo> {
); );
} }
createRowFormGroup(r: BankInfo): FormGroup { createRowFormGroup(r: BankAccounts): FormGroup {
let f = new FormGroup({ let f = new FormGroup({
id: this.createNewFormContorl(r, 'id'), id: this.createNewFormContorl(r, 'id'),
name: this.createNewFormContorl(r, 'name'), name: this.createNewFormContorl(r, 'name'),
@ -45,7 +45,7 @@ export class BankInfoListDataSource extends DataSource<BankInfo> {
return f; return f;
} }
createNewFormContorl(r: BankInfo, propName: string): FormControl { createNewFormContorl(r: BankAccounts, propName: string): FormControl {
let m = new FormControl(r[propName], Validators.required); let m = new FormControl(r[propName], Validators.required);
m.valueChanges.subscribe(val => { m.valueChanges.subscribe(val => {
r[propName] = val; r[propName] = val;

View File

@ -1,5 +1,5 @@
import { DefaultConfigComponent } from './default-config.component'; import { DefaultConfigComponent } from './default-config.component';
import { BankInfoListComponent } from './bank-info-list.component'; import { BankAccountsListComponent } from './bank-accounts-list.component';
import { BetAmountComponent } from './bet-amount.component'; import { BetAmountComponent } from './bet-amount.component';
import { BlockIpComponent } from './block-ip.component'; import { BlockIpComponent } from './block-ip.component';
import { AdminIpComponent } from './admin-ip.component'; import { AdminIpComponent } from './admin-ip.component';
@ -7,7 +7,7 @@ import { LevelComponent } from './level.component';
export const COMPONENTS = [ export const COMPONENTS = [
DefaultConfigComponent, DefaultConfigComponent,
BankInfoListComponent, BankAccountsListComponent,
BetAmountComponent, BetAmountComponent,
BlockIpComponent, BlockIpComponent,
AdminIpComponent, AdminIpComponent,

View File

@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { DefaultConfigComponent } from './component/default-config.component'; import { DefaultConfigComponent } from './component/default-config.component';
import { BankInfoListComponent } from './component/bank-info-list.component'; import { BankAccountsListComponent } from './component/bank-accounts-list.component';
import { BetAmountComponent } from './component/bet-amount.component'; import { BetAmountComponent } from './component/bet-amount.component';
import { BlockIpComponent } from './component/block-ip.component'; import { BlockIpComponent } from './component/block-ip.component';
import { AdminIpComponent } from './component/admin-ip.component'; import { AdminIpComponent } from './component/admin-ip.component';
@ -14,8 +14,8 @@ const routes: Routes = [
component: DefaultConfigComponent component: DefaultConfigComponent
}, },
{ {
path: 'bank-info', path: 'bank-accounts',
component: BankInfoListComponent component: BankAccountsListComponent
}, },
{ {
path: 'bet-amount', path: 'bet-amount',

View File

@ -11,7 +11,7 @@ import { FormGroup, FormBuilder, FormArray } from '@angular/forms';
import { fuseAnimations } from 'src/@fuse/animations'; import { fuseAnimations } from 'src/@fuse/animations';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { FixBonusDataSource } from './fix-bonus.data-source'; import { FixBonusDataSource } from './fix-bonus.data-source';
import { FixBonusService } from 'src/modules/special/fix-bonus/service/fix-bonus.service'; import { FixBonusService } from 'src/modules/special/service/fix-bonus.service';
@Component({ @Component({
selector: 'app-fix-bonus', selector: 'app-fix-bonus',

View File

@ -5,8 +5,8 @@ import { map } from 'rxjs/operators';
import { CollectionViewer } from '@angular/cdk/collections'; import { CollectionViewer } from '@angular/cdk/collections';
import { FixBonus } from 'src/modules/special/fix-bonus/model/fix-bonus.model'; import { FixBonus } from 'src/modules/special/model/fix-bonus.model';
import { FixBonusService } from 'src/modules/special/fix-bonus/service/fix-bonus.service'; import { FixBonusService } from 'src/modules/special/service/fix-bonus.service';
import { FormControl, FormGroup, Validators, FormArray } from '@angular/forms'; import { FormControl, FormGroup, Validators, FormArray } from '@angular/forms';

View File

@ -12,7 +12,7 @@ import { FormGroup, FormBuilder, FormArray } from '@angular/forms';
import { fuseAnimations } from 'src/@fuse/animations'; import { fuseAnimations } from 'src/@fuse/animations';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { RouletteCouponDataSource } from './roulette-coupon.data-source'; import { RouletteCouponDataSource } from './roulette-coupon.data-source';
import { RouletteCouponService } from 'src/modules/special/roulette-coupon/service/roulette-coupon.service'; import { RouletteCouponService } from 'src/modules/special/service/roulette-coupon.service';
@Component({ @Component({
selector: 'app-roulette-coupon', selector: 'app-roulette-coupon',

View File

@ -5,8 +5,8 @@ import { map } from 'rxjs/operators';
import { CollectionViewer } from '@angular/cdk/collections'; import { CollectionViewer } from '@angular/cdk/collections';
import { RouletteCoupon } from 'src/modules/special/roulette-coupon/model/roulette-coupon.model'; import { RouletteCoupon } from 'src/modules/special/model/roulette-coupon.model';
import { RouletteCouponService } from 'src/modules/special/roulette-coupon/service/roulette-coupon.service'; import { RouletteCouponService } from 'src/modules/special/service/roulette-coupon.service';
import { FormControl, FormGroup, Validators, FormArray } from '@angular/forms'; import { FormControl, FormGroup, Validators, FormArray } from '@angular/forms';

View File

@ -1,6 +1,6 @@
import { DateAudit } from 'src/modules/common/data/model/audit'; import { DateAudit } from 'src/modules/common/data/model/audit';
export interface BankInfo extends DateAudit { export interface BankAccounts extends DateAudit {
id?: number; id?: number;
name?: string; name?: string;
number?: string; number?: string;

View File

@ -3,7 +3,7 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators'; import { map, takeUntil } from 'rxjs/operators';
import { BankInfo } from '../model/bank-info.model'; import { BankAccounts } from '../model/bank-accounts.model';
import { API_BASE_URL } from 'src/modules/common/type/injection-token.type'; import { API_BASE_URL } from 'src/modules/common/type/injection-token.type';
import { Page } from 'src/modules/common/data/model/page'; import { Page } from 'src/modules/common/data/model/page';
import { FormArray } from '@angular/forms'; import { FormArray } from '@angular/forms';
@ -11,21 +11,21 @@ import { FormArray } from '@angular/forms';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class BankInfoService { export class BankAccountsService {
constructor( constructor(
@Inject(API_BASE_URL) private apiBaseUrl: string, @Inject(API_BASE_URL) private apiBaseUrl: string,
private httpClient: HttpClient private httpClient: HttpClient
) {} ) {}
public getBankInfos(): Observable<Page<BankInfo>> { public getBankInfos(): Observable<Page<BankAccounts>> {
return this.httpClient.get<Page<BankInfo>>( return this.httpClient.get<Page<BankAccounts>>(
`${this.apiBaseUrl}/bank_info`, `${this.apiBaseUrl}/bank_info`,
{} {}
); );
} }
public getAllAsFormArray(): Observable<BankInfo[]> { public getAllAsFormArray(): Observable<BankAccounts[]> {
return this.httpClient.get<BankInfo[]>( return this.httpClient.get<BankAccounts[]>(
`${this.apiBaseUrl}/bank_info/test`, `${this.apiBaseUrl}/bank_info/test`,
{} {}
); );

View File

@ -1,3 +1,3 @@
import { BankInfoService } from './bank-info.service'; import { BankAccountsService } from './bank-accounts.service';
export const SERVICES = [BankInfoService]; export const SERVICES = [BankAccountsService];

View File

@ -1,3 +0,0 @@
import { FixBonusService } from './fix-bonus.service';
export const FIX_BONUS_SERVICES = [FixBonusService];

View File

@ -0,0 +1,10 @@
import { UserDateAuditEntity } from 'src/modules/common/data/model/audit';
import { AlertConfigName } from '../type/alert-config-type';
export interface AlertConfig extends UserDateAuditEntity {
id?: number;
name?: string;
filePath?: string;
fileName?: string;
alertType?: AlertConfigName;
}

View File

@ -0,0 +1,7 @@
import { UserDateAuditEntity } from 'src/modules/common/data/model/audit';
export interface CheckNotice extends UserDateAuditEntity {
id?: number;
enable?: boolean;
contents?: string;
}

View File

@ -0,0 +1,8 @@
import { UserDateAuditEntity } from 'src/modules/common/data/model/audit';
export interface MartinConfig extends UserDateAuditEntity {
id?: number;
name?: string;
refEnable?: boolean;
bettingOdds?: number;
}

View File

@ -1,3 +0,0 @@
import { RouletteCouponService } from './roulette-coupon.service';
export const ROULETTE_COUPON_SERVICES = [RouletteCouponService];

View File

@ -0,0 +1,4 @@
import { RouletteCouponService } from './roulette-coupon.service';
import { FixBonusService } from './fix-bonus.service';
export const SERVICES = [RouletteCouponService, FixBonusService];

View File

@ -1,7 +1,6 @@
import { NgModule, ModuleWithProviders } from '@angular/core'; import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { FIX_BONUS_SERVICES } from './fix-bonus/service'; import { SERVICES } from './service';
import { ROULETTE_COUPON_SERVICES } from './roulette-coupon/service';
@NgModule({ @NgModule({
imports: [], imports: [],
exports: [] exports: []
@ -17,7 +16,7 @@ export class SpecialModule {
public static forRoot(): ModuleWithProviders<SpecialRootModule> { public static forRoot(): ModuleWithProviders<SpecialRootModule> {
return { return {
ngModule: SpecialRootModule, ngModule: SpecialRootModule,
providers: [FIX_BONUS_SERVICES, ROULETTE_COUPON_SERVICES] providers: [SERVICES]
}; };
} }
} }

View File

@ -0,0 +1,12 @@
export enum AlertConfigName {
DEPOSIT = 'DEPOSIT',
WITHDRAW = 'WITHDRAW',
QNA_USER = 'QNA_USER',
NEW_USER = 'NEW_USER',
NEW_BOARD = 'NEW_BOARD',
WARNING_BETTING_LIMIT = 'WARNING_BETTING_LIMIT',
BETTING = 'BETTING',
WATCH_USER = 'WATCH_USER',
SEND_MESSAGE = 'SEND_MESSAGE',
ANSWER_MESSAGE = 'ANSWER_MESSAGE'
}