From 002ecf23dd127714197905bc9ebd50dd8764c108 Mon Sep 17 00:00:00 2001 From: leejinho Date: Thu, 19 Dec 2019 16:07:33 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A9=94=EC=8B=A0=EC=A0=80=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=EA=B0=92=20environment=20=EB=A1=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/messages.component.html | 5 +++-- .../components/messages.component.ts | 7 ++++--- .../src/app/store/messenger/event/effects.ts | 21 +++++++++++++------ .../src/app/store/messenger/event/reducers.ts | 1 - .../src/app/store/messenger/sync/effects.ts | 5 +++-- .../environments/environment.daesang.dev.ts | 10 ++++++++- .../environments/environment.daesang.prod.ts | 10 ++++++++- .../src/environments/environment.dev.ts | 10 ++++++++- .../src/environments/environment.prod.ts | 10 ++++++++- .../src/environments/environment.type.ts | 16 ++++++++++++++ .../src/lib/types/const.type.ts | 13 ------------ .../ucap-webmessenger-core/src/public-api.ts | 1 - .../src/lib/components/messages.component.ts | 2 -- 13 files changed, 77 insertions(+), 34 deletions(-) delete mode 100644 projects/ucap-webmessenger-core/src/lib/types/const.type.ts diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html index 32bc1199..bf6b7dcd 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.html @@ -186,7 +186,6 @@ (fileDragOver)="onFileDragOver()" (fileDragLeave)="onFileDragLeave()" > - ; RoomType = RoomType; - CONST = CONST; + environment = environment; constructor( private store: Store, @@ -540,7 +540,8 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { EventStore.info({ roomSeq: this.roomInfo.roomSeq, baseSeq: seq, - requestCount: CONST.EVENT_INFO_READ_COUNT + requestCount: + environment.productConfig.CommonSetting.eventRequestDefaultCount }) ); } diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts index 67ef65ec..db7affcd 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts @@ -89,7 +89,6 @@ import { openSuccess, openFailure } from '../room'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type'; import { StatusCode } from '@ucap-webmessenger/api'; -import { CONST } from '@ucap-webmessenger/core'; import { FileProtocolService, SSVC_TYPE_FILE_INFO_DATA, @@ -102,6 +101,7 @@ import { InfoResponse as FileInfoResponse, FileType } from '@ucap-webmessenger/protocol-file'; +import { environment } from '../../../../environments/environment'; import { RoomUserData } from '@ucap-webmessenger/protocol-sync'; @Injectable() @@ -113,7 +113,7 @@ export class Effects { // return info({ // roomSeq: action.roomSeq, // baseSeq: 0, - // requestCount: CONST.EVENT_INFO_READ_COUNT + // requestCount: environment.productConfig.CommonSetting.eventRequestDefaultCount // }); // }) // ) @@ -131,12 +131,21 @@ export class Effects { requestCount = roomInfo.finalEventSeq - roomInfo.lastReadEventSeq; // 기존 요청개수보다 요청할 갯수가 적을 경우 기본값. - if (CONST.EVENT_INFO_READ_COUNT >= requestCount) { - requestCount = CONST.EVENT_INFO_READ_COUNT; + if ( + environment.productConfig.CommonSetting.eventRequestDefaultCount >= + requestCount + ) { + requestCount = + environment.productConfig.CommonSetting.eventRequestDefaultCount; } else { // 여기까지 읽음 처리를 위한 최대 요청 개수 제한. - if (CONST.READ_HERE_MAX_EVENT_INFO_READ_COUNT < requestCount) { - requestCount = CONST.READ_HERE_MAX_EVENT_INFO_READ_REQUEST_COUNT; + if ( + environment.productConfig.CommonSetting + .readHereShowMaximumEventCount < requestCount + ) { + requestCount = + environment.productConfig.CommonSetting + .readHereEventRequestCount; } else { requestCount = requestCount + 5; } diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/event/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/event/reducers.ts index 9890852b..4142015e 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/event/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/event/reducers.ts @@ -18,7 +18,6 @@ import { import * as AuthenticationStore from '@app/store/account/authentication'; import * as ChatStore from '@app/store/messenger/chat'; import { Info, EventType, EventJson } from '@ucap-webmessenger/protocol-event'; -import { CONST } from '@ucap-webmessenger/core'; export const reducer = createReducer( initialState, diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts index 349de4d2..85fc1edb 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts @@ -105,7 +105,6 @@ import { import * as ChatStore from '@app/store/messenger/chat'; import * as RoomStore from '@app/store/messenger/room'; -import { CONST } from '@ucap-webmessenger/core'; import { AlertDialogComponent, AlertDialogResult, @@ -437,7 +436,9 @@ export class Effects { divCd: 'DivCodeT', roomName: '', isTimerRoom: true, - timerRoomInterval: CONST.DEFAULT_TIMER_ROOM_INTERVAL, // 24h default + timerRoomInterval: + environment.productConfig.CommonSetting + .timerRoomDefaultInterval, // 24h default userSeqs: userSeqList } }) diff --git a/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts b/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts index ce877a4d..fb0ed8e3 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts @@ -55,8 +55,16 @@ export const environment: Environment = { editableProfileImage: false, useTimerRoom: false, + timerRoomDefaultInterval: 24 * 60 * 60, + maxChatRoomUser: 300, - masstextLength: 800 + masstextLength: 800, + + eventRequestDefaultCount: 50, + + readHereShowMinimumEventCount: 10, + readHereShowMaximumEventCount: 100, + readHereEventRequestCount: 10 } }, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts b/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts index 998495cb..9ba30fc0 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.daesang.prod.ts @@ -55,8 +55,16 @@ export const environment: Environment = { editableProfileImage: false, useTimerRoom: false, + timerRoomDefaultInterval: 24 * 60 * 60, + maxChatRoomUser: 300, - masstextLength: 800 + masstextLength: 800, + + eventRequestDefaultCount: 50, + + readHereShowMinimumEventCount: 10, + readHereShowMaximumEventCount: 100, + readHereEventRequestCount: 10 } }, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.dev.ts b/projects/ucap-webmessenger-app/src/environments/environment.dev.ts index a34a38ed..ad46be51 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.dev.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.dev.ts @@ -55,8 +55,16 @@ export const environment: Environment = { editableProfileImage: true, useTimerRoom: true, + timerRoomDefaultInterval: 24 * 60 * 60, + maxChatRoomUser: 300, - masstextLength: 800 + masstextLength: 800, + + eventRequestDefaultCount: 50, + + readHereShowMinimumEventCount: 10, + readHereShowMaximumEventCount: 100, + readHereEventRequestCount: 10 } }, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.prod.ts b/projects/ucap-webmessenger-app/src/environments/environment.prod.ts index 4b041b03..9d1196ac 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.prod.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.prod.ts @@ -55,8 +55,16 @@ export const environment: Environment = { editableProfileImage: true, useTimerRoom: true, + timerRoomDefaultInterval: 24 * 60 * 60, + maxChatRoomUser: 300, - masstextLength: 800 + masstextLength: 800, + + eventRequestDefaultCount: 50, + + readHereShowMinimumEventCount: 10, + readHereShowMaximumEventCount: 100, + readHereEventRequestCount: 10 } }, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.type.ts b/projects/ucap-webmessenger-app/src/environments/environment.type.ts index 0f83fdbd..512028b9 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.type.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.type.ts @@ -66,9 +66,25 @@ export interface Environment { CommonSetting: { editableProfileImage: boolean; + /** 타이머대화방 사용유무 */ useTimerRoom: boolean; + /** 타이머대화방 기본 interval */ + timerRoomDefaultInterval: number; + + /** 최대 대화방 참여인원 */ maxChatRoomUser: number; + /** 대용량대화 기준 */ masstextLength: number; + + /** 대화방 이벤트 조회 개수 */ + eventRequestDefaultCount: number; + + /** 여기까지 읽음을 보여줄 최소 이벤트 개수 (show: over) */ + readHereShowMinimumEventCount: number; + /** 여기까지 읽음을 보여줄 최대 이벤트 개수 (show: under) */ + readHereShowMaximumEventCount: number; + /** 여기까지 읽음이 보려질때 대화방 이벤트 조회 개수. */ + readHereEventRequestCount: number; }; }; diff --git a/projects/ucap-webmessenger-core/src/lib/types/const.type.ts b/projects/ucap-webmessenger-core/src/lib/types/const.type.ts deleted file mode 100644 index 52b0d938..00000000 --- a/projects/ucap-webmessenger-core/src/lib/types/const.type.ts +++ /dev/null @@ -1,13 +0,0 @@ -export enum CONST { - /** 대화방의 이벤트를 조회하는 갯수 */ - EVENT_INFO_READ_COUNT = 50, - /** Timer Room 최초 오픈시 timer interval */ - DEFAULT_TIMER_ROOM_INTERVAL = 24 * 60 * 60, - - /** 여기까지 읽음을 표시할때 조회할 최소 이벤트 갯수 */ - READ_HERE_MIN_EVENT_INFO_READ_COUNT = 10, - /** 여기까지 읽음을 표시할때 조회할 최대 이벤트 갯수 */ - READ_HERE_MAX_EVENT_INFO_READ_COUNT = 100, - /** 여기까지 읽음을 표시할때 조회할 최대 이벤트 갯수를 초과 했을 경우 요청할 최초 이벤트 갯수 */ - READ_HERE_MAX_EVENT_INFO_READ_REQUEST_COUNT = 10 -} diff --git a/projects/ucap-webmessenger-core/src/public-api.ts b/projects/ucap-webmessenger-core/src/public-api.ts index 7c245026..002389f9 100644 --- a/projects/ucap-webmessenger-core/src/public-api.ts +++ b/projects/ucap-webmessenger-core/src/public-api.ts @@ -7,7 +7,6 @@ export * from './lib/types/call-alarm.type'; export * from './lib/types/call-forward.type'; export * from './lib/types/call-mode.type'; export * from './lib/types/caller-type.type'; -export * from './lib/types/const.type'; export * from './lib/types/default-screen.type'; export * from './lib/types/device-devision.type'; export * from './lib/types/device-type.type'; diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts index 9c52dc7e..519a66d8 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts @@ -1,4 +1,3 @@ -import { CONST } from '@ucap-webmessenger/core'; import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { @@ -69,7 +68,6 @@ export class MessagesComponent implements OnInit { messages: Info[]; EventType = EventType; - CONST = CONST; profileImageRoot: string; moment = moment;