From 772d038d22e371b700edb40af3c4b411d463d9c8 Mon Sep 17 00:00:00 2001 From: Richard Park Date: Fri, 1 Nov 2019 13:43:03 +0900 Subject: [PATCH] config of acceptable file extension is added --- .../src/lib/services/common-api.service.ts | 4 + .../src/lib/types/module-config.ts | 1 + .../src/app/app.module.ts | 6 +- .../src/environments/environment.type.ts | 106 ++++++++++++++++++ 4 files changed, 116 insertions(+), 1 deletion(-) diff --git a/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts b/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts index 327735f8..fba37be7 100644 --- a/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts +++ b/projects/ucap-webmessenger-api-common/src/lib/services/common-api.service.ts @@ -134,6 +134,10 @@ export class CommonApiService { ); } + public acceptableExtensionForFileTalk(extension: string): boolean { + return -1 !== this.moduleConfig.acceptableFileExtensions.indexOf(extension); + } + public fileTalkShare( req: FileTalkShareRequest ): Observable { diff --git a/projects/ucap-webmessenger-api-common/src/lib/types/module-config.ts b/projects/ucap-webmessenger-api-common/src/lib/types/module-config.ts index 9f432080..8799fa4f 100644 --- a/projects/ucap-webmessenger-api-common/src/lib/types/module-config.ts +++ b/projects/ucap-webmessenger-api-common/src/lib/types/module-config.ts @@ -11,4 +11,5 @@ export interface ModuleConfig { translationReq: string; translationSave: string; }; + acceptableFileExtensions: string[]; } diff --git a/projects/ucap-webmessenger-app/src/app/app.module.ts b/projects/ucap-webmessenger-app/src/app/app.module.ts index b4826c78..2e3bc2e2 100644 --- a/projects/ucap-webmessenger-app/src/app/app.module.ts +++ b/projects/ucap-webmessenger-app/src/app/app.module.ts @@ -58,7 +58,11 @@ import { AppNativeLayoutModule } from './layouts/native/native.layout.module'; PerfectScrollbarModule, - UCapCommonApiModule.forRoot({ urls: environment.urls.apiCommon }), + UCapCommonApiModule.forRoot({ + urls: environment.urls.apiCommon, + acceptableFileExtensions: + environment.modules.event.acceptableFileExtensions + }), UCapPublicApiModule.forRoot({ urls: environment.urls.apiPublic diff --git a/projects/ucap-webmessenger-app/src/environments/environment.type.ts b/projects/ucap-webmessenger-app/src/environments/environment.type.ts index d3f07688..2339fd0b 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.type.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.type.ts @@ -333,6 +333,11 @@ export interface Environment { max: number; }; }; + modules: { + event: { + acceptableFileExtensions: string[]; + }; + }; } export function build(production: boolean): Environment { @@ -374,6 +379,107 @@ export function build(production: boolean): Environment { min: 1, max: 59999 } + }, + modules: { + event: { + acceptableFileExtensions: [ + // 문서1 + 'csv', + 'd01', + 'doc', + 'docx', + 'dot', + 'dotx', + 'hwp', + 'log', + 'one', + 'pdf', + 'pot', + 'potx', + 'pps', + 'ppsx', + 'ppt', + 'pptx', + 'ps', + // 문서2 + 'rtf', + 'txt', + 'vcf', + 'xls', + 'xlsx', + 'xlt', + 'xltx', + 'xlsm', + 'ods', + // CAD + 'asc', + 'dwg', + 'dws', + 'dwt', + 'dxf', + 'pgp', + 'plt', + // MAC + 'pages', + 'keynote', + // 압축 + '7z', + 'a01', + 'a02', + 'a03', + 'alz', + 'egg', + 'gz', + 'rar', + 'tar', + 'zip', + // 오디오 + 'aac', + 'aiff', + 'flac', + 'm4a', + 'mp2', + 'mp3', + 'mpega', + 'mpga', + 'ogg', + 'wma', + 'wav', + // 플래쉬 + 'fla', + 'flv', + 'swf', + // 이미지 + 'ai', + 'bmp', + 'cdr', + 'emf', + 'eps', + 'gif', + 'jpeg', + 'jpg', + 'png', + 'psd', + 'tif', + 'tiff', + 'wmf', + // 동영상 + '3gp', + 'avi', + 'm4v', + 'mkv', + 'mov', + 'mp4', + 'mpeg', + 'mpg', + 'rv', + 'ts', + 'webm', + 'wmv', + // 폴더전송용 + 'zdr' + ] + } } }; }