From 6297a0b2c386545c7694234062dbac9451964083 Mon Sep 17 00:00:00 2001 From: Richard Park Date: Thu, 7 Nov 2019 13:48:25 +0900 Subject: [PATCH] refactoring --- .../src/lib/apis/file-talk-download.ts | 13 ++- .../src/lib/services/common-api.service.ts | 23 ++++- .../src/lib/apis/check-user-info-ex.ts | 15 +-- .../src/lib/apis/company-list.ts | 23 +++-- .../src/lib/apis/token-update.ts | 23 +++-- .../src/lib/apis/url-info.ts | 11 ++- .../ucap-webmessenger-api/src/lib/apis/api.ts | 8 +- .../src/lib/utils/parameter.util.ts | 16 +-- .../src/lib/utils/url.util.ts | 2 +- .../layouts/common/common.layout.module.ts | 2 + .../dialogs/file-viewer.dialog.component.html | 12 ++- .../dialogs/file-viewer.dialog.component.ts | 98 ++++++++++++++----- .../lib/components/file-viewer.component.html | 35 ++----- .../lib/components/file-viewer.component.ts | 20 +--- .../file-viewer/binary-viewer.component.ts | 13 +-- .../file-viewer/document-viewer.component.ts | 13 +-- .../file-viewer/image-viewer.component.html | 7 +- .../file-viewer/image-viewer.component.ts | 62 ++---------- .../file-viewer/sound-viewer.component.ts | 13 +-- .../file-viewer/video-viewer.component.ts | 13 +-- 20 files changed, 203 insertions(+), 219 deletions(-) diff --git a/projects/ucap-webmessenger-api-common/src/lib/apis/file-talk-download.ts b/projects/ucap-webmessenger-api-common/src/lib/apis/file-talk-download.ts index 3534793d..d710b8bb 100644 --- a/projects/ucap-webmessenger-api-common/src/lib/apis/file-talk-download.ts +++ b/projects/ucap-webmessenger-api-common/src/lib/apis/file-talk-download.ts @@ -22,7 +22,18 @@ const fileTalkDownloadEncodeMap = { attachmentsSeq: 'p_att_seq' }; -export const encodeFileTalkDownload: APIFormDataEncoder< +export const encodeFileTalkDownload: APIEncoder = ( + req: FileTalkDownloadRequest +) => { + const extraParams: any = {}; + + extraParams.userSeq = String(req.userSeq); + extraParams.attachmentsSeq = String(req.attachmentsSeq); + + return ParameterUtil.encode(fileTalkDownloadEncodeMap, req, extraParams); +}; + +export const encodeFormDataFileTalkDownload: APIFormDataEncoder< FileTalkDownloadRequest > = (req: FileTalkDownloadRequest) => { const extraParams: any = {}; 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 4c202d20..099d8f9c 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 @@ -19,7 +19,8 @@ import { } from '../apis/file-profile-save'; import { FileTalkDownloadRequest, - encodeFileTalkDownload + encodeFileTalkDownload, + encodeFormDataFileTalkDownload } from '../apis/file-talk-download'; import { FileTalkSaveRequest, @@ -96,6 +97,24 @@ export class CommonApiService { .pipe(map(res => decodeFileProfileSave(res))); } + public urlForFileTalkDownload( + req: FileTalkDownloadRequest, + fileTalkDownloadUrl?: string + ): string { + const httpReq = new HttpRequest( + 'GET', + !!fileTalkDownloadUrl + ? fileTalkDownloadUrl + : this.moduleConfig.urls.fileTalkDownload, + {}, + { + params: encodeFileTalkDownload(req) + } + ); + + return httpReq.urlWithParams; + } + public fileTalkDownload( req: FileTalkDownloadRequest, fileTalkDownloadUrl?: string @@ -105,7 +124,7 @@ export class CommonApiService { !!fileTalkDownloadUrl ? fileTalkDownloadUrl : this.moduleConfig.urls.fileTalkDownload, - encodeFileTalkDownload(req), + encodeFormDataFileTalkDownload(req), { reportProgress: true, responseType: 'blob' } ); diff --git a/projects/ucap-webmessenger-api-external/src/lib/apis/check-user-info-ex.ts b/projects/ucap-webmessenger-api-external/src/lib/apis/check-user-info-ex.ts index 838507f2..481000ed 100644 --- a/projects/ucap-webmessenger-api-external/src/lib/apis/check-user-info-ex.ts +++ b/projects/ucap-webmessenger-api-external/src/lib/apis/check-user-info-ex.ts @@ -2,7 +2,8 @@ import { APIRequest, APIResponse, APIEncoder, - APIDecoder + APIDecoder, + ParameterUtil } from '@ucap-webmessenger/api'; export interface CheckUserInfoExRequest extends APIRequest { @@ -15,14 +16,16 @@ export interface CheckUserInfoExResponse extends APIResponse { userId?: string; } +const checkUserInfoExEncodeMap = { + userId: 'p_user_id', + companyCode: 'p_comp_code', + userSession: 'p_user_session' +}; + export const encodeCheckUserInfoEx: APIEncoder = ( req: CheckUserInfoExRequest ) => { - return { - p_user_id: req.userId, - p_comp_code: req.companyCode, - p_user_session: req.userSession - }; + return ParameterUtil.encode(checkUserInfoExEncodeMap, req); }; export const decodeCheckUserInfoEx: APIDecoder = ( diff --git a/projects/ucap-webmessenger-api-external/src/lib/apis/company-list.ts b/projects/ucap-webmessenger-api-external/src/lib/apis/company-list.ts index e2db7796..edc38c71 100644 --- a/projects/ucap-webmessenger-api-external/src/lib/apis/company-list.ts +++ b/projects/ucap-webmessenger-api-external/src/lib/apis/company-list.ts @@ -3,7 +3,8 @@ import { APIRequest, APIResponse, APIEncoder, - APIDecoder + APIDecoder, + ParameterUtil } from '@ucap-webmessenger/api'; import { Company } from '../models/company'; @@ -19,16 +20,22 @@ export interface CompanyListResponse extends APIResponse { companyList?: Company[]; } +const companyListEncodeMap = { + userSeq: 'p_user_seq', + appType: 'p_app_type', + deviceType: 'p_device_type', + token: 'p_token', + companyGroupCode: 'p_comp_group_code' +}; + export const encodeCompanyList: APIEncoder = ( req: CompanyListRequest ) => { - return { - p_user_seq: String(req.userSeq), - p_app_type: req.appType, - p_device_type: req.deviceType, - p_token: req.token, - p_comp_group_code: req.companyGroupCode - }; + const extraParams: any = {}; + + extraParams.userSeq = String(req.userSeq); + + return ParameterUtil.encode(companyListEncodeMap, req, extraParams); }; export const decodeCompanyList: APIDecoder = ( diff --git a/projects/ucap-webmessenger-api-external/src/lib/apis/token-update.ts b/projects/ucap-webmessenger-api-external/src/lib/apis/token-update.ts index 452dbb2e..055b0d62 100644 --- a/projects/ucap-webmessenger-api-external/src/lib/apis/token-update.ts +++ b/projects/ucap-webmessenger-api-external/src/lib/apis/token-update.ts @@ -3,7 +3,8 @@ import { APIRequest, APIResponse, APIEncoder, - APIDecoder + APIDecoder, + ParameterUtil } from '@ucap-webmessenger/api'; export interface TokenUpdateRequest extends APIRequest { @@ -17,16 +18,22 @@ export interface TokenUpdateRequest extends APIRequest { // tslint:disable-next-line: no-empty-interface export interface TokenUpdateResponse extends APIResponse {} +const tokenUpdateEncodeMap = { + userSeq: 'p_user_seq', + deviceType: 'p_device_type', + token: 'p_token', + mobilePid: 'p_mobile_pid', + pushType: 'p_push_type' +}; + export const encodeTokenUpdate: APIEncoder = ( req: TokenUpdateRequest ) => { - return { - p_user_seq: String(req.userSeq), - p_device_type: req.deviceType, - p_token: req.token, - p_mobile_pid: req.mobilePid, - p_push_type: req.pushType - }; + const extraParams: any = {}; + + extraParams.userSeq = String(req.userSeq); + + return ParameterUtil.encode(tokenUpdateEncodeMap, req, extraParams); }; export const decodeTokenUpdate: APIDecoder = ( diff --git a/projects/ucap-webmessenger-api-external/src/lib/apis/url-info.ts b/projects/ucap-webmessenger-api-external/src/lib/apis/url-info.ts index 97f4f92a..7d500dee 100644 --- a/projects/ucap-webmessenger-api-external/src/lib/apis/url-info.ts +++ b/projects/ucap-webmessenger-api-external/src/lib/apis/url-info.ts @@ -3,7 +3,8 @@ import { APIRequest, APIResponse, APIEncoder, - APIDecoder + APIDecoder, + ParameterUtil } from '@ucap-webmessenger/api'; export interface UrlInfoRequest extends APIRequest { @@ -25,12 +26,14 @@ export interface UrlInfoResponse extends APIResponse { synapViewUrl?: string; } +const urlInfoEncodeMap = { + deviceType: 'p_device_type' +}; + export const encodeUrlInfo: APIEncoder = ( req: UrlInfoRequest ) => { - return { - p_device_type: req.deviceType - }; + return ParameterUtil.encode(urlInfoEncodeMap, req); }; export const decodeUrlInfo: APIDecoder = (res: any) => { diff --git a/projects/ucap-webmessenger-api/src/lib/apis/api.ts b/projects/ucap-webmessenger-api/src/lib/apis/api.ts index 3deb590a..95fef371 100644 --- a/projects/ucap-webmessenger-api/src/lib/apis/api.ts +++ b/projects/ucap-webmessenger-api/src/lib/apis/api.ts @@ -12,13 +12,7 @@ export interface APIResponse { errorMessage: string; } -export type APIEncoder = ( - req: REQ -) => - | HttpParams - | { - [param: string]: string | string[]; - }; +export type APIEncoder = (req: REQ) => HttpParams; export type APIFormDataEncoder = (req: REQ) => FormData; diff --git a/projects/ucap-webmessenger-api/src/lib/utils/parameter.util.ts b/projects/ucap-webmessenger-api/src/lib/utils/parameter.util.ts index ab29f31e..a8d646e3 100644 --- a/projects/ucap-webmessenger-api/src/lib/utils/parameter.util.ts +++ b/projects/ucap-webmessenger-api/src/lib/utils/parameter.util.ts @@ -1,6 +1,6 @@ -export type Parameter = { - [param: string]: string | string[]; -} | null; +import { HttpParams } from '@angular/common/http'; + +export type Parameter = HttpParams | null; export class ParameterUtil { public static encode( @@ -8,7 +8,7 @@ export class ParameterUtil { param: {}, extraParam?: {} ): Parameter { - const parameter: Parameter = {}; + let parameter: HttpParams = new HttpParams(); Object.keys(parameterMap).map(key => { if (!param.hasOwnProperty(key)) { @@ -23,11 +23,15 @@ export class ParameterUtil { } if (!!v) { - parameter[parameterMap[key]] = v; + if (parameter.has(parameterMap[key])) { + parameter = parameter.append(parameterMap[key], v); + } else { + parameter = parameter.set(parameterMap[key], v); + } } }); - return 0 === Object.keys(parameter).length ? null : parameter; + return parameter; } public static encodeFormData( diff --git a/projects/ucap-webmessenger-api/src/lib/utils/url.util.ts b/projects/ucap-webmessenger-api/src/lib/utils/url.util.ts index c4126df3..e2950bec 100644 --- a/projects/ucap-webmessenger-api/src/lib/utils/url.util.ts +++ b/projects/ucap-webmessenger-api/src/lib/utils/url.util.ts @@ -3,7 +3,7 @@ import { HttpParams } from '@angular/common/http'; export class UrlUtil { public static format(href: string, param: Parameter): string { - const params = new HttpParams({ fromObject: param }).toString(); + const params = param.toString(); if (params.length === 0) { return href; diff --git a/projects/ucap-webmessenger-app/src/app/layouts/common/common.layout.module.ts b/projects/ucap-webmessenger-app/src/app/layouts/common/common.layout.module.ts index 8e0d7fcf..56e3e3fa 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/common/common.layout.module.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/common/common.layout.module.ts @@ -4,6 +4,7 @@ import { CommonModule } from '@angular/common'; import { FlexLayoutModule } from '@angular/flex-layout'; import { MatIconModule } from '@angular/material/icon'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatToolbarModule } from '@angular/material/toolbar'; import { UCapUiModule } from '@ucap-webmessenger/ui'; @@ -16,6 +17,7 @@ import { DIALOGS } from './dialogs'; CommonModule, FlexLayoutModule, MatIconModule, + MatProgressBarModule, MatToolbarModule, UCapUiModule ], diff --git a/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.html index 35db1b48..ff5c6c5e 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.html @@ -1,9 +1,11 @@ + diff --git a/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts index b0cc6383..82da29c2 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/common/dialogs/file-viewer.dialog.component.ts @@ -9,10 +9,14 @@ import { import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; import { NGXLogger } from 'ngx-logger'; import { FileEventJson } from '@ucap-webmessenger/protocol-event'; -import { DeviceType, FileUtil } from '@ucap-webmessenger/core'; +import { DeviceType, FileUtil, MimeUtil } from '@ucap-webmessenger/core'; import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; -import { take } from 'rxjs/operators'; +import { take, map, finalize, tap } from 'rxjs/operators'; import { SnackBarService } from '@ucap-webmessenger/ui'; +import { + FileDownloadItem, + CommonApiService +} from '@ucap-webmessenger/api-common'; export interface FileViewerDialogData { fileInfo: FileEventJson; @@ -36,6 +40,10 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy { deviceType: DeviceType; token: string; + fileDownloadItem: FileDownloadItem; + + fileDownloadUrl: string; + constructor( public dialogRef: MatDialogRef< FileViewerDialogData, @@ -44,6 +52,7 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy { @Inject(MAT_DIALOG_DATA) public data: FileViewerDialogData, @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, private snackBarService: SnackBarService, + private commonApiService: CommonApiService, private logger: NGXLogger ) { this.fileInfo = data.fileInfo; @@ -51,36 +60,73 @@ export class FileViewerDialogComponent implements OnInit, OnDestroy { this.userSeq = data.userSeq; this.deviceType = data.deviceType; this.token = data.token; + + this.fileDownloadUrl = this.commonApiService.urlForFileTalkDownload( + { + userSeq: this.userSeq, + deviceType: this.deviceType, + token: this.token, + attachmentsSeq: this.fileInfo.attachmentSeq + }, + this.downloadUrl + ); } ngOnInit() {} ngOnDestroy(): void {} - onDownload(blob: Blob): void { - FileUtil.fromBlobToBuffer(blob) - .then(buffer => { - this.nativeService - .saveFile(buffer, this.fileInfo.fileName) - .pipe(take(1)) - .subscribe(result => { - if (!!result) { - this.snackBarService.open( - `파일이 경로[${result}]에 저장되었습니다.`, - '', - { - duration: 3000, - verticalPosition: 'bottom' - } - ); - } else { - this.snackBarService.open('파일 저장에 실패하였습니다.'); - } - }); - }) - .catch(reason => { - this.logger.error('download', reason); - }); + onDownload(): void { + this.fileDownloadItem = new FileDownloadItem(); + this.commonApiService + .fileTalkDownload( + { + userSeq: this.userSeq, + deviceType: this.deviceType, + token: this.token, + attachmentsSeq: this.fileInfo.attachmentSeq, + fileDownloadItem: this.fileDownloadItem + }, + this.downloadUrl + ) + .pipe( + take(1), + map(async rawBlob => { + const blob = rawBlob.slice( + 0, + rawBlob.size, + MimeUtil.getMimeFromExtension(this.fileInfo.fileExt) + ); + + FileUtil.fromBlobToBuffer(blob) + .then(buffer => { + this.nativeService + .saveFile(buffer, this.fileInfo.fileName) + .pipe(take(1)) + .subscribe(result => { + if (!!result) { + this.snackBarService.open( + `파일이 경로[${result}]에 저장되었습니다.`, + '', + { + duration: 3000, + verticalPosition: 'bottom' + } + ); + } else { + this.snackBarService.open('파일 저장에 실패하였습니다.'); + } + }); + }) + .catch(reason => { + this.logger.error('download', reason); + }); + }), + finalize(() => { + this.fileDownloadItem = undefined; + }) + ) + .subscribe(); } onClosedViewer(): void { diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer.component.html b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer.component.html index f985506c..6c7d3d74 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer.component.html +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer.component.html @@ -5,51 +5,36 @@ diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer.component.ts b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer.component.ts index 9824ba4e..20fdbbb4 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer.component.ts +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer.component.ts @@ -1,9 +1,8 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { ucapAnimations } from '../animations'; -import { Info, FileEventJson } from '@ucap-webmessenger/protocol-event'; +import { FileEventJson } from '@ucap-webmessenger/protocol-event'; import { FileViewerType } from '../types/file-viewer.type'; import { FileType } from '@ucap-webmessenger/protocol-file'; -import { DeviceType } from '@ucap-webmessenger/core'; @Component({ selector: 'ucap-file-viewer', @@ -16,19 +15,10 @@ export class FileViewerComponent implements OnInit { fileInfo: FileEventJson; @Input() - downloadUrl: string; - - @Input() - userSeq: number; - - @Input() - deviceType: DeviceType; - - @Input() - token: string; + fileDownloadUrl: string; @Output() - download = new EventEmitter(); + download = new EventEmitter(); @Output() closed = new EventEmitter(); @@ -51,8 +41,8 @@ export class FileViewerComponent implements OnInit { return FileViewerType.Binary; } } - onDownload(blob: Blob): void { - this.download.emit(blob); + onDownload(): void { + this.download.emit(); } onClosedViewer(): void { diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/binary-viewer.component.ts b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/binary-viewer.component.ts index d9710c38..c683f0ba 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/binary-viewer.component.ts +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/binary-viewer.component.ts @@ -14,19 +14,10 @@ export class BinaryViewerComponent implements OnInit { fileInfo: FileEventJson; @Input() - downloadUrl: string; - - @Input() - userSeq: number; - - @Input() - deviceType: DeviceType; - - @Input() - token: string; + fileDownloadUrl: string; @Output() - download = new EventEmitter(); + download = new EventEmitter(); @Output() closed = new EventEmitter(); diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/document-viewer.component.ts b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/document-viewer.component.ts index 1ac09a5a..2b411d6a 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/document-viewer.component.ts +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/document-viewer.component.ts @@ -14,19 +14,10 @@ export class DocumentViewerComponent implements OnInit { fileInfo: FileEventJson; @Input() - downloadUrl: string; - - @Input() - userSeq: number; - - @Input() - deviceType: DeviceType; - - @Input() - token: string; + fileDownloadUrl: string; @Output() - download = new EventEmitter(); + download = new EventEmitter(); @Output() closed = new EventEmitter(); diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.html b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.html index 3f7f9d71..b92d8540 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.html +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.html @@ -51,11 +51,6 @@ Close -
- +
diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.ts b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.ts index e680e572..59c3f030 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.ts +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/image-viewer.component.ts @@ -1,13 +1,8 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { ucapAnimations } from '../../animations'; import { FileEventJson } from '@ucap-webmessenger/protocol-event'; -import { DeviceType, FileUtil, MimeUtil } from '@ucap-webmessenger/core'; -import { - CommonApiService, - FileDownloadItem -} from '@ucap-webmessenger/api-common'; -import { take, map } from 'rxjs/operators'; -import { DomSanitizer } from '@angular/platform-browser'; +import { DeviceType } from '@ucap-webmessenger/core'; +import { CommonApiService } from '@ucap-webmessenger/api-common'; @Component({ selector: 'ucap-image-viewer', @@ -20,63 +15,20 @@ export class ImageViewerComponent implements OnInit { fileInfo: FileEventJson; @Input() - downloadUrl: string; - - @Input() - userSeq: number; - - @Input() - deviceType: DeviceType; - - @Input() - token: string; + fileDownloadUrl: string; @Output() closed = new EventEmitter(); @Output() - download = new EventEmitter(); + download = new EventEmitter(); - blob: Blob; - imageSrc: string | ArrayBuffer; + constructor() {} - fileDownloadItem: FileDownloadItem; - - constructor( - private domSanitizer: DomSanitizer, - private commonApiService: CommonApiService - ) { - this.fileDownloadItem = new FileDownloadItem(); - } - - ngOnInit() { - this.commonApiService - .fileTalkDownload( - { - userSeq: this.userSeq, - deviceType: this.deviceType, - token: this.token, - attachmentsSeq: this.fileInfo.attachmentSeq, - fileDownloadItem: this.fileDownloadItem - }, - this.downloadUrl - ) - .pipe( - take(1), - map(async blob => { - this.blob = blob.slice( - 0, - blob.size, - MimeUtil.getMimeFromExtension(this.fileInfo.fileExt) - ); - this.imageSrc = await FileUtil.fromBlobToDataUrl(this.blob); - }) - ) - .subscribe(); - } + ngOnInit() {} onClickDownload(): void { - this.download.emit(this.blob); + this.download.emit(); } onClickClose(): void { diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/sound-viewer.component.ts b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/sound-viewer.component.ts index f6968345..de030392 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/sound-viewer.component.ts +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/sound-viewer.component.ts @@ -14,19 +14,10 @@ export class SoundViewerComponent implements OnInit { fileInfo: FileEventJson; @Input() - downloadUrl: string; - - @Input() - userSeq: number; - - @Input() - deviceType: DeviceType; - - @Input() - token: string; + fileDownloadUrl: string; @Output() - download = new EventEmitter(); + download = new EventEmitter(); @Output() closed = new EventEmitter(); diff --git a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts index 4728ccbb..2effdefd 100644 --- a/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts +++ b/projects/ucap-webmessenger-ui/src/lib/components/file-viewer/video-viewer.component.ts @@ -14,19 +14,10 @@ export class VideoViewerComponent implements OnInit { fileInfo: FileEventJson; @Input() - downloadUrl: string; - - @Input() - userSeq: number; - - @Input() - deviceType: DeviceType; - - @Input() - token: string; + fileDownloadUrl: string; @Output() - download = new EventEmitter(); + download = new EventEmitter(); @Output() closed = new EventEmitter();