diff --git a/projects/ucap-webmessenger-api-prompt/src/lib/apis/conference-join.ts b/projects/ucap-webmessenger-api-prompt/src/lib/apis/conference-join.ts new file mode 100644 index 00000000..f70b049e --- /dev/null +++ b/projects/ucap-webmessenger-api-prompt/src/lib/apis/conference-join.ts @@ -0,0 +1,39 @@ +import { + APIRequest, + APIDecoder, + APIEncoder, + ParameterUtil +} from '@ucap-webmessenger/api'; +import { DeviceType } from '@ucap-webmessenger/core'; +import { PromptAPIResponse } from './api-prompt'; + +export interface ConferenceJoinRequest extends APIRequest { + userSeq: number; + deviceType: DeviceType; + tokenKey: string; + conferenceSeq: number; +} + +export interface ConferenceJoinResponse extends PromptAPIResponse {} + +const conferenceJoinEncodeMap = { + userSeq: 'userSeq', + deviceType: 'deviceType', + tokenKey: 'tokenKey', + conferenceSeq: 'roomSeq' +}; + +export const encodeConferenceJoin: APIEncoder = ( + req: ConferenceJoinRequest +) => { + return ParameterUtil.encode(conferenceJoinEncodeMap, req); +}; + +export const decodeConferenceJoin: APIDecoder = ( + res: any +) => { + return { + responseCode: res.responseCode, + responseMsg: res.responseMsg + } as ConferenceJoinResponse; +}; diff --git a/projects/ucap-webmessenger-api-prompt/src/lib/config/urls.ts b/projects/ucap-webmessenger-api-prompt/src/lib/config/urls.ts index 9a601549..0ee9c1ee 100644 --- a/projects/ucap-webmessenger-api-prompt/src/lib/config/urls.ts +++ b/projects/ucap-webmessenger-api-prompt/src/lib/config/urls.ts @@ -1,4 +1,9 @@ export interface Urls { /** Click to Call */ sendCall: string; + + /** 화상회의 개설 */ + conferenceCreate: string; + /** 화상회의 참여 */ + conferenceJoin: string; } diff --git a/projects/ucap-webmessenger-api-prompt/src/lib/services/conference.service.ts b/projects/ucap-webmessenger-api-prompt/src/lib/services/conference.service.ts new file mode 100644 index 00000000..453889bd --- /dev/null +++ b/projects/ucap-webmessenger-api-prompt/src/lib/services/conference.service.ts @@ -0,0 +1,39 @@ +import { Injectable, Inject } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; + +import { _MODULE_CONFIG } from '../config/token'; +import { ModuleConfig } from '../config/module-config'; +import { Urls } from '../config/urls'; +import { UrlConfig, WindowUtil } from '@ucap-webmessenger/core'; +import { NGXLogger } from 'ngx-logger'; +import { + ConferenceJoinRequest, + encodeConferenceJoin +} from '../apis/conference-join'; +import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native'; + +@Injectable({ + providedIn: 'root' +}) +export class ConferenceService { + readonly urls: Urls; + + constructor( + @Inject(_MODULE_CONFIG) private moduleConfig: ModuleConfig, + @Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService, + private httpClient: HttpClient, + private logger: NGXLogger + ) { + this.urls = UrlConfig.getUrls( + this.moduleConfig.hostConfig, + this.moduleConfig.urls + ); + } + + public conferencejoin(req: ConferenceJoinRequest): void { + let url = this.urls.conferenceJoin; + url = url + `?${encodeConferenceJoin(req).toString()}`; + // WindowUtil.popupOpen(url, 'DaesangConfJoin', 685, 640); + this.nativeService.openDefaultBrowser(url); + } +} diff --git a/projects/ucap-webmessenger-api-prompt/src/public-api.ts b/projects/ucap-webmessenger-api-prompt/src/public-api.ts index 48f324e8..b1f273bc 100644 --- a/projects/ucap-webmessenger-api-prompt/src/public-api.ts +++ b/projects/ucap-webmessenger-api-prompt/src/public-api.ts @@ -4,8 +4,10 @@ export * from './lib/apis/api-prompt'; export * from './lib/apis/call'; +export * from './lib/apis/conference-join'; export * from './lib/services/call.service'; +export * from './lib/services/conference.service'; export * from './lib/types/prompt-message-status-code.type'; diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts index fb3d708b..34f89ab2 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts @@ -134,6 +134,7 @@ import { ConferenceDetailDialogResult, ConferenceDetailDialogData } from '../dialogs/conference/conference-detail.dialog.component'; +import { ConferenceService } from '@ucap-webmessenger/api-prompt'; @Component({ selector: 'app-layout-messenger-messages', @@ -244,6 +245,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { private localStorageService: LocalStorageService, private commonApiService: CommonApiService, private clipboardService: ClipboardService, + private conferenceService: ConferenceService, private uiTranslateService: UiTranslateService, private translateService: TranslateService, private changeDetectorRef: ChangeDetectorRef, @@ -1220,8 +1222,44 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { /** [Event] Conference Join */ onClickConferenceJoin(param: VideoConferenceEventJson) { + this.conferenceService.conferencejoin({ + userSeq: this.loginResSubject.value.userSeq, + deviceType: this.environmentsInfo.deviceType, + tokenKey: this.loginResSubject.value.tokenString, + conferenceSeq: param.conferenceSeq + }); // this.conferenceJoin.emit(param); - console.log('aaa', 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: { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts index 4a7f3468..288b593a 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/messenger.layout.module.ts @@ -34,6 +34,7 @@ import { MatPaginatorModule } from '@angular/material/paginator'; import { MatRippleModule } from '@angular/material/core'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatSidenavModule } from '@angular/material/sidenav'; +import { MatExpansionModule } from '@angular/material/expansion'; import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar'; import { VirtualScrollerModule } from 'ngx-virtual-scroller'; @@ -90,6 +91,7 @@ import { UCapDaesangModule } from '@ucap-webmessenger/daesang'; MatRippleModule, MatTooltipModule, MatSidenavModule, + MatExpansionModule, PerfectScrollbarModule, VirtualScrollerModule, diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/en.json b/projects/ucap-webmessenger-app/src/assets/i18n/en.json index 1d12f22f..54728b02 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/en.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/en.json @@ -246,14 +246,6 @@ "showMassDetail": "Show detail", "readToHere": "Read to here", "recalled": "Recalled", - "videoConferenceTypeNow": "[Video Meeting] Registered", - "videoConferenceTypeNew": "[Video Meeting] Reservation", - "videoConferenceTypeUpdate": "[Video Meeting] Modified", - "videoConferenceTypeDelete": "[Video Meeting] Deleted", - "videoConferenceRegister": "Establisher", - "videoConferenceAttendee": "Participants", - "videoConferenceDate": "Date", - "videoConferenceEnjoy": "Attend", "scheduleTypeNew": "[Event] Registered", "scheduleTypeUpdate": "[Event] Modified", "scheduleTypeDelete": "[Event] Deleted", @@ -371,6 +363,18 @@ "haveNoPermission": "You do not have SMS permissions." } }, + "conference": { + "detailView": "Detail View", + "videoConferenceTypeNow": "[Video Meeting] Registered", + "videoConferenceTypeNew": "[Video Meeting] Reservation", + "videoConferenceTypeUpdate": "[Video Meeting] Modified", + "videoConferenceTypeDelete": "[Video Meeting] Deleted", + "videoConferenceRegister": "Establisher", + "videoConferenceAttendee": "Participants", + "videoConferenceDate": "Date", + "videoConferenceRoom": "Meeting Room", + "videoConferenceEnjoy": "Attend" + }, "update": { "label": "Update" }, diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json index bfa02024..44f1bff8 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json @@ -246,14 +246,6 @@ "showMassDetail": "전체 보기", "readToHere": "여기까지 읽었습니다.", "recalled": "회수된 메시지", - "videoConferenceTypeNow": "[화상회의] 개설", - "videoConferenceTypeNew": "[화상회의] 예약", - "videoConferenceTypeUpdate": "[화상회의] 수정", - "videoConferenceTypeDelete": "[화상회의] 삭제", - "videoConferenceRegister": "개설자", - "videoConferenceAttendee": "참여자", - "videoConferenceDate": "날짜", - "videoConferenceEnjoy": "참석하기", "scheduleTypeNew": "[이벤트] 등록", "scheduleTypeUpdate": "[이벤트] 수정", "scheduleTypeDelete": "[이벤트] 삭제", @@ -371,6 +363,18 @@ "haveNoPermission": "SMS 사용 권한이 없습니다." } }, + "conference": { + "detailView": "상세 보기", + "videoConferenceTypeNow": "[화상회의] 개설", + "videoConferenceTypeNew": "[화상회의] 예약", + "videoConferenceTypeUpdate": "[화상회의] 수정", + "videoConferenceTypeDelete": "[화상회의] 삭제", + "videoConferenceRegister": "개설자", + "videoConferenceAttendee": "참여자", + "videoConferenceDate": "날짜", + "videoConferenceRoom": "회의실", + "videoConferenceEnjoy": "참석하기" + }, "update": { "label": "업데이트" }, diff --git a/projects/ucap-webmessenger-app/src/environments/environment.type.ts b/projects/ucap-webmessenger-app/src/environments/environment.type.ts index a93df23f..15c0f670 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.type.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.type.ts @@ -170,7 +170,9 @@ export const messageApiUrls: MessageApiUrls = { retrieveNoticeList: '/uCapMsg/notice/retrieveNoticeList.do' }; export const promptUrls: PromptUrls = { - sendCall: '/uCapPrompt/api/call/clicktocall' + sendCall: '/uCapPrompt/api/call/clicktocall', + conferenceCreate: '/uCapPrompt/conference/create', + conferenceJoin: '/uCapPrompt/conference/join' }; export const piUrls: PiUrls = { login2: '/uCapPi/login2',