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:
Park Byung Eun 2022-08-04 11:47:07 +00:00
commit 05a54fa16f
41 changed files with 533 additions and 507 deletions

View File

@ -423,25 +423,25 @@ export const appRoutes: Route[] = [
).then((m: any) => m.PaymentLogModule), ).then((m: any) => m.PaymentLogModule),
}, },
{ {
path: 'sessionin-info', path: 'user-session',
loadChildren: () => loadChildren: () =>
import( import(
'app/modules/admin/report/sessionin-info/sessionin-info.module' 'app/modules/admin/report/user-session/user-session.module'
).then((m: any) => m.SessioninInfoModule), ).then((m: any) => m.UserSessionModule),
}, },
{ {
path: 'sessionin-overlap', path: 'duplicated-session',
loadChildren: () => loadChildren: () =>
import( import(
'app/modules/admin/report/sessionin-overlap/sessionin-overlap.module' 'app/modules/admin/report/duplicated-session/duplicated-session.module'
).then((m: any) => m.SessioninOverlapModule), ).then((m: any) => m.DuplicatedSessionModule),
}, },
{ {
path: 'sessionin-admin', path: 'admin-session',
loadChildren: () => loadChildren: () =>
import( import(
'app/modules/admin/report/sessionin-admin/sessionin-admin.module' 'app/modules/admin/report/admin-session/admin-session.module'
).then((m: any) => m.SessioninAdminModule), ).then((m: any) => m.AdminSessionModule),
}, },
{ {
path: 'excel-log', path: 'excel-log',

View File

@ -1,13 +1,13 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { assign, cloneDeep } from 'lodash-es'; import { assign, cloneDeep } from 'lodash-es';
import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api'; import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api';
import { sessioninAdmins as sessioninAdminsData } from './data'; import { adminSessions as adminSessionsData } from './data';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class ReportSessioninAdminMockApi { export class ReportAdminSessionMockApi {
private _sessioninAdmins: any[] = sessioninAdminsData; private _adminSessions: any[] = adminSessionsData;
/** /**
* Constructor * Constructor
@ -26,10 +26,10 @@ export class ReportSessioninAdminMockApi {
*/ */
registerHandlers(): void { registerHandlers(): void {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninAdmins - GET // @ AdminSessions - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/report/sessionin-admin/sessionin-admins', 300) .onGet('api/apps/report/admin-session/admin-sessions', 300)
.reply(({ request }) => { .reply(({ request }) => {
// Get available queries // Get available queries
const search = request.params.get('search'); const search = request.params.get('search');
@ -38,12 +38,12 @@ export class ReportSessioninAdminMockApi {
const page = parseInt(request.params.get('page') ?? '1', 10); const page = parseInt(request.params.get('page') ?? '1', 10);
const size = parseInt(request.params.get('size') ?? '10', 10); const size = parseInt(request.params.get('size') ?? '10', 10);
// Clone the sessioninAdmins // Clone the adminSessions
let sessioninAdmins: any[] | null = cloneDeep(this._sessioninAdmins); let adminSessions: any[] | null = cloneDeep(this._adminSessions);
// Sort the sessioninAdmins // Sort the adminSessions
// if (sort === 'sku' || sort === 'name' || sort === 'active') { // if (sort === 'sku' || sort === 'name' || sort === 'active') {
// sessioninAdmins.sort((a, b) => { // adminSessions.sort((a, b) => {
// const fieldA = a[sort].toString().toUpperCase(); // const fieldA = a[sort].toString().toUpperCase();
// const fieldB = b[sort].toString().toUpperCase(); // const fieldB = b[sort].toString().toUpperCase();
// return order === 'asc' // return order === 'asc'
@ -51,15 +51,15 @@ export class ReportSessioninAdminMockApi {
// : fieldB.localeCompare(fieldA); // : fieldB.localeCompare(fieldA);
// }); // });
// } else { // } else {
// sessioninAdmins.sort((a, b) => // adminSessions.sort((a, b) =>
// order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] // order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort]
// ); // );
// } // }
// If search exists... // If search exists...
if (search) { if (search) {
// Filter the sessioninAdmins // Filter the adminSessions
sessioninAdmins = sessioninAdmins.filter( adminSessions = adminSessions.filter(
(contact: any) => (contact: any) =>
contact.name && contact.name &&
contact.name.toLowerCase().includes(search.toLowerCase()) contact.name.toLowerCase().includes(search.toLowerCase())
@ -67,32 +67,32 @@ export class ReportSessioninAdminMockApi {
} }
// Paginate - Start // Paginate - Start
const sessioninAdminsLength = sessioninAdmins.length; const adminSessionsLength = adminSessions.length;
// Calculate pagination details // Calculate pagination details
const begin = page * size; const begin = page * size;
const end = Math.min(size * (page + 1), sessioninAdminsLength); const end = Math.min(size * (page + 1), adminSessionsLength);
const lastPage = Math.max(Math.ceil(sessioninAdminsLength / size), 1); const lastPage = Math.max(Math.ceil(adminSessionsLength / size), 1);
// Prepare the pagination object // Prepare the pagination object
let pagination = {}; let pagination = {};
// If the requested page number is bigger than // If the requested page number is bigger than
// the last possible page number, return null for // the last possible page number, return null for
// sessioninAdmins but also send the last possible page so // adminSessions but also send the last possible page so
// the app can navigate to there // the app can navigate to there
if (page > lastPage) { if (page > lastPage) {
sessioninAdmins = null; adminSessions = null;
pagination = { pagination = {
lastPage, lastPage,
}; };
} else { } else {
// Paginate the results by size // Paginate the results by size
sessioninAdmins = sessioninAdmins.slice(begin, end); adminSessions = adminSessions.slice(begin, end);
// Prepare the pagination mock-api // Prepare the pagination mock-api
pagination = { pagination = {
length: sessioninAdminsLength, length: adminSessionsLength,
size: size, size: size,
page: page, page: page,
lastPage: lastPage, lastPage: lastPage,
@ -105,41 +105,39 @@ export class ReportSessioninAdminMockApi {
return [ return [
200, 200,
{ {
sessioninAdmins, adminSessions,
pagination, pagination,
}, },
]; ];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninAdmin - GET // @ AdminSession - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/report/sessionin-admin/sessionin-admin') .onGet('api/apps/report/admin-session/admin-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id from the params // Get the id from the params
const id = request.params.get('id'); const id = request.params.get('id');
// Clone the sessioninAdmins // Clone the adminSessions
const sessioninAdmins = cloneDeep(this._sessioninAdmins); const adminSessions = cloneDeep(this._adminSessions);
// Find the sessioninAdmin // Find the adminSession
const sessioninAdmin = sessioninAdmins.find( const adminSession = adminSessions.find((item: any) => item.id === id);
(item: any) => item.id === id
);
// Return the response // Return the response
return [200, sessioninAdmin]; return [200, adminSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninAdmin - POST // @ AdminSession - POST
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPost('api/apps/report/sessionin-admin/sessionin-admin') .onPost('api/apps/report/admin-session/admin-session')
.reply(() => { .reply(() => {
// Generate a new sessioninAdmin // Generate a new adminSession
const newSessioninAdmin = { const newAdminSession = {
id: FuseMockApiUtils.guid(), id: FuseMockApiUtils.guid(),
category: '', category: '',
name: 'A New User', name: 'A New User',
@ -161,58 +159,58 @@ export class ReportSessioninAdminMockApi {
active: false, active: false,
}; };
// Unshift the new sessioninAdmin // Unshift the new adminSession
this._sessioninAdmins.unshift(newSessioninAdmin); this._adminSessions.unshift(newAdminSession);
// Return the response // Return the response
return [200, newSessioninAdmin]; return [200, newAdminSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninAdmin - PATCH // @ AdminSession - PATCH
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPatch('api/apps/report/sessionin-admin/sessionin-admin') .onPatch('api/apps/report/admin-session/admin-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id and sessioninAdmin // Get the id and adminSession
const id = request.body.id; const id = request.body.id;
const sessioninAdmin = cloneDeep(request.body.sessioninAdmin); const adminSession = cloneDeep(request.body.adminSession);
// Prepare the updated sessioninAdmin // Prepare the updated adminSession
let updatedSessioninAdmin = null; let updatedAdminSession = null;
// Find the sessioninAdmin and update it // Find the adminSession and update it
this._sessioninAdmins.forEach((item, index, sessioninAdmins) => { this._adminSessions.forEach((item, index, adminSessions) => {
if (item.id === id) { if (item.id === id) {
// Update the sessioninAdmin // Update the adminSession
sessioninAdmins[index] = assign( adminSessions[index] = assign(
{}, {},
sessioninAdmins[index], adminSessions[index],
sessioninAdmin adminSession
); );
// Store the updated sessioninAdmin // Store the updated adminSession
updatedSessioninAdmin = sessioninAdmins[index]; updatedAdminSession = adminSessions[index];
} }
}); });
// Return the response // Return the response
return [200, updatedSessioninAdmin]; return [200, updatedAdminSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninAdmin - DELETE // @ AdminSession - DELETE
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onDelete('api/apps/report/sessionin-admin/sessionin-admin') .onDelete('api/apps/report/admin-session/admin-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id // Get the id
const id = request.params.get('id'); const id = request.params.get('id');
// Find the sessioninAdmin and delete it // Find the adminSession and delete it
this._sessioninAdmins.forEach((item, index) => { this._adminSessions.forEach((item, index) => {
if (item.id === id) { if (item.id === id) {
this._sessioninAdmins.splice(index, 1); this._adminSessions.splice(index, 1);
} }
}); });

View File

@ -1,6 +1,6 @@
/* eslint-disable */ /* eslint-disable */
export const sessioninAdmins = [ export const adminSessions = [
{ {
id: '1', id: '1',
rank: '본사', rank: '본사',

View File

@ -1,13 +1,13 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { assign, cloneDeep } from 'lodash-es'; import { assign, cloneDeep } from 'lodash-es';
import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api'; import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api';
import { sessioninOverlaps as sessioninOverlapsData } from './data'; import { duplicatedSessions as duplicatedSessionsData } from './data';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class ReportSessioninOverlapMockApi { export class ReportDuplicatedSessionMockApi {
private _sessioninOverlaps: any[] = sessioninOverlapsData; private _duplicatedSessions: any[] = duplicatedSessionsData;
/** /**
* Constructor * Constructor
@ -26,26 +26,26 @@ export class ReportSessioninOverlapMockApi {
*/ */
registerHandlers(): void { registerHandlers(): void {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninOverlaps - GET // @ DuplicatedSessions - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/report/sessionin-overlap/sessionin-overlaps', 300) .onGet('api/apps/report/duplicated-session/duplicated-sessions', 300)
.reply(({ request }) => { .reply(({ request }) => {
// Get available queries // Get available queries
const search = request.params.get('search'); const search = request.params.get('search');
const sort = request.params.get('sort') || 'name'; const sort = request.params.get('sort') || 'overlapCount';
const order = request.params.get('order') || 'asc'; const order = request.params.get('order') || 'asc';
const page = parseInt(request.params.get('page') ?? '1', 10); const page = parseInt(request.params.get('page') ?? '1', 10);
const size = parseInt(request.params.get('size') ?? '10', 10); const size = parseInt(request.params.get('size') ?? '10', 10);
// Clone the sessioninoverlaps // Clone the duplicatedSessions
let sessioninOverlaps: any[] | null = cloneDeep( let duplicatedSessions: any[] | null = cloneDeep(
this._sessioninOverlaps this._duplicatedSessions
); );
// Sort the sessioninOverlaps // Sort the duplicatedSessions
if (sort === 'overlapCount') { if (sort === 'overlapCount') {
sessioninOverlaps.sort((a, b) => { duplicatedSessions.sort((a, b) => {
const fieldA = a[sort].toString().toUpperCase(); const fieldA = a[sort].toString().toUpperCase();
const fieldB = b[sort].toString().toUpperCase(); const fieldB = b[sort].toString().toUpperCase();
return order === 'asc' return order === 'asc'
@ -53,15 +53,15 @@ export class ReportSessioninOverlapMockApi {
: fieldB.localeCompare(fieldA); : fieldB.localeCompare(fieldA);
}); });
} else { } else {
sessioninOverlaps.sort((a, b) => duplicatedSessions.sort((a, b) =>
order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort]
); );
} }
// If search exists... // If search exists...
if (search) { if (search) {
// Filter the sessioninOverlaps // Filter the duplicatedSessions
sessioninOverlaps = sessioninOverlaps.filter( duplicatedSessions = duplicatedSessions.filter(
(contact: any) => (contact: any) =>
contact.name && contact.name &&
contact.name.toLowerCase().includes(search.toLowerCase()) contact.name.toLowerCase().includes(search.toLowerCase())
@ -69,32 +69,35 @@ export class ReportSessioninOverlapMockApi {
} }
// Paginate - Start // Paginate - Start
const sessioninOverlapsLength = sessioninOverlaps.length; const duplicatedSessionsLength = duplicatedSessions.length;
// Calculate pagination details // Calculate pagination details
const begin = page * size; const begin = page * size;
const end = Math.min(size * (page + 1), sessioninOverlapsLength); const end = Math.min(size * (page + 1), duplicatedSessionsLength);
const lastPage = Math.max(Math.ceil(sessioninOverlapsLength / size), 1); const lastPage = Math.max(
Math.ceil(duplicatedSessionsLength / size),
1
);
// Prepare the pagination object // Prepare the pagination object
let pagination = {}; let pagination = {};
// If the requested page number is bigger than // If the requested page number is bigger than
// the last possible page number, return null for // the last possible page number, return null for
// sessioninOverlaps but also send the last possible page so // duplicatedSessions but also send the last possible page so
// the app can navigate to there // the app can navigate to there
if (page > lastPage) { if (page > lastPage) {
sessioninOverlaps = null; duplicatedSessions = null;
pagination = { pagination = {
lastPage, lastPage,
}; };
} else { } else {
// Paginate the results by size // Paginate the results by size
sessioninOverlaps = sessioninOverlaps.slice(begin, end); duplicatedSessions = duplicatedSessions.slice(begin, end);
// Prepare the pagination mock-api // Prepare the pagination mock-api
pagination = { pagination = {
length: sessioninOverlapsLength, length: duplicatedSessionsLength,
size: size, size: size,
page: page, page: page,
lastPage: lastPage, lastPage: lastPage,
@ -107,41 +110,41 @@ export class ReportSessioninOverlapMockApi {
return [ return [
200, 200,
{ {
sessioninOverlaps, duplicatedSessions,
pagination, pagination,
}, },
]; ];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninOverlap - GET // @ DuplicatedSession - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/report/sessionin-overlap/sessionin-overlap') .onGet('api/apps/report/duplicated-session/duplicated-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id from the params // Get the id from the params
const id = request.params.get('id'); const id = request.params.get('id');
// Clone the sessioninOverlaps // Clone the duplicatedSessions
const sessioninOverlaps = cloneDeep(this._sessioninOverlaps); const duplicatedSessions = cloneDeep(this._duplicatedSessions);
// Find the sessioninOverlap // Find the duplicatedSession
const sessioninOverlap = sessioninOverlaps.find( const duplicatedSession = duplicatedSessions.find(
(item: any) => item.id === id (item: any) => item.id === id
); );
// Return the response // Return the response
return [200, sessioninOverlap]; return [200, duplicatedSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninOverlap - POST // @ DuplicatedSession - POST
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPost('api/apps/report/sessionin-overlap/sessionin-overlap') .onPost('api/apps/report/duplicated-session/duplicated-session')
.reply(() => { .reply(() => {
// Generate a new sessioninOverlap // Generate a new duplicatedSession
const newSessioninOverlap = { const newDuplicatedSession = {
id: FuseMockApiUtils.guid(), id: FuseMockApiUtils.guid(),
category: '', category: '',
name: 'A New User', name: 'A New User',
@ -163,58 +166,58 @@ export class ReportSessioninOverlapMockApi {
active: false, active: false,
}; };
// Unshift the new sessioninOverlap // Unshift the new duplicatedSession
this._sessioninOverlaps.unshift(newSessioninOverlap); this._duplicatedSessions.unshift(newDuplicatedSession);
// Return the response // Return the response
return [200, newSessioninOverlap]; return [200, newDuplicatedSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninOverlap - PATCH // @ DuplicatedSession - PATCH
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPatch('api/apps/report/sessionin-overlap/sessionin-overlap') .onPatch('api/apps/report/duplicated-session/duplicated-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id and sessioninOverlap // Get the id and duplicatedSession
const id = request.body.id; const id = request.body.id;
const sessioninOverlap = cloneDeep(request.body.sessioninOverlap); const duplicatedSession = cloneDeep(request.body.duplicatedSession);
// Prepare the updated sessioninOverlap // Prepare the updated duplicatedSession
let updatedSessioninOverlap = null; let updatedDuplicatedSession = null;
// Find the sessioninOverlap and update it // Find the duplicatedSession and update it
this._sessioninOverlaps.forEach((item, index, sessioninOverlaps) => { this._duplicatedSessions.forEach((item, index, duplicatedSessions) => {
if (item.id === id) { if (item.id === id) {
// Update the sessioninOverlap // Update the duplicatedSession
sessioninOverlaps[index] = assign( duplicatedSessions[index] = assign(
{}, {},
sessioninOverlaps[index], duplicatedSessions[index],
sessioninOverlap duplicatedSession
); );
// Store the updated sessioninOverlap // Store the updated duplicatedSession
updatedSessioninOverlap = sessioninOverlaps[index]; updatedDuplicatedSession = duplicatedSessions[index];
} }
}); });
// Return the response // Return the response
return [200, updatedSessioninOverlap]; return [200, updatedDuplicatedSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninOverlap - DELETE // @ DuplicatedSession - DELETE
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onDelete('api/apps/report/sessionin-overlap/sessionin-overlap') .onDelete('api/apps/report/duplicated-session/duplicated-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id // Get the id
const id = request.params.get('id'); const id = request.params.get('id');
// Find the sessioninOverlap and delete it // Find the duplicatedSession and delete it
this._sessioninOverlaps.forEach((item, index) => { this._duplicatedSessions.forEach((item, index) => {
if (item.id === id) { if (item.id === id) {
this._sessioninOverlaps.splice(index, 1); this._duplicatedSessions.splice(index, 1);
} }
}); });

View File

@ -1,6 +1,6 @@
/* eslint-disable */ /* eslint-disable */
export const sessioninOverlaps = [ export const duplicatedSessions = [
{ {
id: '1', id: '1',
overlapCount: '3', overlapCount: '3',

View File

@ -1,13 +1,13 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { assign, cloneDeep } from 'lodash-es'; import { assign, cloneDeep } from 'lodash-es';
import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api'; import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api';
import { sessioninInfos as sessioninInfosData } from './data'; import { userSessions as userSessionsData } from './data';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class ReportSessioninInfoMockApi { export class ReportUserSessionMockApi {
private _sessioninInfos: any[] = sessioninInfosData; private _userSessions: any[] = userSessionsData;
/** /**
* Constructor * Constructor
@ -26,10 +26,10 @@ export class ReportSessioninInfoMockApi {
*/ */
registerHandlers(): void { registerHandlers(): void {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninInfos - GET // @ UserSessions - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/report/sessionin-info/sessionin-infos', 300) .onGet('api/apps/report/user-session/user-sessions', 300)
.reply(({ request }) => { .reply(({ request }) => {
// Get available queries // Get available queries
const search = request.params.get('search'); const search = request.params.get('search');
@ -38,12 +38,12 @@ export class ReportSessioninInfoMockApi {
const page = parseInt(request.params.get('page') ?? '1', 10); const page = parseInt(request.params.get('page') ?? '1', 10);
const size = parseInt(request.params.get('size') ?? '10', 10); const size = parseInt(request.params.get('size') ?? '10', 10);
// Clone the sessioninInfos // Clone the userSessions
let sessioninInfos: any[] | null = cloneDeep(this._sessioninInfos); let userSessions: any[] | null = cloneDeep(this._userSessions);
// Sort the sessioninInfos // Sort the userSessions
if (sort === 'signinId' || sort === 'nickname') { if (sort === 'signinId' || sort === 'nickname') {
sessioninInfos.sort((a, b) => { userSessions.sort((a, b) => {
const fieldA = a[sort].toString().toUpperCase(); const fieldA = a[sort].toString().toUpperCase();
const fieldB = b[sort].toString().toUpperCase(); const fieldB = b[sort].toString().toUpperCase();
return order === 'asc' return order === 'asc'
@ -51,15 +51,15 @@ export class ReportSessioninInfoMockApi {
: fieldB.localeCompare(fieldA); : fieldB.localeCompare(fieldA);
}); });
} else { } else {
sessioninInfos.sort((a, b) => userSessions.sort((a, b) =>
order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort]
); );
} }
// If search exists... // If search exists...
if (search) { if (search) {
// Filter the sessioninInfos // Filter the userSessions
sessioninInfos = sessioninInfos.filter( userSessions = userSessions.filter(
(contact: any) => (contact: any) =>
contact.name && contact.name &&
contact.name.toLowerCase().includes(search.toLowerCase()) contact.name.toLowerCase().includes(search.toLowerCase())
@ -67,32 +67,32 @@ export class ReportSessioninInfoMockApi {
} }
// Paginate - Start // Paginate - Start
const sessioninInfosLength = sessioninInfos.length; const userSessionsLength = userSessions.length;
// Calculate pagination details // Calculate pagination details
const begin = page * size; const begin = page * size;
const end = Math.min(size * (page + 1), sessioninInfosLength); const end = Math.min(size * (page + 1), userSessionsLength);
const lastPage = Math.max(Math.ceil(sessioninInfosLength / size), 1); const lastPage = Math.max(Math.ceil(userSessionsLength / size), 1);
// Prepare the pagination object // Prepare the pagination object
let pagination = {}; let pagination = {};
// If the requested page number is bigger than // If the requested page number is bigger than
// the last possible page number, return null for // the last possible page number, return null for
// sessioninInfos but also send the last possible page so // userSessions but also send the last possible page so
// the app can navigate to there // the app can navigate to there
if (page > lastPage) { if (page > lastPage) {
sessioninInfos = null; userSessions = null;
pagination = { pagination = {
lastPage, lastPage,
}; };
} else { } else {
// Paginate the results by size // Paginate the results by size
sessioninInfos = sessioninInfos.slice(begin, end); userSessions = userSessions.slice(begin, end);
// Prepare the pagination mock-api // Prepare the pagination mock-api
pagination = { pagination = {
length: sessioninInfosLength, length: userSessionsLength,
size: size, size: size,
page: page, page: page,
lastPage: lastPage, lastPage: lastPage,
@ -105,41 +105,39 @@ export class ReportSessioninInfoMockApi {
return [ return [
200, 200,
{ {
sessioninInfos, userSessions,
pagination, pagination,
}, },
]; ];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninInfo - GET // @ UserSession - GET
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onGet('api/apps/report/sessionin-info/sessionin-info') .onGet('api/apps/report/user-session/user-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id from the params // Get the id from the params
const id = request.params.get('id'); const id = request.params.get('id');
// Clone the sessioninInfos // Clone the userSessions
const sessioninInfos = cloneDeep(this._sessioninInfos); const userSessions = cloneDeep(this._userSessions);
// Find the sessioninInfo // Find the userSession
const sessioninInfo = sessioninInfos.find( const userSession = userSessions.find((item: any) => item.id === id);
(item: any) => item.id === id
);
// Return the response // Return the response
return [200, sessioninInfo]; return [200, userSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninInfo - POST // @ UserSession - POST
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPost('api/apps/report/sessionin-info/sessionin-info') .onPost('api/apps/report/user-session/user-session')
.reply(() => { .reply(() => {
// Generate a new sessioninInfo // Generate a new userSession
const newSessioninInfo = { const newUserSession = {
id: FuseMockApiUtils.guid(), id: FuseMockApiUtils.guid(),
category: '', category: '',
name: 'A New User', name: 'A New User',
@ -161,58 +159,54 @@ export class ReportSessioninInfoMockApi {
active: false, active: false,
}; };
// Unshift the new sessioninInfo // Unshift the new userSession
this._sessioninInfos.unshift(newSessioninInfo); this._userSessions.unshift(newUserSession);
// Return the response // Return the response
return [200, newSessioninInfo]; return [200, newUserSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninInfo - PATCH // @ UserSession - PATCH
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onPatch('api/apps/report/sessionin-info/sessionin-info') .onPatch('api/apps/report/user-session/user-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id and sessioninInfo // Get the id and userSession
const id = request.body.id; const id = request.body.id;
const sessioninInfo = cloneDeep(request.body.sessioninInfo); const userSession = cloneDeep(request.body.userSession);
// Prepare the updated sessioninInfo // Prepare the updated userSession
let updatedSessioninInfo = null; let updatedUserSession = null;
// Find the sessioninInfo and update it // Find the userSession and update it
this._sessioninInfos.forEach((item, index, sessioninInfos) => { this._userSessions.forEach((item, index, userSessions) => {
if (item.id === id) { if (item.id === id) {
// Update the sessioninInfo // Update the userSession
sessioninInfos[index] = assign( userSessions[index] = assign({}, userSessions[index], userSession);
{},
sessioninInfos[index],
sessioninInfo
);
// Store the updated sessioninInfo // Store the updated userSession
updatedSessioninInfo = sessioninInfos[index]; updatedUserSession = userSessions[index];
} }
}); });
// Return the response // Return the response
return [200, updatedSessioninInfo]; return [200, updatedUserSession];
}); });
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ SessioninInfo - DELETE // @ UserSession - DELETE
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
this._fuseMockApiService this._fuseMockApiService
.onDelete('api/apps/report/sessionin-info/sessionin-info') .onDelete('api/apps/report/user-session/user-session')
.reply(({ request }) => { .reply(({ request }) => {
// Get the id // Get the id
const id = request.params.get('id'); const id = request.params.get('id');
// Find the sessioninInfo and delete it // Find the userSession and delete it
this._sessioninInfos.forEach((item, index) => { this._userSessions.forEach((item, index) => {
if (item.id === id) { if (item.id === id) {
this._sessioninInfos.splice(index, 1); this._userSessions.splice(index, 1);
} }
}); });

View File

@ -1,6 +1,6 @@
/* eslint-disable */ /* eslint-disable */
export const sessioninInfos = [ export const userSessions = [
{ {
id: '1', id: '1',
signinId: 'lala1', signinId: 'lala1',

View File

@ -315,25 +315,25 @@ export const defaultNavigation: FuseNavigationItem[] = [
link: '/report/payment-log', link: '/report/payment-log',
}, },
{ {
id: 'report.sessionin-info', id: 'report.user-session',
title: 'Sessionin Info', title: 'User Session',
type: 'basic', type: 'basic',
icon: 'heroicons_outline:academic-cap', icon: 'heroicons_outline:academic-cap',
link: '/report/sessionin-info', link: '/report/user-session',
}, },
{ {
id: 'report.sessionin-overlap', id: 'report.duplicated-session',
title: 'Sessionin Overlap', title: 'Duplicated Session',
type: 'basic', type: 'basic',
icon: 'heroicons_outline:academic-cap', icon: 'heroicons_outline:academic-cap',
link: '/report/sessionin-overlap', link: '/report/duplicated-session',
}, },
{ {
id: 'report.sessionin-admin', id: 'report.admin-session',
title: 'Sessionin Admin', title: 'Admin Session',
type: 'basic', type: 'basic',
icon: 'heroicons_outline:academic-cap', icon: 'heroicons_outline:academic-cap',
link: '/report/sessionin-admin', link: '/report/admin-session',
}, },
{ {
id: 'report.excel-log', id: 'report.excel-log',

View File

@ -58,9 +58,9 @@ import { ReportMoneyLogMockApi } from './apps/report/money-log/api';
import { ReportCompLogMockApi } from './apps/report/comp-log/api'; import { ReportCompLogMockApi } from './apps/report/comp-log/api';
import { ReportModificationLogMockApi } from './apps/report/modification-log/api'; import { ReportModificationLogMockApi } from './apps/report/modification-log/api';
import { ReportPaymentLogMockApi } from './apps/report/payment-log/api'; import { ReportPaymentLogMockApi } from './apps/report/payment-log/api';
import { ReportSessioninInfoMockApi } from './apps/report/sessionin-info/api'; import { ReportUserSessionMockApi } from './apps/report/user-session/api';
import { ReportSessioninOverlapMockApi } from './apps/report/sessionin-overlap/api'; import { ReportDuplicatedSessionMockApi } from './apps/report/duplicated-session/api';
import { ReportSessioninAdminMockApi } from './apps/report/sessionin-admin/api'; import { ReportAdminSessionMockApi } from './apps/report/admin-session/api';
import { ReportExcelLogMockApi } from './apps/report/excel-log/api'; import { ReportExcelLogMockApi } from './apps/report/excel-log/api';
import { ReportLoosingMockApi } from './apps/report/loosing/api'; import { ReportLoosingMockApi } from './apps/report/loosing/api';
import { BoardNoticeMockApi } from './apps/board/notice/api'; import { BoardNoticeMockApi } from './apps/board/notice/api';
@ -131,9 +131,9 @@ export const mockApiServices = [
ReportCompLogMockApi, ReportCompLogMockApi,
ReportModificationLogMockApi, ReportModificationLogMockApi,
ReportPaymentLogMockApi, ReportPaymentLogMockApi,
ReportSessioninInfoMockApi, ReportUserSessionMockApi,
ReportSessioninOverlapMockApi, ReportDuplicatedSessionMockApi,
ReportSessioninAdminMockApi, ReportAdminSessionMockApi,
ReportExcelLogMockApi, ReportExcelLogMockApi,
ReportLoosingMockApi, ReportLoosingMockApi,
BoardNoticeMockApi, BoardNoticeMockApi,

View File

@ -24,14 +24,14 @@ import { SharedModule } from 'app/shared/shared.module';
import { COMPONENTS } from './components'; import { COMPONENTS } from './components';
import { sessioninInfoRoutes } from './sessionin-info.routing'; import { adminSessionRoutes } from './admin-session.routing';
@NgModule({ @NgModule({
declarations: [COMPONENTS], declarations: [COMPONENTS],
imports: [ imports: [
TranslocoModule, TranslocoModule,
SharedModule, SharedModule,
RouterModule.forChild(sessioninInfoRoutes), RouterModule.forChild(adminSessionRoutes),
MatButtonModule, MatButtonModule,
MatFormFieldModule, MatFormFieldModule,
@ -51,4 +51,4 @@ import { sessioninInfoRoutes } from './sessionin-info.routing';
MatMomentDateModule, MatMomentDateModule,
], ],
}) })
export class SessioninInfoModule {} export class AdminSessionModule {}

View File

@ -3,15 +3,15 @@ import { Route } from '@angular/router';
import { ListComponent } from './components/list.component'; import { ListComponent } from './components/list.component';
import { ViewComponent } from '../../member/user/components/view.component'; import { ViewComponent } from '../../member/user/components/view.component';
import { SessioninInfosResolver } from './resolvers/sessionin-info.resolver'; import { AdminSessionsResolver } from './resolvers/admin-session.resolver';
import { UserResolver } from '../../member/user/resolvers/user.resolver'; import { UserResolver } from '../../member/user/resolvers/user.resolver';
export const sessioninInfoRoutes: Route[] = [ export const adminSessionRoutes: Route[] = [
{ {
path: '', path: '',
component: ListComponent, component: ListComponent,
resolve: { resolve: {
sessioninInfos: SessioninInfosResolver, adminSessions: AdminSessionsResolver,
}, },
}, },
{ {

View File

@ -99,8 +99,8 @@
<div <div
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto" class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
> >
<ng-container *ngIf="sessioninAdmins$ | async as sessioninAdmins"> <ng-container *ngIf="adminSessions$ | async as adminSessions">
<ng-container *ngIf="sessioninAdmins.length > 0; else noUser"> <ng-container *ngIf="adminSessions.length > 0; else noAdminSession">
<div class="grid"> <div class="grid">
<!-- Header --> <!-- Header -->
<div <div
@ -128,10 +128,10 @@
<div class="hidden lg:block">회원차단/해제</div> <div class="hidden lg:block">회원차단/해제</div>
</div> </div>
<!-- Rows --> <!-- Rows -->
<ng-container *ngIf="sessioninAdmins$ | async as sessioninAdmins"> <ng-container *ngIf="adminSessions$ | async as adminSessions">
<ng-container <ng-container
*ngFor=" *ngFor="
let admin of sessioninAdmins; let admin of adminSessions;
let i = index; let i = index;
trackBy: __trackByFn trackBy: __trackByFn
" "
@ -211,7 +211,7 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
<ng-template #noUser> <ng-template #noAdminSession>
<div <div
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center" class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
> >

View File

@ -24,13 +24,13 @@ import {
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmationService } from '@fuse/services/confirmation'; import { FuseConfirmationService } from '@fuse/services/confirmation';
import { SessioninAdmin } from '../models/sessionin-admin'; import { AdminSession } from '../models/admin-session';
import { SessioninAdminPagination } from '../models/sessionin-admin-pagination'; import { AdminSessionPagination } from '../models/admin-session-pagination';
import { SessioninAdminService } from '../services/sessionin-admin.service'; import { AdminSessionService } from '../services/admin-session.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@Component({ @Component({
selector: 'sessionin-admin-list', selector: 'admin-session-list',
templateUrl: './list.component.html', templateUrl: './list.component.html',
styles: [ styles: [
/* language=SCSS */ /* language=SCSS */
@ -60,12 +60,12 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator; @ViewChild(MatPaginator) private _paginator!: MatPaginator;
@ViewChild(MatSort) private _sort!: MatSort; @ViewChild(MatSort) private _sort!: MatSort;
sessioninAdmins$!: Observable<SessioninAdmin[] | undefined>; adminSessions$!: Observable<AdminSession[] | undefined>;
isLoading = false; isLoading = false;
searchInputControl = new FormControl(); searchInputControl = new FormControl();
selectedSessioninAdmin?: SessioninAdmin; selectedAdminSession?: AdminSession;
pagination?: SessioninAdminPagination; pagination?: AdminSessionPagination;
__isSearchOpened = false; __isSearchOpened = false;
ipBlockConfigForm!: FormGroup; ipBlockConfigForm!: FormGroup;
@ -80,7 +80,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
private _changeDetectorRef: ChangeDetectorRef, private _changeDetectorRef: ChangeDetectorRef,
private _fuseConfirmationService: FuseConfirmationService, private _fuseConfirmationService: FuseConfirmationService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private _sessioninAdminService: SessioninAdminService, private _adminSessionService: AdminSessionService,
private router: Router private router: Router
) {} ) {}
@ -93,9 +93,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
*/ */
ngOnInit(): void { ngOnInit(): void {
// Get the pagination // Get the pagination
this._sessioninAdminService.pagination$ this._adminSessionService.pagination$
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))
.subscribe((pagination: SessioninAdminPagination | undefined) => { .subscribe((pagination: AdminSessionPagination | undefined) => {
// Update the pagination // Update the pagination
this.pagination = pagination; this.pagination = pagination;
@ -104,7 +104,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
// Get the products // Get the products
this.sessioninAdmins$ = this._sessioninAdminService.sessioninAdmins$; this.adminSessions$ = this._adminSessionService.adminSessions$;
// Set ip, id block config // Set ip, id block config
this.__idBlockConfirmConfig(); this.__idBlockConfirmConfig();

View File

@ -1,4 +1,4 @@
export interface SessioninInfoPagination { export interface AdminSessionPagination {
length: number; length: number;
size: number; size: number;
page: number; page: number;

View File

@ -1,4 +1,4 @@
export interface SessioninAdmin { export interface AdminSession {
id: string; id: string;
rank?: string; rank?: string;
userId?: string; userId?: string;

View File

@ -7,19 +7,19 @@ import {
} from '@angular/router'; } from '@angular/router';
import { catchError, Observable, throwError } from 'rxjs'; import { catchError, Observable, throwError } from 'rxjs';
import { SessioninInfo } from '../models/sessionin-info'; import { AdminSession } from '../models/admin-session';
import { SessioninInfoPagination } from '../models/sessionin-info-pagination'; import { AdminSessionPagination } from '../models/admin-session-pagination';
import { SessioninInfoService } from '../services/sessionin-info.service'; import { AdminSessionService } from '../services/admin-session.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninInfoResolver implements Resolve<any> { export class AdminSessionResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor( constructor(
private _sessioninInfoService: SessioninInfoService, private _adminSessionService: AdminSessionService,
private _router: Router private _router: Router
) {} ) {}
@ -36,9 +36,9 @@ export class SessioninInfoResolver implements Resolve<any> {
resolve( resolve(
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<SessioninInfo | undefined> { ): Observable<AdminSession | undefined> {
return this._sessioninInfoService return this._adminSessionService
.getSessioninInfoById(route.paramMap.get('id')) .getAdminSessionById(route.paramMap.get('id'))
.pipe( .pipe(
// Error here means the requested product is not available // Error here means the requested product is not available
catchError((error) => { catchError((error) => {
@ -61,11 +61,11 @@ export class SessioninInfoResolver implements Resolve<any> {
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninInfosResolver implements Resolve<any> { export class AdminSessionsResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor(private _sessioninInfoService: SessioninInfoService) {} constructor(private _adminSessionService: AdminSessionService) {}
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ Public methods // @ Public methods
@ -81,9 +81,9 @@ export class SessioninInfosResolver implements Resolve<any> {
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<{ ): Observable<{
pagination: SessioninInfoPagination; pagination: AdminSessionPagination;
sessioninInfos: SessioninInfo[]; adminSessions: AdminSession[];
}> { }> {
return this._sessioninInfoService.getSessioninInfos(); return this._adminSessionService.getAdminSessions();
} }
} }

View File

@ -12,21 +12,21 @@ import {
throwError, throwError,
} from 'rxjs'; } from 'rxjs';
import { SessioninInfo } from '../models/sessionin-info'; import { AdminSession } from '../models/admin-session';
import { SessioninInfoPagination } from '../models/sessionin-info-pagination'; import { AdminSessionPagination } from '../models/admin-session-pagination';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninInfoService { export class AdminSessionService {
// Private // Private
private __pagination = new BehaviorSubject< private __pagination = new BehaviorSubject<
SessioninInfoPagination | undefined AdminSessionPagination | undefined
>(undefined); >(undefined);
private __sessioninInfo = new BehaviorSubject<SessioninInfo | undefined>( private __adminSession = new BehaviorSubject<AdminSession | undefined>(
undefined undefined
); );
private __sessioninInfos = new BehaviorSubject<SessioninInfo[] | undefined>( private __adminSessions = new BehaviorSubject<AdminSession[] | undefined>(
undefined undefined
); );
@ -42,22 +42,22 @@ export class SessioninInfoService {
/** /**
* Getter for pagination * Getter for pagination
*/ */
get pagination$(): Observable<SessioninInfoPagination | undefined> { get pagination$(): Observable<AdminSessionPagination | undefined> {
return this.__pagination.asObservable(); return this.__pagination.asObservable();
} }
/** /**
* Getter for sessioninInfo * Getter for adminSession
*/ */
get sessioninInfo$(): Observable<SessioninInfo | undefined> { get adminSession$(): Observable<AdminSession | undefined> {
return this.__sessioninInfo.asObservable(); return this.__adminSession.asObservable();
} }
/** /**
* Getter for sessioninInfos * Getter for adminSessions
*/ */
get sessioninInfos$(): Observable<SessioninInfo[] | undefined> { get adminSessions$(): Observable<AdminSession[] | undefined> {
return this.__sessioninInfos.asObservable(); return this.__adminSessions.asObservable();
} }
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
@ -65,7 +65,7 @@ export class SessioninInfoService {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
/** /**
* Get SessioninInfos * Get AdminSessions
* *
* *
* @param page * @param page
@ -74,21 +74,21 @@ export class SessioninInfoService {
* @param order * @param order
* @param search * @param search
*/ */
getSessioninInfos( getAdminSessions(
page: number = 0, page: number = 0,
size: number = 10, size: number = 10,
sort: string = 'name', sort: string = 'name',
order: 'asc' | 'desc' | '' = 'asc', order: 'asc' | 'desc' | '' = 'asc',
search: string = '' search: string = ''
): Observable<{ ): Observable<{
pagination: SessioninInfoPagination; pagination: AdminSessionPagination;
sessioninInfos: SessioninInfo[]; adminSessions: AdminSession[];
}> { }> {
return this._httpClient return this._httpClient
.get<{ .get<{
pagination: SessioninInfoPagination; pagination: AdminSessionPagination;
sessioninInfos: SessioninInfo[]; adminSessions: AdminSession[];
}>('api/apps/report/sessionin-info/sessionin-infos', { }>('api/apps/report/admin-session/admin-sessions', {
params: { params: {
page: '' + page, page: '' + page,
size: '' + size, size: '' + size,
@ -100,7 +100,7 @@ export class SessioninInfoService {
.pipe( .pipe(
tap((response) => { tap((response) => {
this.__pagination.next(response.pagination); this.__pagination.next(response.pagination);
this.__sessioninInfos.next(response.sessioninInfos); this.__adminSessions.next(response.adminSessions);
}) })
); );
} }
@ -108,19 +108,19 @@ export class SessioninInfoService {
/** /**
* Get product by id * Get product by id
*/ */
getSessioninInfoById(id: string | null): Observable<SessioninInfo> { getAdminSessionById(id: string | null): Observable<AdminSession> {
return this.__sessioninInfos.pipe( return this.__adminSessions.pipe(
take(1), take(1),
map((sessioninInfos) => { map((adminSessions) => {
// Find the product // Find the product
const sessioninInfo = const adminSession =
sessioninInfos?.find((item) => item.id === id) || undefined; adminSessions?.find((item) => item.id === id) || undefined;
// Update the product // Update the product
this.__sessioninInfo.next(sessioninInfo); this.__adminSession.next(adminSession);
// Return the product // Return the product
return sessioninInfo; return adminSession;
}), }),
switchMap((product) => { switchMap((product) => {
if (!product) { if (!product) {
@ -135,24 +135,21 @@ export class SessioninInfoService {
/** /**
* Create product * Create product
*/ */
createSessioninInfo(): Observable<SessioninInfo> { createAdminSession(): Observable<AdminSession> {
return this.sessioninInfos$.pipe( return this.adminSessions$.pipe(
take(1), take(1),
switchMap((sessioninInfos) => switchMap((adminSessions) =>
this._httpClient this._httpClient
.post<SessioninInfo>('api/apps/report/sessionin-info/product', {}) .post<AdminSession>('api/apps/report/admin-session/product', {})
.pipe( .pipe(
map((newSessioninInfo) => { map((newAdminSession) => {
// Update the sessioninInfos with the new product // Update the adminSessions with the new product
if (!!sessioninInfos) { if (!!adminSessions) {
this.__sessioninInfos.next([ this.__adminSessions.next([newAdminSession, ...adminSessions]);
newSessioninInfo,
...sessioninInfos,
]);
} }
// Return the new product // Return the new product
return newSessioninInfo; return newAdminSession;
}) })
) )
) )

View File

@ -114,29 +114,29 @@
<div <div
class="inventory-grid z-10 sticky top-0 grid gap-4 py-4 px-6 md:px-8 shadow text-md font-semibold text-secondary bg-gray-50 dark:bg-black dark:bg-opacity-5" class="inventory-grid z-10 sticky top-0 grid gap-4 py-4 px-6 md:px-8 shadow text-md font-semibold text-secondary bg-gray-50 dark:bg-black dark:bg-opacity-5"
> >
<div>요율</div> <div>처리날짜</div>
<div>상부</div> <div>이전일 보유금</div>
<div> <div>회원 입출금</div>
아이디 <div>파트너 입출금</div>
<hr style="margin: 7px 0px" /> <div class="hidden sm:block">전체손익</div>
닉네임 <div class="hidden md:block">수동머니</div>
<hr style="margin: 7px 0px" /> <div class="hidden md:block">수동콤프</div>
연락처 <div class="hidden md:block">카-배팅</div>
</div> <div class="hidden lg:block">카-당첨</div>
<div> <div class="hidden lg:block">카-윈로스(A)</div>
등급 <div class="hidden lg:block">카-수수료(B)</div>
<hr style="margin: 7px 0px" /> <div class="hidden lg:block">카-벳윈정산(A-B)</div>
레벨 <div class="hidden md:block">슬-배팅</div>
</div> <div class="hidden lg:block">슬-당첨</div>
<div class="hidden sm:block">예금주</div> <div class="hidden lg:block">슬-윈로스(D)</div>
<div class="hidden md:block">보유금</div> <div class="hidden lg:block">슬-수수료(E)</div>
<div class="hidden md:block"> <div class="hidden lg:block">슬-뱃윈정산(D-E)</div>
게임중머니 <div class="hidden md:block">파-배팅</div>
<hr style="margin: 7px 0px" /> <div class="hidden lg:block">파-당첨</div>
금일콤프 <div class="hidden lg:block">파-윈로스(H)</div>
</div> <div class="hidden lg:block">파-수수료(I)</div>
<div class="hidden md:block">총입출</div> <div class="hidden lg:block">파-벳윈정산(H-I)</div>
<div class="hidden lg:block">카지노->캐쉬</div> <div class="hidden lg:block">총뱃윈정산</div>
</div> </div>
<!-- Rows --> <!-- Rows -->
<ng-container *ngIf="dailyPartners$ | async as dailyPartners"> <ng-container *ngIf="dailyPartners$ | async as dailyPartners">
@ -146,60 +146,90 @@
<div <div
class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b" class="inventory-grid grid items-center gap-4 py-3 px-6 md:px-8 border-b"
> >
<div>요율</div> <div>{{ dailyPartner.processDate }}</div>
<div> <div>
{{ dailyPartner.highRank }} {{ dailyPartner.lastDayHoldingMoney }}
</div> </div>
<div> <div>
{{ dailyPartner.signinId }} 충전{{ dailyPartner.memberCharge }}
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
{{ dailyPartner.nickname }} 환전{{ dailyPartner.memberExchange }}
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
{{ dailyPartner.phoneNumber }} 손익{{ dailyPartner.memberProfitLoss }}
</div> </div>
<div> <div>
{{ dailyPartner.rank }} 충전{{ dailyPartner.partnerCharge }}
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
LV{{ dailyPartner.level }} 환전{{ dailyPartner.partnerExchange }}
<hr style="margin: 7px 0px" />
손익{{ dailyPartner.partnerProfitLoss }}
</div> </div>
<div class="hidden sm:block"> <div class="hidden sm:block">
{{ dailyPartner.accountHolder }} {{ dailyPartner.totalProfitLoss }}
</div> </div>
<div class="hidden md:block"> <div class="hidden md:block">
캐쉬{{ dailyPartner.ownCash }} {{ dailyPartner.passiveMoney }}
<hr style="margin: 7px 0px" />
콤프{{ dailyPartner.ownComp }}P
<hr style="margin: 7px 0px" />
쿠폰{{ dailyPartner.ownCoupon }}
</div> </div>
<div class="hidden md:block"> <div class="hidden md:block">
{{ dailyPartner.gameMoney }} {{ dailyPartner.passiveComp }}
<hr style="margin: 7px 0px" />
{{ dailyPartner.todayComp }}P
</div> </div>
<div class="hidden md:block"> <div class="hidden md:block">
입금{{ dailyPartner.totalDeposit }} 배팅{{ dailyPartner.casinoBetting }}
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
출금{{ dailyPartner.totalWithdraw }} 타이{{ dailyPartner.casinoTie }}
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
차익{{ dailyPartner.balance }} 취소{{ dailyPartner.casinoCancel }}
<hr style="margin: 7px 0px" />
유효{{ dailyPartner.casinoAvailable }}
</div> </div>
<div class="hidden lg:block"> <div class="hidden lg:block">
<button {{ dailyPartner.casinoWinning }}
mat-flat-button </div>
class="bet-mat-small-8" <div class="hidden lg:block">
[color]="'primary'" {{ dailyPartner.casinoWinLoss }}
> </div>
게임머니확인 <div class="hidden lg:block">
</button> {{ dailyPartner.casinoCommission }}
</div>
<div class="hidden lg:block">
{{ dailyPartner.casinoBetWinCalculate }}
</div>
<div class="hidden md:block">
배팅{{ dailyPartner.slotBetting }}
<hr style="margin: 7px 0px" /> <hr style="margin: 7px 0px" />
<button 취소{{ dailyPartner.slotCancel }}
mat-flat-button <hr style="margin: 7px 0px" />
class="bet-mat-small-8" 유효{{ dailyPartner.slotAvailable }}
[color]="'primary'" </div>
> <div class="hidden lg:block">
게임머니회수 {{ dailyPartner.slotWinning }}
</button> </div>
<div class="hidden lg:block">
{{ dailyPartner.slotWinLoss }}
</div>
<div class="hidden lg:block">
{{ dailyPartner.slotCommission }}
</div>
<div class="hidden lg:block">
{{ dailyPartner.slotBetWinCalculate }}
</div>
<div class="hidden md:block">
{{ dailyPartner.powerballBetting }}
</div>
<div class="hidden lg:block">
{{ dailyPartner.powerballWinning }}
</div>
<div class="hidden lg:block">
{{ dailyPartner.powerballWinLoss }}
</div>
<div class="hidden lg:block">
{{ dailyPartner.powerballCommission }}
</div>
<div class="hidden lg:block">
{{ dailyPartner.powerballBetWinCalculate }}
</div>
<div class="hidden lg:block">
{{ dailyPartner.totalBetWinCalculate }}
</div> </div>
</div> </div>
</ng-container> </ng-container>

View File

@ -41,18 +41,22 @@ import { Router } from '@angular/router';
/* language=SCSS */ /* language=SCSS */
` `
.inventory-grid { .inventory-grid {
grid-template-columns: 60px auto 40px; /* 아이디 등급 회원 */
grid-template-columns: 40px auto 30px;
@screen sm { @screen sm {
grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px; /* 아이디 등급 회원 파트너 손익 머니 콤프 카배팅 */
grid-template-columns: 40px auto 30px 30px 30px 30px 30px 30px;
} }
@screen md { @screen md {
grid-template-columns: 60px 60px 60px 60px 60px 60px auto 60px 60px; /* 아이디 등급 회원 파트너 손익 머니 콤프 카배팅 카당첨 */
grid-template-columns: 40px auto 30px 30px 30px 30px 30px 30px 30px;
} }
@screen lg { @screen lg {
grid-template-columns: 60px 70px 70px 70px 70px 100px 60px 60px auto 60px 60px 60px 60px; /* 아이디 등급 회원 파트너 손익 머니 콤프 카배팅 카당첨 카윈로스 카수수료 카정산 슬배팅 슬당첨 슬윈로스 슬수수료 슬정산 파배팅 파당첨 파윈로스 파수수료 파정산 총정산 */
grid-template-columns: 40px auto 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px 30px;
} }
} }
`, `,

View File

@ -65,8 +65,10 @@
<div <div
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto" class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
> >
<ng-container *ngIf="sessioninOverlaps$ | async as sessioninOverlaps"> <ng-container *ngIf="duplicatedSessions$ | async as duplicatedSessions">
<ng-container *ngIf="sessioninOverlaps.length > 0; else noUser"> <ng-container
*ngIf="duplicatedSessions.length > 0; else noDuplicatedSession"
>
<div class="grid"> <div class="grid">
<!-- Header --> <!-- Header -->
<div <div
@ -79,11 +81,11 @@
</div> </div>
<!-- Rows --> <!-- Rows -->
<ng-container <ng-container
*ngIf="sessioninOverlaps$ | async as sessioninOverlaps" *ngIf="duplicatedSessions$ | async as duplicatedSessions"
> >
<ng-container <ng-container
*ngFor=" *ngFor="
let info of sessioninOverlaps; let info of duplicatedSessions;
let i = index; let i = index;
trackBy: __trackByFn trackBy: __trackByFn
" "
@ -130,7 +132,7 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
<ng-template #noUser> <ng-template #noDuplicatedSession>
<div <div
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center" class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
> >

View File

@ -30,13 +30,13 @@ import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmationService } from '@fuse/services/confirmation'; import { FuseConfirmationService } from '@fuse/services/confirmation';
import { User } from '../../../member/user/models/user'; import { User } from '../../../member/user/models/user';
import { SessioninOverlap } from '../models/sessionin-overlap'; import { DuplicatedSession } from '../models/duplicated-session';
import { SessioninOverlapPagination } from '../models/sessionin-Overlap-pagination'; import { DuplicatedSessionPagination } from '../models/duplicated-session-pagination';
import { SessioninOverlapService } from '../services/sessionin-overlap.service'; import { DuplicatedSessionService } from '../services/duplicated-session.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@Component({ @Component({
selector: 'sessionin-overlap-list', selector: 'duplicated-session-list',
templateUrl: './list.component.html', templateUrl: './list.component.html',
styles: [ styles: [
/* language=SCSS */ /* language=SCSS */
@ -66,13 +66,13 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator; @ViewChild(MatPaginator) private _paginator!: MatPaginator;
@ViewChild(MatSort) private _sort!: MatSort; @ViewChild(MatSort) private _sort!: MatSort;
sessioninOverlaps$!: Observable<SessioninOverlap[] | undefined>; duplicatedSessions$!: Observable<DuplicatedSession[] | undefined>;
users$!: Observable<User[] | undefined>; users$!: Observable<User[] | undefined>;
isLoading = false; isLoading = false;
searchInputControl = new FormControl(); searchInputControl = new FormControl();
selectedSessioninOverlap?: SessioninOverlap; selectedDuplicatedSession?: DuplicatedSession;
pagination?: SessioninOverlapPagination; pagination?: DuplicatedSessionPagination;
__isSearchOpened = false; __isSearchOpened = false;
@ -85,7 +85,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
private _changeDetectorRef: ChangeDetectorRef, private _changeDetectorRef: ChangeDetectorRef,
private _fuseConfirmationService: FuseConfirmationService, private _fuseConfirmationService: FuseConfirmationService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private _sessioninOverlapService: SessioninOverlapService, private _duplicatedSessionService: DuplicatedSessionService,
private router: Router private router: Router
) {} ) {}
@ -98,9 +98,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
*/ */
ngOnInit(): void { ngOnInit(): void {
// Get the pagination // Get the pagination
this._sessioninOverlapService.pagination$ this._duplicatedSessionService.pagination$
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))
.subscribe((pagination: SessioninOverlapPagination | undefined) => { .subscribe((pagination: DuplicatedSessionPagination | undefined) => {
// Update the pagination // Update the pagination
this.pagination = pagination; this.pagination = pagination;
@ -109,7 +109,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
// Get the products // Get the products
this.sessioninOverlaps$ = this._sessioninOverlapService.sessioninOverlaps$; this.duplicatedSessions$ =
this._duplicatedSessionService.duplicatedSessions$;
} }
/** /**
@ -119,7 +120,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
if (this._sort && this._paginator) { if (this._sort && this._paginator) {
// Set the initial sort // Set the initial sort
this._sort.sort({ this._sort.sort({
id: 'name', id: 'overlapCount',
start: 'asc', start: 'asc',
disableClear: true, disableClear: true,
}); });
@ -127,7 +128,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
// Mark for check // Mark for check
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
// If the sessioninOverlap changes the sort order... // If the duplicatedSession changes the sort order...
this._sort.sortChange this._sort.sortChange
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => { .subscribe(() => {
@ -140,7 +141,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
.pipe( .pipe(
switchMap(() => { switchMap(() => {
this.isLoading = true; this.isLoading = true;
return this._sessioninOverlapService.getSessioninOverlaps( return this._duplicatedSessionService.getDuplicatedSessions(
this._paginator.pageIndex, this._paginator.pageIndex,
this._paginator.pageSize, this._paginator.pageSize,
this._sort.active, this._sort.active,

View File

@ -22,14 +22,14 @@ import { SharedModule } from 'app/shared/shared.module';
import { COMPONENTS } from './components'; import { COMPONENTS } from './components';
import { sessioninOverlapRoutes } from './sessionin-overlap.routing'; import { duplicatedSessionRoutes } from './duplicated-session.routing';
@NgModule({ @NgModule({
declarations: [COMPONENTS], declarations: [COMPONENTS],
imports: [ imports: [
TranslocoModule, TranslocoModule,
SharedModule, SharedModule,
RouterModule.forChild(sessioninOverlapRoutes), RouterModule.forChild(duplicatedSessionRoutes),
MatButtonModule, MatButtonModule,
MatFormFieldModule, MatFormFieldModule,
@ -47,4 +47,4 @@ import { sessioninOverlapRoutes } from './sessionin-overlap.routing';
MatCheckboxModule, MatCheckboxModule,
], ],
}) })
export class SessioninOverlapModule {} export class DuplicatedSessionModule {}

View File

@ -3,15 +3,15 @@ import { Route } from '@angular/router';
import { ListComponent } from './components/list.component'; import { ListComponent } from './components/list.component';
import { ViewComponent } from '../../member/user/components/view.component'; import { ViewComponent } from '../../member/user/components/view.component';
import { SessioninOverlapsResolver } from './resolvers/sessionin-overlap.resolver'; import { DuplicatedSessionsResolver } from './resolvers/duplicated-session.resolver';
import { UserResolver } from '../../member/user/resolvers/user.resolver'; import { UserResolver } from '../../member/user/resolvers/user.resolver';
export const sessioninOverlapRoutes: Route[] = [ export const duplicatedSessionRoutes: Route[] = [
{ {
path: '', path: '',
component: ListComponent, component: ListComponent,
resolve: { resolve: {
sessioninOverlaps: SessioninOverlapsResolver, duplicatedSessions: DuplicatedSessionsResolver,
}, },
}, },
{ {

View File

@ -1,4 +1,4 @@
export interface SessioninOverlapPagination { export interface DuplicatedSessionPagination {
length: number; length: number;
size: number; size: number;
page: number; page: number;

View File

@ -1,4 +1,4 @@
export interface SessioninOverlap { export interface DuplicatedSession {
id?: string; id?: string;
overlapCount?: string; overlapCount?: string;
ip?: string; ip?: string;

View File

@ -7,19 +7,19 @@ import {
} from '@angular/router'; } from '@angular/router';
import { catchError, Observable, throwError } from 'rxjs'; import { catchError, Observable, throwError } from 'rxjs';
import { SessioninOverlap } from '../models/sessionin-overlap'; import { DuplicatedSession } from '../models/duplicated-session';
import { SessioninOverlapPagination } from '../models/sessionin-Overlap-pagination'; import { DuplicatedSessionPagination } from '../models/duplicated-session-pagination';
import { SessioninOverlapService } from '../services/sessionin-overlap.service'; import { DuplicatedSessionService } from '../services/duplicated-session.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninOverlapResolver implements Resolve<any> { export class DuplicatedSessionResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor( constructor(
private _sessioninOverlapService: SessioninOverlapService, private _duplicatedSessionService: DuplicatedSessionService,
private _router: Router private _router: Router
) {} ) {}
@ -36,9 +36,9 @@ export class SessioninOverlapResolver implements Resolve<any> {
resolve( resolve(
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<SessioninOverlap | undefined> { ): Observable<DuplicatedSession | undefined> {
return this._sessioninOverlapService return this._duplicatedSessionService
.getSessioninOverlapById(route.paramMap.get('id')) .getDuplicatedSessionById(route.paramMap.get('id'))
.pipe( .pipe(
// Error here means the requested product is not available // Error here means the requested product is not available
catchError((error) => { catchError((error) => {
@ -61,11 +61,11 @@ export class SessioninOverlapResolver implements Resolve<any> {
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninOverlapsResolver implements Resolve<any> { export class DuplicatedSessionsResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor(private _sessioninOverlapService: SessioninOverlapService) {} constructor(private _duplicatedSessionService: DuplicatedSessionService) {}
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ Public methods // @ Public methods
@ -81,9 +81,9 @@ export class SessioninOverlapsResolver implements Resolve<any> {
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<{ ): Observable<{
pagination: SessioninOverlapPagination; pagination: DuplicatedSessionPagination;
sessioninOverlaps: SessioninOverlap[]; duplicatedSessions: DuplicatedSession[];
}> { }> {
return this._sessioninOverlapService.getSessioninOverlaps(); return this._duplicatedSessionService.getDuplicatedSessions();
} }
} }

View File

@ -12,22 +12,22 @@ import {
throwError, throwError,
} from 'rxjs'; } from 'rxjs';
import { SessioninOverlap } from '../models/sessionin-overlap'; import { DuplicatedSession } from '../models/duplicated-session';
import { SessioninOverlapPagination } from '../models/sessionin-Overlap-pagination'; import { DuplicatedSessionPagination } from '../models/duplicated-session-pagination';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninOverlapService { export class DuplicatedSessionService {
// Private // Private
private __pagination = new BehaviorSubject< private __pagination = new BehaviorSubject<
SessioninOverlapPagination | undefined DuplicatedSessionPagination | undefined
>(undefined); >(undefined);
private __sessioninOverlap = new BehaviorSubject< private __duplicatedSession = new BehaviorSubject<
SessioninOverlap | undefined DuplicatedSession | undefined
>(undefined); >(undefined);
private __sessioninOverlaps = new BehaviorSubject< private __duplicatedSessions = new BehaviorSubject<
SessioninOverlap[] | undefined DuplicatedSession[] | undefined
>(undefined); >(undefined);
/** /**
@ -42,22 +42,22 @@ export class SessioninOverlapService {
/** /**
* Getter for pagination * Getter for pagination
*/ */
get pagination$(): Observable<SessioninOverlapPagination | undefined> { get pagination$(): Observable<DuplicatedSessionPagination | undefined> {
return this.__pagination.asObservable(); return this.__pagination.asObservable();
} }
/** /**
* Getter for sessioninOverlap * Getter for duplicatedSession
*/ */
get sessioninOverlap$(): Observable<SessioninOverlap | undefined> { get duplicatedSession$(): Observable<DuplicatedSession | undefined> {
return this.__sessioninOverlap.asObservable(); return this.__duplicatedSession.asObservable();
} }
/** /**
* Getter for sessioninOverlaps * Getter for duplicatedSessions
*/ */
get sessioninOverlaps$(): Observable<SessioninOverlap[] | undefined> { get duplicatedSessions$(): Observable<DuplicatedSession[] | undefined> {
return this.__sessioninOverlaps.asObservable(); return this.__duplicatedSessions.asObservable();
} }
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
@ -65,7 +65,7 @@ export class SessioninOverlapService {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
/** /**
* Get SessioninOverlaps * Get DuplicatedSessions
* *
* *
* @param page * @param page
@ -74,21 +74,21 @@ export class SessioninOverlapService {
* @param order * @param order
* @param search * @param search
*/ */
getSessioninOverlaps( getDuplicatedSessions(
page: number = 0, page: number = 0,
size: number = 10, size: number = 10,
sort: string = 'name', sort: string = 'signinId',
order: 'asc' | 'desc' | '' = 'asc', order: 'asc' | 'desc' | '' = 'asc',
search: string = '' search: string = ''
): Observable<{ ): Observable<{
pagination: SessioninOverlapPagination; pagination: DuplicatedSessionPagination;
sessioninOverlaps: SessioninOverlap[]; duplicatedSessions: DuplicatedSession[];
}> { }> {
return this._httpClient return this._httpClient
.get<{ .get<{
pagination: SessioninOverlapPagination; pagination: DuplicatedSessionPagination;
sessioninOverlaps: SessioninOverlap[]; duplicatedSessions: DuplicatedSession[];
}>('api/apps/report/sessionin-overlap/sessionin-overlaps', { }>('api/apps/report/duplicated-session/duplicated-sessions', {
params: { params: {
page: '' + page, page: '' + page,
size: '' + size, size: '' + size,
@ -100,7 +100,7 @@ export class SessioninOverlapService {
.pipe( .pipe(
tap((response) => { tap((response) => {
this.__pagination.next(response.pagination); this.__pagination.next(response.pagination);
this.__sessioninOverlaps.next(response.sessioninOverlaps); this.__duplicatedSessions.next(response.duplicatedSessions);
}) })
); );
} }
@ -108,19 +108,19 @@ export class SessioninOverlapService {
/** /**
* Get product by id * Get product by id
*/ */
getSessioninOverlapById(id: string | null): Observable<SessioninOverlap> { getDuplicatedSessionById(id: string | null): Observable<DuplicatedSession> {
return this.__sessioninOverlaps.pipe( return this.__duplicatedSessions.pipe(
take(1), take(1),
map((sessioninOverlaps) => { map((duplicatedSessions) => {
// Find the product // Find the product
const sessioninOverlap = const duplicatedSession =
sessioninOverlaps?.find((item) => item.id === id) || undefined; duplicatedSessions?.find((item) => item.id === id) || undefined;
// Update the product // Update the product
this.__sessioninOverlap.next(sessioninOverlap); this.__duplicatedSession.next(duplicatedSession);
// Return the product // Return the product
return sessioninOverlap; return duplicatedSession;
}), }),
switchMap((product) => { switchMap((product) => {
if (!product) { if (!product) {
@ -135,27 +135,27 @@ export class SessioninOverlapService {
/** /**
* Create product * Create product
*/ */
createSessioninOverlap(): Observable<SessioninOverlap> { createDuplicatedSession(): Observable<DuplicatedSession> {
return this.sessioninOverlaps$.pipe( return this.duplicatedSessions$.pipe(
take(1), take(1),
switchMap((sessioninOverlaps) => switchMap((duplicatedSessions) =>
this._httpClient this._httpClient
.post<SessioninOverlap>( .post<DuplicatedSession>(
'api/apps/report/sessionin-overlap/product', 'api/apps/report/duplicated-session/product',
{} {}
) )
.pipe( .pipe(
map((newSessioninOverlap) => { map((newDuplicatedSession) => {
// Update the sessioninOverlaps with the new product // Update the duplicatedSessions with the new product
if (!!sessioninOverlaps) { if (!!duplicatedSessions) {
this.__sessioninOverlaps.next([ this.__duplicatedSessions.next([
newSessioninOverlap, newDuplicatedSession,
...sessioninOverlaps, ...duplicatedSessions,
]); ]);
} }
// Return the new product // Return the new product
return newSessioninOverlap; return newDuplicatedSession;
}) })
) )
) )

View File

@ -164,18 +164,18 @@
<div class="hidden lg:block">카-당첨</div> <div class="hidden lg:block">카-당첨</div>
<div class="hidden lg:block">카-윈로스(A)</div> <div class="hidden lg:block">카-윈로스(A)</div>
<div class="hidden lg:block">카-수수료(B)</div> <div class="hidden lg:block">카-수수료(B)</div>
<div class="hidden lg:block">카-윈정산(A-B)</div> <div class="hidden lg:block">카-윈정산(A-B)</div>
<div class="hidden md:block">슬-배팅</div> <div class="hidden md:block">슬-배팅</div>
<div class="hidden lg:block">슬-당첨</div> <div class="hidden lg:block">슬-당첨</div>
<div class="hidden lg:block">슬-윈로스(D)</div> <div class="hidden lg:block">슬-윈로스(D)</div>
<div class="hidden lg:block">슬-수수료(E)</div> <div class="hidden lg:block">슬-수수료(E)</div>
<div class="hidden lg:block">슬-윈정산(D-E)</div> <div class="hidden lg:block">슬-윈정산(D-E)</div>
<div class="hidden md:block">파-배팅</div> <div class="hidden md:block">파-배팅</div>
<div class="hidden lg:block">파-당첨</div> <div class="hidden lg:block">파-당첨</div>
<div class="hidden lg:block">파-윈로스(H)</div> <div class="hidden lg:block">파-윈로스(H)</div>
<div class="hidden lg:block">파-수수료(I)</div> <div class="hidden lg:block">파-수수료(I)</div>
<div class="hidden lg:block">파-벳윈정산(H-I)</div> <div class="hidden lg:block">파-벳윈정산(H-I)</div>
<div class="hidden lg:block">윈정산</div> <div class="hidden lg:block">윈정산</div>
</div> </div>
<!-- Rows --> <!-- Rows -->
<ng-container *ngIf="todayBets$ | async as todayBets"> <ng-container *ngIf="todayBets$ | async as todayBets">

View File

@ -99,8 +99,8 @@
<div <div
class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto" class="flex flex-col flex-auto sm:mb-18 overflow-hidden sm:overflow-y-auto"
> >
<ng-container *ngIf="sessioninInfos$ | async as sessioninInfos"> <ng-container *ngIf="userSessions$ | async as userSessions">
<ng-container *ngIf="sessioninInfos.length > 0; else noUser"> <ng-container *ngIf="userSessions.length > 0; else noUserSession">
<div class="grid"> <div class="grid">
<!-- Header --> <!-- Header -->
<div <div
@ -123,10 +123,10 @@
<div class="hidden lg:block">회원차단/해제</div> <div class="hidden lg:block">회원차단/해제</div>
</div> </div>
<!-- Rows --> <!-- Rows -->
<ng-container *ngIf="sessioninInfos$ | async as sessioninInfos"> <ng-container *ngIf="userSessions$ | async as userSessions">
<ng-container <ng-container
*ngFor=" *ngFor="
let info of sessioninInfos; let info of userSessions;
let i = index; let i = index;
trackBy: __trackByFn trackBy: __trackByFn
" "
@ -196,7 +196,7 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
<ng-template #noUser> <ng-template #noUserSession>
<div <div
class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center" class="p-8 sm:p-16 border-t text-4xl font-semibold tracking-tight text-center"
> >

View File

@ -30,13 +30,13 @@ import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmationService } from '@fuse/services/confirmation'; import { FuseConfirmationService } from '@fuse/services/confirmation';
import { User } from '../../../member/user/models/user'; import { User } from '../../../member/user/models/user';
import { SessioninInfo } from '../models/sessionin-info'; import { UserSession } from '../models/user-session';
import { SessioninInfoPagination } from '../models/sessionin-info-pagination'; import { UserSessionPagination } from '../models/user-session-pagination';
import { SessioninInfoService } from '../services/sessionin-info.service'; import { UserSessionService } from '../services/user-session.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@Component({ @Component({
selector: 'sessionin-info-list', selector: 'user-session-list',
templateUrl: './list.component.html', templateUrl: './list.component.html',
styles: [ styles: [
/* language=SCSS */ /* language=SCSS */
@ -66,13 +66,13 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator; @ViewChild(MatPaginator) private _paginator!: MatPaginator;
@ViewChild(MatSort) private _sort!: MatSort; @ViewChild(MatSort) private _sort!: MatSort;
sessioninInfos$!: Observable<SessioninInfo[] | undefined>; userSessions$!: Observable<UserSession[] | undefined>;
users$!: Observable<User[] | undefined>; users$!: Observable<User[] | undefined>;
isLoading = false; isLoading = false;
searchInputControl = new FormControl(); searchInputControl = new FormControl();
selectedSessioninInfo?: SessioninInfo; selectedUserSession?: UserSession;
pagination?: SessioninInfoPagination; pagination?: UserSessionPagination;
__isSearchOpened = false; __isSearchOpened = false;
ipBlockConfigForm!: FormGroup; ipBlockConfigForm!: FormGroup;
@ -87,7 +87,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
private _changeDetectorRef: ChangeDetectorRef, private _changeDetectorRef: ChangeDetectorRef,
private _fuseConfirmationService: FuseConfirmationService, private _fuseConfirmationService: FuseConfirmationService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private _sessioninInfoService: SessioninInfoService, private _userSessionService: UserSessionService,
private router: Router private router: Router
) {} ) {}
@ -100,9 +100,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
*/ */
ngOnInit(): void { ngOnInit(): void {
// Get the pagination // Get the pagination
this._sessioninInfoService.pagination$ this._userSessionService.pagination$
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))
.subscribe((pagination: SessioninInfoPagination | undefined) => { .subscribe((pagination: UserSessionPagination | undefined) => {
// Update the pagination // Update the pagination
this.pagination = pagination; this.pagination = pagination;
@ -111,7 +111,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
// Get the products // Get the products
this.sessioninInfos$ = this._sessioninInfoService.sessioninInfos$; this.userSessions$ = this._userSessionService.userSessions$;
this.__idBlockConfirmConfig(); this.__idBlockConfirmConfig();
this.__ipBlockConfirmConfig(); this.__ipBlockConfirmConfig();
@ -132,7 +132,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
// Mark for check // Mark for check
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.markForCheck();
// If the sessioninInfo changes the sort order... // If the userSession changes the sort order...
this._sort.sortChange this._sort.sortChange
.pipe(takeUntil(this._unsubscribeAll)) .pipe(takeUntil(this._unsubscribeAll))
.subscribe(() => { .subscribe(() => {
@ -145,7 +145,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
.pipe( .pipe(
switchMap(() => { switchMap(() => {
this.isLoading = true; this.isLoading = true;
return this._sessioninInfoService.getSessioninInfos( return this._userSessionService.getUserSessions(
this._paginator.pageIndex, this._paginator.pageIndex,
this._paginator.pageSize, this._paginator.pageSize,
this._sort.active, this._sort.active,

View File

@ -1,4 +1,4 @@
export interface SessioninAdminPagination { export interface UserSessionPagination {
length: number; length: number;
size: number; size: number;
page: number; page: number;

View File

@ -1,4 +1,4 @@
export interface SessioninInfo { export interface UserSession {
id?: string; id?: string;
signinId?: string; signinId?: string;
nickname?: string; nickname?: string;

View File

@ -7,19 +7,19 @@ import {
} from '@angular/router'; } from '@angular/router';
import { catchError, Observable, throwError } from 'rxjs'; import { catchError, Observable, throwError } from 'rxjs';
import { SessioninAdmin } from '../models/sessionin-admin'; import { UserSession } from '../models/user-session';
import { SessioninAdminPagination } from '../models/sessionin-admin-pagination'; import { UserSessionPagination } from '../models/user-session-pagination';
import { SessioninAdminService } from '../services/sessionin-admin.service'; import { UserSessionService } from '../services/user-session.service';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninAdminResolver implements Resolve<any> { export class UserSessionResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor( constructor(
private _sessioninAdminService: SessioninAdminService, private _userSessionService: UserSessionService,
private _router: Router private _router: Router
) {} ) {}
@ -36,9 +36,9 @@ export class SessioninAdminResolver implements Resolve<any> {
resolve( resolve(
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<SessioninAdmin | undefined> { ): Observable<UserSession | undefined> {
return this._sessioninAdminService return this._userSessionService
.getSessioninAdminById(route.paramMap.get('id')) .getUserSessionById(route.paramMap.get('id'))
.pipe( .pipe(
// Error here means the requested product is not available // Error here means the requested product is not available
catchError((error) => { catchError((error) => {
@ -61,11 +61,11 @@ export class SessioninAdminResolver implements Resolve<any> {
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninAdminsResolver implements Resolve<any> { export class UserSessionsResolver implements Resolve<any> {
/** /**
* Constructor * Constructor
*/ */
constructor(private _sessioninAdminService: SessioninAdminService) {} constructor(private _userSessionService: UserSessionService) {}
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
// @ Public methods // @ Public methods
@ -81,9 +81,9 @@ export class SessioninAdminsResolver implements Resolve<any> {
route: ActivatedRouteSnapshot, route: ActivatedRouteSnapshot,
state: RouterStateSnapshot state: RouterStateSnapshot
): Observable<{ ): Observable<{
pagination: SessioninAdminPagination; pagination: UserSessionPagination;
sessioninAdmins: SessioninAdmin[]; userSessions: UserSession[];
}> { }> {
return this._sessioninAdminService.getSessioninAdmins(); return this._userSessionService.getUserSessions();
} }
} }

View File

@ -12,21 +12,21 @@ import {
throwError, throwError,
} from 'rxjs'; } from 'rxjs';
import { SessioninAdmin } from '../models/sessionin-admin'; import { UserSession } from '../models/user-session';
import { SessioninAdminPagination } from '../models/sessionin-admin-pagination'; import { UserSessionPagination } from '../models/user-session-pagination';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })
export class SessioninAdminService { export class UserSessionService {
// Private // Private
private __pagination = new BehaviorSubject< private __pagination = new BehaviorSubject<UserSessionPagination | undefined>(
SessioninAdminPagination | undefined
>(undefined);
private __sessioninAdmin = new BehaviorSubject<SessioninAdmin | undefined>(
undefined undefined
); );
private __sessioninAdmins = new BehaviorSubject<SessioninAdmin[] | undefined>( private __userSession = new BehaviorSubject<UserSession | undefined>(
undefined
);
private __userSessions = new BehaviorSubject<UserSession[] | undefined>(
undefined undefined
); );
@ -42,22 +42,22 @@ export class SessioninAdminService {
/** /**
* Getter for pagination * Getter for pagination
*/ */
get pagination$(): Observable<SessioninAdminPagination | undefined> { get pagination$(): Observable<UserSessionPagination | undefined> {
return this.__pagination.asObservable(); return this.__pagination.asObservable();
} }
/** /**
* Getter for sessioninAdmin * Getter for userSession
*/ */
get sessioninAdmin$(): Observable<SessioninAdmin | undefined> { get userSession$(): Observable<UserSession | undefined> {
return this.__sessioninAdmin.asObservable(); return this.__userSession.asObservable();
} }
/** /**
* Getter for sessioninAdmins * Getter for userSessions
*/ */
get sessioninAdmins$(): Observable<SessioninAdmin[] | undefined> { get userSessions$(): Observable<UserSession[] | undefined> {
return this.__sessioninAdmins.asObservable(); return this.__userSessions.asObservable();
} }
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
@ -65,7 +65,7 @@ export class SessioninAdminService {
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
/** /**
* Get SessioninAdmins * Get UserSessions
* *
* *
* @param page * @param page
@ -74,21 +74,21 @@ export class SessioninAdminService {
* @param order * @param order
* @param search * @param search
*/ */
getSessioninAdmins( getUserSessions(
page: number = 0, page: number = 0,
size: number = 10, size: number = 10,
sort: string = 'name', sort: string = 'name',
order: 'asc' | 'desc' | '' = 'asc', order: 'asc' | 'desc' | '' = 'asc',
search: string = '' search: string = ''
): Observable<{ ): Observable<{
pagination: SessioninAdminPagination; pagination: UserSessionPagination;
sessioninAdmins: SessioninAdmin[]; userSessions: UserSession[];
}> { }> {
return this._httpClient return this._httpClient
.get<{ .get<{
pagination: SessioninAdminPagination; pagination: UserSessionPagination;
sessioninAdmins: SessioninAdmin[]; userSessions: UserSession[];
}>('api/apps/report/sessionin-admin/sessionin-admins', { }>('api/apps/report/user-session/user-sessions', {
params: { params: {
page: '' + page, page: '' + page,
size: '' + size, size: '' + size,
@ -100,7 +100,7 @@ export class SessioninAdminService {
.pipe( .pipe(
tap((response) => { tap((response) => {
this.__pagination.next(response.pagination); this.__pagination.next(response.pagination);
this.__sessioninAdmins.next(response.sessioninAdmins); this.__userSessions.next(response.userSessions);
}) })
); );
} }
@ -108,19 +108,19 @@ export class SessioninAdminService {
/** /**
* Get product by id * Get product by id
*/ */
getSessioninAdminById(id: string | null): Observable<SessioninAdmin> { getUserSessionById(id: string | null): Observable<UserSession> {
return this.__sessioninAdmins.pipe( return this.__userSessions.pipe(
take(1), take(1),
map((sessioninAdmins) => { map((userSessions) => {
// Find the product // Find the product
const sessioninAdmin = const userSession =
sessioninAdmins?.find((item) => item.id === id) || undefined; userSessions?.find((item) => item.id === id) || undefined;
// Update the product // Update the product
this.__sessioninAdmin.next(sessioninAdmin); this.__userSession.next(userSession);
// Return the product // Return the product
return sessioninAdmin; return userSession;
}), }),
switchMap((product) => { switchMap((product) => {
if (!product) { if (!product) {
@ -135,24 +135,21 @@ export class SessioninAdminService {
/** /**
* Create product * Create product
*/ */
createSessioninAdmin(): Observable<SessioninAdmin> { createUserSession(): Observable<UserSession> {
return this.sessioninAdmins$.pipe( return this.userSessions$.pipe(
take(1), take(1),
switchMap((sessioninAdmins) => switchMap((userSessions) =>
this._httpClient this._httpClient
.post<SessioninAdmin>('api/apps/report/sessionin-admin/product', {}) .post<UserSession>('api/apps/report/user-session/product', {})
.pipe( .pipe(
map((newSessioninAdmin) => { map((newUserSession) => {
// Update the sessioninAdmins with the new product // Update the userSessions with the new product
if (!!sessioninAdmins) { if (!!userSessions) {
this.__sessioninAdmins.next([ this.__userSessions.next([newUserSession, ...userSessions]);
newSessioninAdmin,
...sessioninAdmins,
]);
} }
// Return the new product // Return the new product
return newSessioninAdmin; return newUserSession;
}) })
) )
) )

View File

@ -24,14 +24,14 @@ import { SharedModule } from 'app/shared/shared.module';
import { COMPONENTS } from './components'; import { COMPONENTS } from './components';
import { sessioninAdminRoutes } from './sessionin-admin.routing'; import { userSessionRoutes } from './user-session.routing';
@NgModule({ @NgModule({
declarations: [COMPONENTS], declarations: [COMPONENTS],
imports: [ imports: [
TranslocoModule, TranslocoModule,
SharedModule, SharedModule,
RouterModule.forChild(sessioninAdminRoutes), RouterModule.forChild(userSessionRoutes),
MatButtonModule, MatButtonModule,
MatFormFieldModule, MatFormFieldModule,
@ -51,4 +51,4 @@ import { sessioninAdminRoutes } from './sessionin-admin.routing';
MatMomentDateModule, MatMomentDateModule,
], ],
}) })
export class SessioninAdminModule {} export class UserSessionModule {}

View File

@ -3,15 +3,15 @@ import { Route } from '@angular/router';
import { ListComponent } from './components/list.component'; import { ListComponent } from './components/list.component';
import { ViewComponent } from '../../member/user/components/view.component'; import { ViewComponent } from '../../member/user/components/view.component';
import { SessioninAdminsResolver } from './resolvers/sessionin-admin.resolver'; import { UserSessionsResolver } from './resolvers/user-session.resolver';
import { UserResolver } from '../../member/user/resolvers/user.resolver'; import { UserResolver } from '../../member/user/resolvers/user.resolver';
export const sessioninAdminRoutes: Route[] = [ export const userSessionRoutes: Route[] = [
{ {
path: '', path: '',
component: ListComponent, component: ListComponent,
resolve: { resolve: {
sessioninAdmins: SessioninAdminsResolver, userSessions: UserSessionsResolver,
}, },
}, },
{ {

View File

@ -37,9 +37,9 @@
"Comp Log": "Comp Logs", "Comp Log": "Comp Logs",
"Modification Log": "Member Modification Logs", "Modification Log": "Member Modification Logs",
"Payment Log": "Manual Payment Logs", "Payment Log": "Manual Payment Logs",
"Sessionin Info": "Sessionin Info", "User Session": "User Session",
"Sessionin Admin": "Sessionin Admin Info", "Admin Session": "Admin Session",
"Sessionin Overlap": "Sessionin Overlap", "Duplicated Session": "Duplicated Session",
"Excel Log": "Excel Download Logs", "Excel Log": "Excel Download Logs",
"Loosing": "Loosing Management", "Loosing": "Loosing Management",
"Notice": "Notice", "Notice": "Notice",

View File

@ -45,9 +45,9 @@
"Comp Log": "콤프사용 Logs", "Comp Log": "콤프사용 Logs",
"Modification Log": "회원수정 로그", "Modification Log": "회원수정 로그",
"Payment Log": "수동지급/회수 로그", "Payment Log": "수동지급/회수 로그",
"Sessionin Info": "로그인정보", "User Session": "로그인정보",
"Sessionin Overlap": "중복로그인", "Duplicated Session": "중복로그인",
"Sessionin Admin": "관리자 로그인정보", "Admin Session": "관리자 로그인정보",
"Excel Log": "엑셀다운 로그", "Excel Log": "엑셀다운 로그",
"Loosing": "루징관리", "Loosing": "루징관리",
"Notice": "공지사항", "Notice": "공지사항",