화상회의 개설

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 encodeConferenceJoin
} from '../apis/conference-join'; } from '../apis/conference-join';
import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native';
import {
encodeConferenceCreate,
ConferenceCreateRequest
} from '../apis/conference-create';
@Injectable({ @Injectable({
providedIn: 'root' 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 { public conferencejoin(req: ConferenceJoinRequest): void {
let url = this.urls.conferenceJoin; let url = this.urls.conferenceJoin;
url = url + `?${encodeConferenceJoin(req).toString()}`; url = url + `?${encodeConferenceJoin(req).toString()}`;

View File

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

View File

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

View File

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

View File

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

View File

@ -1228,38 +1228,6 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
tokenKey: this.loginResSubject.value.tokenString, tokenKey: this.loginResSubject.value.tokenString,
conferenceSeq: param.conferenceSeq 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: { onContextMenuMessage(params: {

View File

@ -13,6 +13,7 @@
(sendMessage)="onClickSendMessage($event)" (sendMessage)="onClickSendMessage($event)"
(sendCall)="onClickSendClickToCall($event)" (sendCall)="onClickSendClickToCall($event)"
(sendSms)="onClickSendSms($event)" (sendSms)="onClickSendSms($event)"
(createConference)="onClickConferenceCreate($event)"
(toggleFavorit)="onClickToggleFavorit($event)" (toggleFavorit)="onClickToggleFavorit($event)"
(toggleBuddy)="onClickToggleBuddy($event)" (toggleBuddy)="onClickToggleBuddy($event)"
(uploadProfileImage)="onUploadProfileImage($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 { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { KEY_LOGIN_RES_INFO, KEY_VER_INFO, KEY_AUTH_INFO } from '@app/types'; import { KEY_LOGIN_RES_INFO, KEY_VER_INFO, KEY_AUTH_INFO } from '@app/types';
import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { SessionStorageService } from '@ucap-webmessenger/web-storage';
@ -47,7 +47,8 @@ import {
} from '../message/message-write.dialog.component'; } from '../message/message-write.dialog.component';
import { import {
CallService, CallService,
PromptMessageStatusCode PromptMessageStatusCode,
ConferenceService
} from '@ucap-webmessenger/api-prompt'; } from '@ucap-webmessenger/api-prompt';
import { NGXLogger } from 'ngx-logger'; import { NGXLogger } from 'ngx-logger';
import { SmsUtils } from '@ucap-webmessenger/daesang'; import { SmsUtils } from '@ucap-webmessenger/daesang';
@ -94,6 +95,7 @@ export class ProfileDialogComponent implements OnInit, OnDestroy {
private dialogService: DialogService, private dialogService: DialogService,
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
private commonApiService: CommonApiService, private commonApiService: CommonApiService,
private conferenceService: ConferenceService,
private callService: CallService, private callService: CallService,
private snackBarService: SnackBarService, private snackBarService: SnackBarService,
private translateService: TranslateService, private translateService: TranslateService,
@ -195,6 +197,16 @@ export class ProfileDialogComponent implements OnInit, OnDestroy {
this.dialogRef.close({ closeEvent: 'CHAT' }); 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) { onClickSendMessage(userInfo: UserInfoSS) {
if (userInfo.seq !== this.loginRes.userSeq) { if (userInfo.seq !== this.loginRes.userSeq) {
this.dialogRef.close(); this.dialogRef.close();

View File

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

View File

@ -39,7 +39,7 @@ import { NGXLogger } from 'ngx-logger';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy'; import { OpenProfileOptions } from '@ucap-webmessenger/protocol-buddy';
import { DaesangProtocolService, SmsUtils } from '@ucap-webmessenger/daesang'; 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 { EnvironmentsInfo, KEY_ENVIRONMENTS_INFO } from '@app/types';
import { import {
SessionStorageService, SessionStorageService,
@ -94,6 +94,7 @@ export class MainPageComponent implements OnInit, OnDestroy {
private ngZone: NgZone, private ngZone: NgZone,
private statusProtocolService: StatusProtocolService, private statusProtocolService: StatusProtocolService,
private daesangProtocolService: DaesangProtocolService, private daesangProtocolService: DaesangProtocolService,
private conferenceService: ConferenceService,
private callService: CallService, private callService: CallService,
private localStorageService: LocalStorageService, private localStorageService: LocalStorageService,
private sessionStorageService: SessionStorageService, private sessionStorageService: SessionStorageService,
@ -445,6 +446,18 @@ export class MainPageComponent implements OnInit, OnDestroy {
smsUtil.openSendSms(this.loginRes.tokenString, employeeNum); 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() { onCloseRightDrawer() {
this.rightDrawer.close(); this.rightDrawer.close();
} }

View File

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