화상회의 개설

This commit is contained in:
leejinho 2020-02-24 12:35:56 +09:00
parent ee526e0f17
commit 389db64acc
12 changed files with 100 additions and 43 deletions

View File

@ -0,0 +1,42 @@
import {
APIRequest,
APIDecoder,
APIEncoder,
ParameterUtil
} from '@ucap-webmessenger/api';
import { DeviceType } from '@ucap-webmessenger/core';
import { PromptAPIResponse } from './api-prompt';
export interface ConferenceCreateRequest extends APIRequest {
userSeq: number;
deviceType: DeviceType;
tokenKey: string;
targetUserSeqs: number[];
}
export interface ConferenceCreateResponse extends PromptAPIResponse {}
const conferenceCreateEncodeMap = {
userSeq: 'userSeq',
deviceType: 'deviceType',
tokenKey: 'tokenKey',
targetUserSeqs: 'targetUserSeqs'
};
export const encodeConferenceCreate: APIEncoder<ConferenceCreateRequest> = (
req: ConferenceCreateRequest
) => {
const extraParams: any = {};
extraParams.targetUserSeqs = req.targetUserSeqs.join(',');
return ParameterUtil.encode(conferenceCreateEncodeMap, req, extraParams);
};
export const decodeConferenceCreate: APIDecoder<ConferenceCreateResponse> = (
res: any
) => {
return {
responseCode: res.responseCode,
responseMsg: res.responseMsg
} as ConferenceCreateResponse;
};

View File

@ -11,6 +11,10 @@ import {
encodeConferenceJoin
} from '../apis/conference-join';
import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native';
import {
encodeConferenceCreate,
ConferenceCreateRequest
} from '../apis/conference-create';
@Injectable({
providedIn: 'root'
@ -30,6 +34,13 @@ export class ConferenceService {
);
}
public conferenceCreate(req: ConferenceCreateRequest): void {
let url = this.urls.conferenceCreate;
url = url + `?${encodeConferenceCreate(req).toString()}`;
// WindowUtil.popupOpen(url, 'DaesangConfJoin', 685, 640);
this.nativeService.openDefaultBrowser(url);
}
public conferencejoin(req: ConferenceJoinRequest): void {
let url = this.urls.conferenceJoin;
url = url + `?${encodeConferenceJoin(req).toString()}`;

View File

@ -4,6 +4,7 @@
export * from './lib/apis/api-prompt';
export * from './lib/apis/call';
export * from './lib/apis/conference-create';
export * from './lib/apis/conference-join';
export * from './lib/services/call.service';

View File

@ -35,6 +35,7 @@
(openProfile)="onClickOpenProfile($event)"
(sendCall)="onClickSendClickToCall($event)"
(sendSms)="onClickSendSms($event)"
(createConference)="onClickConferenceCreate()"
(toggleUser)="onToggleUser($event)"
(resetSelectedUserList)="onResetSelectedUserList($event)"
class="organization-side"

View File

@ -67,6 +67,8 @@ export class LeftSideComponent implements OnInit, OnDestroy {
sendCall = new EventEmitter<string>();
@Output()
sendSms = new EventEmitter<string>();
@Output()
createConference = new EventEmitter<number[]>();
@ViewChildren('tabs') tabs: QueryList<ElementRef<HTMLDivElement>>;
currentTabLable: string;
@ -263,6 +265,11 @@ export class LeftSideComponent implements OnInit, OnDestroy {
onClickSendSms(employeeNum: string) {
this.sendSms.emit(employeeNum);
}
/** [Event] Conference Create */
onClickConferenceCreate() {
const targetUserSeqs = this.selectedUserList.map(userInfo => userInfo.seq);
this.createConference.emit(targetUserSeqs);
}
setFabInitial(type: string) {
switch (type) {

View File

@ -125,6 +125,8 @@ export class OrganizationComponent
sendCall = new EventEmitter<string>();
@Output()
sendSms = new EventEmitter<string>();
@Output()
createConference = new EventEmitter<void>();
@ViewChild('vsDeptUser', { static: false })
private vsDeptUser: VirtualScrollerComponent;
@ -633,13 +635,7 @@ export class OrganizationComponent
}
}
onClickConference() {
this.logger.debug('onClickConference', this.selectedUserList);
// 상위 컴포넌트의 selectedUserList clear.
this.checkAllUser.emit({
isChecked: false,
userInfos: this.selectedUserList
});
this.createConference.emit();
}
onContextMenuOrgUser(

View File

@ -1228,38 +1228,6 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
tokenKey: this.loginResSubject.value.tokenString,
conferenceSeq: param.conferenceSeq
});
// this.conferenceJoin.emit(param);
// console.log('aaa', param);
// const mapForm = document.createElement('form');
// const milliseconds = new Date().getTime();
// const windowName = 'Conference_' + milliseconds;
// mapForm.target = windowName;
// mapForm.method = 'POST';
// mapForm.action =
// 'https://dstalk.daesang.com:9097/uCapPrompt/conference/join';
// const keyParams = ['userSeq', 'deviceType', 'tokenKey', 'roomSeq'];
// const valueParams = [
// this.loginResSubject.value.userSeq.toString(),
// this.environmentsInfo.deviceType,
// this.loginResSubject.value.tokenString,
// param.conferenceSeq.toString()
// ];
// if (keyParams && valueParams && keyParams.length === valueParams.length) {
// for (let i = 0; i < keyParams.length; i++) {
// const mapInput = document.createElement('input');
// mapInput.type = 'hidden';
// mapInput.name = keyParams[i];
// mapInput.value = valueParams[i];
// mapForm.appendChild(mapInput);
// }
// document.body.appendChild(mapForm);
// }
// const winpop = window.open('', windowName, '');
// if (winpop) {
// mapForm.submit();
// } else {
// this.logger.error('Error Open Popup');
// }
}
onContextMenuMessage(params: {

View File

@ -13,6 +13,7 @@
(sendMessage)="onClickSendMessage($event)"
(sendCall)="onClickSendClickToCall($event)"
(sendSms)="onClickSendSms($event)"
(createConference)="onClickConferenceCreate($event)"
(toggleFavorit)="onClickToggleFavorit($event)"
(toggleBuddy)="onClickToggleBuddy($event)"
(uploadProfileImage)="onUploadProfileImage($event)"

View File

@ -1,4 +1,4 @@
import { Component, OnInit, Inject, ViewChild, OnDestroy } from '@angular/core';
import { Component, OnInit, Inject, OnDestroy } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { KEY_LOGIN_RES_INFO, KEY_VER_INFO, KEY_AUTH_INFO } from '@app/types';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
@ -47,7 +47,8 @@ import {
} from '../message/message-write.dialog.component';
import {
CallService,
PromptMessageStatusCode
PromptMessageStatusCode,
ConferenceService
} from '@ucap-webmessenger/api-prompt';
import { NGXLogger } from 'ngx-logger';
import { SmsUtils } from '@ucap-webmessenger/daesang';
@ -94,6 +95,7 @@ export class ProfileDialogComponent implements OnInit, OnDestroy {
private dialogService: DialogService,
private sessionStorageService: SessionStorageService,
private commonApiService: CommonApiService,
private conferenceService: ConferenceService,
private callService: CallService,
private snackBarService: SnackBarService,
private translateService: TranslateService,
@ -195,6 +197,16 @@ export class ProfileDialogComponent implements OnInit, OnDestroy {
this.dialogRef.close({ closeEvent: 'CHAT' });
}
/** [Event] Conference Create */
onClickConferenceCreate(userSeq: number) {
this.conferenceService.conferenceCreate({
userSeq: this.loginRes.userSeq,
deviceType: this.environmentsInfo.deviceType,
tokenKey: this.loginRes.tokenString,
targetUserSeqs: [userSeq]
});
}
onClickSendMessage(userInfo: UserInfoSS) {
if (userInfo.seq !== this.loginRes.userSeq) {
this.dialogRef.close();

View File

@ -10,6 +10,7 @@
(openProfile)="onClickOpenProfile($event)"
(sendCall)="sendClickToCall($event)"
(sendSms)="openSms($event)"
(createConference)="conferenceCreate($event)"
(mouseenter)="onMouseEnterLeftSideContainer($event)"
(mouseleave)="onMouseLeaveLeftSideContainer($event)"
></app-layout-messenger-left-side>

View File

@ -39,7 +39,7 @@ import { NGXLogger } from 'ngx-logger';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy';
import { DaesangProtocolService, SmsUtils } from '@ucap-webmessenger/daesang';
import { CallService } from '@ucap-webmessenger/api-prompt';
import { CallService, ConferenceService } from '@ucap-webmessenger/api-prompt';
import { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types';
import {
SessionStorageService,
@ -94,6 +94,7 @@ export class MainPageComponent implements OnInit, OnDestroy {
private ngZone: NgZone,
private statusProtocolService: StatusProtocolService,
private daesangProtocolService: DaesangProtocolService,
private conferenceService: ConferenceService,
private callService: CallService,
private localStorageService: LocalStorageService,
private sessionStorageService: SessionStorageService,
@ -445,6 +446,18 @@ export class MainPageComponent implements OnInit, OnDestroy {
smsUtil.openSendSms(this.loginRes.tokenString, employeeNum);
}
/** [Event] Conference Create */
conferenceCreate(targetUserSeqs: number[]) {
if (!!targetUserSeqs && targetUserSeqs.length > 0) {
this.conferenceService.conferenceCreate({
userSeq: this.loginRes.userSeq,
deviceType: this.environmentsInfo.deviceType,
tokenKey: this.loginRes.tokenString,
targetUserSeqs
});
}
}
onCloseRightDrawer() {
this.rightDrawer.close();
}

View File

@ -54,6 +54,8 @@ export class ProfileComponent implements OnInit {
@Output()
sendSms = new EventEmitter<string>();
@Output()
createConference = new EventEmitter<number>();
@Output()
toggleFavorit = new EventEmitter<{
userInfo: UserInfoSS;
isFavorit: boolean;
@ -103,7 +105,9 @@ export class ProfileComponent implements OnInit {
this.sendSms.emit(this.userInfo.employeeNum);
}
onClickVideoConference() {}
onClickVideoConference() {
this.createConference.emit(this.userInfo.seq);
}
onClickMessage() {
this.sendMessage.emit(this.userInfo);