From d2ac61381a0461ad3439c50a6be2579849b1699e Mon Sep 17 00:00:00 2001 From: leejh Date: Wed, 25 Sep 2019 16:13:33 +0900 Subject: [PATCH] rename --- .../src/lib/models/add.ts | 12 +- .../src/lib/models/del.ts | 12 +- .../src/lib/models/update.ts | 12 +- .../lib/services/buddy-protocol.service.ts | 40 ++-- .../src/lib/models/add.ts | 12 +- .../src/lib/models/del.ts | 12 +- .../src/lib/models/update.ts | 20 +- .../lib/services/group-protocol.service.ts | 56 ++--- .../src/lib/models/exit.ts | 40 ++-- .../src/lib/models/info.ts | 53 ++--- .../src/lib/models/invite.ts | 20 +- .../src/lib/models/open.ts | 48 ++-- .../src/lib/models/update.ts | 48 ++-- .../src/lib/services/room-protocol.service.ts | 222 +++++++++--------- .../lib/services/service-protocol.service.ts | 2 +- 15 files changed, 280 insertions(+), 329 deletions(-) diff --git a/projects/ucap-webmessenger-protocol-buddy/src/lib/models/add.ts b/projects/ucap-webmessenger-protocol-buddy/src/lib/models/add.ts index 64416f74..e5be0bf9 100644 --- a/projects/ucap-webmessenger-protocol-buddy/src/lib/models/add.ts +++ b/projects/ucap-webmessenger-protocol-buddy/src/lib/models/add.ts @@ -9,19 +9,17 @@ import { ProtocolMessage } from '@ucap-webmessenger/protocol'; -export interface BuddyAddRequest extends ProtocolRequest { +export interface AddRequest extends ProtocolRequest { // 0n. 사용자SEQ(n)... userSeqs: number[]; } -export interface BuddyAddResponse extends ProtocolResponse { +export interface AddResponse extends ProtocolResponse { // 0n. 사용자SEQ(n)... userSeqs: number[]; } -export const encodeBuddyAdd: ProtocolEncoder = ( - req: BuddyAddRequest -) => { +export const encodeAdd: ProtocolEncoder = (req: AddRequest) => { const bodyList: PacketBody[] = []; for (const userSeq of req.userSeqs) { @@ -31,11 +29,11 @@ export const encodeBuddyAdd: ProtocolEncoder = ( return bodyList; }; -export const decodeBuddyAdd: ProtocolDecoder = ( +export const decodeAdd: ProtocolDecoder = ( message: ProtocolMessage ) => { const userSeqArray: number[] = [...message.bodyList]; return { userSeqs: userSeqArray - } as BuddyAddResponse; + } as AddResponse; }; diff --git a/projects/ucap-webmessenger-protocol-buddy/src/lib/models/del.ts b/projects/ucap-webmessenger-protocol-buddy/src/lib/models/del.ts index d0860eef..8ac0c462 100644 --- a/projects/ucap-webmessenger-protocol-buddy/src/lib/models/del.ts +++ b/projects/ucap-webmessenger-protocol-buddy/src/lib/models/del.ts @@ -9,19 +9,17 @@ import { ProtocolMessage } from '@ucap-webmessenger/protocol'; -export interface BuddyDelRequest extends ProtocolRequest { +export interface DelRequest extends ProtocolRequest { // 0n. 사용자SEQ(n)... userSeqs: number[]; } -export interface BuddyDelResponse extends ProtocolResponse { +export interface DelResponse extends ProtocolResponse { // 0n. 사용자SEQ(n)... userSeqs: number[]; } -export const encodeBuddyDel: ProtocolEncoder = ( - req: BuddyDelRequest -) => { +export const encodeDel: ProtocolEncoder = (req: DelRequest) => { const bodyList: PacketBody[] = []; for (const userSeq of req.userSeqs) { @@ -31,11 +29,11 @@ export const encodeBuddyDel: ProtocolEncoder = ( return bodyList; }; -export const decodeBuddyDel: ProtocolDecoder = ( +export const decodeDel: ProtocolDecoder = ( message: ProtocolMessage ) => { const userSeqArray: number[] = [...message.bodyList]; return { userSeqs: userSeqArray - } as BuddyDelResponse; + } as DelResponse; }; diff --git a/projects/ucap-webmessenger-protocol-buddy/src/lib/models/update.ts b/projects/ucap-webmessenger-protocol-buddy/src/lib/models/update.ts index 2a349f31..2a0a0de2 100644 --- a/projects/ucap-webmessenger-protocol-buddy/src/lib/models/update.ts +++ b/projects/ucap-webmessenger-protocol-buddy/src/lib/models/update.ts @@ -9,22 +9,22 @@ import { ProtocolMessage } from '@ucap-webmessenger/protocol'; -export interface BuddyUpdateRequest extends ProtocolRequest { +export interface UpdateRequest extends ProtocolRequest { // 0. 사용자SEQ(n) seq: number; // 1. 즐겨찾기여부(y) isFavorit: boolean; } -export interface BuddyUpdateResponse extends ProtocolResponse { +export interface UpdateResponse extends ProtocolResponse { // 0. 사용자SEQ(n) seq: number; // 1. 즐겨찾기여부(y) isFavorit: boolean; } -export const encodeBuddyUpdate: ProtocolEncoder = ( - req: BuddyUpdateRequest +export const encodeUpdate: ProtocolEncoder = ( + req: UpdateRequest ) => { const bodyList: PacketBody[] = []; @@ -37,11 +37,11 @@ export const encodeBuddyUpdate: ProtocolEncoder = ( return bodyList; }; -export const decodeBuddyUpdate: ProtocolDecoder = ( +export const decodeUpdate: ProtocolDecoder = ( message: ProtocolMessage ) => { return { seq: message.bodyList[0], isFavorit: message.bodyList[1] === 'Y' ? true : false - } as BuddyUpdateResponse; + } as UpdateResponse; }; diff --git a/projects/ucap-webmessenger-protocol-buddy/src/lib/services/buddy-protocol.service.ts b/projects/ucap-webmessenger-protocol-buddy/src/lib/services/buddy-protocol.service.ts index adc52dc7..90fe5d0e 100644 --- a/projects/ucap-webmessenger-protocol-buddy/src/lib/services/buddy-protocol.service.ts +++ b/projects/ucap-webmessenger-protocol-buddy/src/lib/services/buddy-protocol.service.ts @@ -12,23 +12,13 @@ import { SSVC_TYPE_BUDDY_UPD_REQ } from '../types/service'; +import { AddRequest, encodeAdd, decodeAdd, AddResponse } from '../models/add'; +import { DelRequest, encodeDel, decodeDel, DelResponse } from '../models/del'; import { - BuddyAddRequest, - encodeBuddyAdd, - decodeBuddyAdd, - BuddyAddResponse -} from '../models/add'; -import { - BuddyDelRequest, - encodeBuddyDel, - decodeBuddyDel, - BuddyDelResponse -} from '../models/del'; -import { - BuddyUpdateRequest, - decodeBuddyUpdate, - encodeBuddyUpdate, - BuddyUpdateResponse + UpdateRequest, + decodeUpdate, + encodeUpdate, + UpdateResponse } from '../models/update'; @Injectable({ @@ -37,30 +27,30 @@ import { export class BuddyProtocolService { constructor(private protocolService: ProtocolService) {} - public buddyAdd(req: BuddyAddRequest): Observable { + public add(req: AddRequest): Observable { return this.protocolService - .call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_ADD_REQ, ...encodeBuddyAdd(req)) + .call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_ADD_REQ, ...encodeAdd(req)) .pipe( take(1), - map(res => decodeBuddyAdd(res)) + map(res => decodeAdd(res)) ); } - public buddyDel(req: BuddyDelRequest): Observable { + public del(req: DelRequest): Observable { return this.protocolService - .call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_DEL_REQ, ...encodeBuddyDel(req)) + .call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_DEL_REQ, ...encodeDel(req)) .pipe( take(1), - map(res => decodeBuddyDel(res)) + map(res => decodeDel(res)) ); } - public buddyUpdate(req: BuddyUpdateRequest): Observable { + public update(req: UpdateRequest): Observable { return this.protocolService - .call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_UPD_REQ, ...encodeBuddyUpdate(req)) + .call(SVC_TYPE_BUDDY, SSVC_TYPE_BUDDY_UPD_REQ, ...encodeUpdate(req)) .pipe( take(1), - map(res => decodeBuddyUpdate(res)) + map(res => decodeUpdate(res)) ); } } diff --git a/projects/ucap-webmessenger-protocol-group/src/lib/models/add.ts b/projects/ucap-webmessenger-protocol-group/src/lib/models/add.ts index 0a6a51e4..97d37140 100644 --- a/projects/ucap-webmessenger-protocol-group/src/lib/models/add.ts +++ b/projects/ucap-webmessenger-protocol-group/src/lib/models/add.ts @@ -9,21 +9,19 @@ import { ProtocolMessage } from '@ucap-webmessenger/protocol'; -export interface GroupAddRequest extends ProtocolRequest { +export interface AddRequest extends ProtocolRequest { // 0. 동료그룹이름 groupName: string; } -export interface GroupAddResponse extends ProtocolResponse { +export interface AddResponse extends ProtocolResponse { // 0: 동료그룹SEQ(n) groupSeq: number; // 1: 동료그룹이름(s) groupName: string; } -export const encodeGroupAdd: ProtocolEncoder = ( - req: GroupAddRequest -) => { +export const encodeAdd: ProtocolEncoder = (req: AddRequest) => { const bodyList: PacketBody[] = []; bodyList.push({ type: PacketBodyValue.String, value: req.groupName }); @@ -31,11 +29,11 @@ export const encodeGroupAdd: ProtocolEncoder = ( return bodyList; }; -export const decodeGroupAdd: ProtocolDecoder = ( +export const decodeAdd: ProtocolDecoder = ( message: ProtocolMessage ) => { return { groupSeq: message.bodyList[0], groupName: message.bodyList[1] - } as GroupAddResponse; + } as AddResponse; }; diff --git a/projects/ucap-webmessenger-protocol-group/src/lib/models/del.ts b/projects/ucap-webmessenger-protocol-group/src/lib/models/del.ts index 1612aa6b..94783d56 100644 --- a/projects/ucap-webmessenger-protocol-group/src/lib/models/del.ts +++ b/projects/ucap-webmessenger-protocol-group/src/lib/models/del.ts @@ -9,19 +9,17 @@ import { ProtocolMessage } from '@ucap-webmessenger/protocol'; -export interface GroupDelRequest extends ProtocolRequest { +export interface DelRequest extends ProtocolRequest { // 0: 동료그룹SEQ(n) groupSeq: number; } -export interface GroupDelResponse extends ProtocolResponse { +export interface DelResponse extends ProtocolResponse { // 0: 동료그룹SEQ(n) groupSeq: number; } -export const encodeGroupDel: ProtocolEncoder = ( - req: GroupDelRequest -) => { +export const encodeDel: ProtocolEncoder = (req: DelRequest) => { const bodyList: PacketBody[] = []; bodyList.push({ type: PacketBodyValue.Integer, value: req.groupSeq }); @@ -29,10 +27,10 @@ export const encodeGroupDel: ProtocolEncoder = ( return bodyList; }; -export const decodeGroupDel: ProtocolDecoder = ( +export const decodeDel: ProtocolDecoder = ( message: ProtocolMessage ) => { return { groupSeq: message.bodyList[0] - } as GroupDelResponse; + } as DelResponse; }; diff --git a/projects/ucap-webmessenger-protocol-group/src/lib/models/update.ts b/projects/ucap-webmessenger-protocol-group/src/lib/models/update.ts index 996b5f5a..0504baad 100644 --- a/projects/ucap-webmessenger-protocol-group/src/lib/models/update.ts +++ b/projects/ucap-webmessenger-protocol-group/src/lib/models/update.ts @@ -9,7 +9,7 @@ import { ProtocolMessage } from '@ucap-webmessenger/protocol'; -export interface GroupUpdateRequest extends ProtocolRequest { +export interface UpdateRequest extends ProtocolRequest { // 0: 동료그룹SEQ(n) groupSeq: number; // 1: 동료그룹이름(s) @@ -18,7 +18,7 @@ export interface GroupUpdateRequest extends ProtocolRequest { userSeqs: number[]; } -export interface GroupUpdateResponse extends ProtocolResponse { +export interface UpdateResponse extends ProtocolResponse { // 0: 동료그룹SEQ(n) groupSeq: number; // 1: 동료그룹이름(s) @@ -27,8 +27,8 @@ export interface GroupUpdateResponse extends ProtocolResponse { userSeqs: number[]; } -export const encodeGroupUpdate: ProtocolEncoder = ( - req: GroupUpdateRequest +export const encodeUpdate: ProtocolEncoder = ( + req: UpdateRequest ) => { const bodyList: PacketBody[] = []; @@ -41,7 +41,7 @@ export const encodeGroupUpdate: ProtocolEncoder = ( return bodyList; }; -export const decodeGroupUpdate: ProtocolDecoder = ( +export const decodeUpdate: ProtocolDecoder = ( message: ProtocolMessage ) => { let userSeqArray: number[] = []; @@ -53,11 +53,11 @@ export const decodeGroupUpdate: ProtocolDecoder = ( groupSeq: message.bodyList[0], groupName: message.bodyList[1], userSeqs: userSeqArray - } as GroupUpdateResponse; + } as UpdateResponse; }; -export const encodeGroupUpdate2: ProtocolEncoder = ( - req: GroupUpdateRequest +export const encodeUpdate2: ProtocolEncoder = ( + req: UpdateRequest ) => { const bodyList: PacketBody[] = []; @@ -75,7 +75,7 @@ export const encodeGroupUpdate2: ProtocolEncoder = ( return bodyList; }; -export const decodeGroupUpdate2: ProtocolDecoder = ( +export const decodeUpdate2: ProtocolDecoder = ( message: ProtocolMessage ) => { let userSeqArray: number[] = []; @@ -87,5 +87,5 @@ export const decodeGroupUpdate2: ProtocolDecoder = ( groupSeq: message.bodyList[0], groupName: message.bodyList[1], userSeqs: userSeqArray - } as GroupUpdateResponse; + } as UpdateResponse; }; diff --git a/projects/ucap-webmessenger-protocol-group/src/lib/services/group-protocol.service.ts b/projects/ucap-webmessenger-protocol-group/src/lib/services/group-protocol.service.ts index 57079fcc..b95dea2f 100644 --- a/projects/ucap-webmessenger-protocol-group/src/lib/services/group-protocol.service.ts +++ b/projects/ucap-webmessenger-protocol-group/src/lib/services/group-protocol.service.ts @@ -4,12 +4,6 @@ import { Observable } from 'rxjs'; import { map, take } from 'rxjs/operators'; import { ProtocolService } from '@ucap-webmessenger/protocol'; -import { - GroupAddRequest, - encodeGroupAdd, - decodeGroupAdd, - GroupAddResponse -} from '../models/add'; import { SVC_TYPE_GROUP, SSVC_TYPE_GROUP_ADD_REQ, @@ -17,19 +11,15 @@ import { SSVC_TYPE_GROUP_UPD_REQ, SSVC_TYPE_GROUP_UPD_REQ2 } from '../types/service'; +import { AddRequest, encodeAdd, decodeAdd, AddResponse } from '../models/add'; +import { DelRequest, encodeDel, decodeDel, DelResponse } from '../models/del'; import { - GroupDelRequest, - encodeGroupDel, - decodeGroupDel, - GroupDelResponse -} from '../models/del'; -import { - GroupUpdateRequest, - encodeGroupUpdate, - decodeGroupUpdate, - encodeGroupUpdate2, - decodeGroupUpdate2, - GroupUpdateResponse + UpdateRequest, + encodeUpdate, + decodeUpdate, + encodeUpdate2, + decodeUpdate2, + UpdateResponse } from '../models/update'; @Injectable({ providedIn: 'root' @@ -37,45 +27,39 @@ import { export class GroupProtocolService { constructor(private protocolService: ProtocolService) {} - public groupAdd(req: GroupAddRequest): Observable { + public add(req: AddRequest): Observable { return this.protocolService - .call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_ADD_REQ, ...encodeGroupAdd(req)) + .call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_ADD_REQ, ...encodeAdd(req)) .pipe( take(1), - map(res => decodeGroupAdd(res)) + map(res => decodeAdd(res)) ); } - public groupDel(req: GroupDelRequest): Observable { + public del(req: DelRequest): Observable { return this.protocolService - .call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_DEL_REQ, ...encodeGroupDel(req)) + .call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_DEL_REQ, ...encodeDel(req)) .pipe( take(1), - map(res => decodeGroupDel(res)) + map(res => decodeDel(res)) ); } - public groupUpdate(req: GroupUpdateRequest): Observable { + public update(req: UpdateRequest): Observable { return this.protocolService - .call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_UPD_REQ, ...encodeGroupUpdate(req)) + .call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_UPD_REQ, ...encodeUpdate(req)) .pipe( take(1), - map(res => decodeGroupUpdate(res)) + map(res => decodeUpdate(res)) ); } - public groupUpdate2( - req: GroupUpdateRequest - ): Observable { + public update2(req: UpdateRequest): Observable { return this.protocolService - .call( - SVC_TYPE_GROUP, - SSVC_TYPE_GROUP_UPD_REQ2, - ...encodeGroupUpdate2(req) - ) + .call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_UPD_REQ2, ...encodeUpdate2(req)) .pipe( take(1), - map(res => decodeGroupUpdate2(res)) + map(res => decodeUpdate2(res)) ); } } diff --git a/projects/ucap-webmessenger-protocol-room/src/lib/models/exit.ts b/projects/ucap-webmessenger-protocol-room/src/lib/models/exit.ts index 733e78bb..a33dd30f 100644 --- a/projects/ucap-webmessenger-protocol-room/src/lib/models/exit.ts +++ b/projects/ucap-webmessenger-protocol-room/src/lib/models/exit.ts @@ -9,47 +9,45 @@ import { } from '@ucap-webmessenger/protocol'; import { RoomExitType } from '../types/room.type'; -export interface RoomExitRequest extends ProtocolRequest { +export interface ExitRequest extends ProtocolRequest { // 대화방SEQ(s) roomSeq: string; } -export interface RoomExitResponse extends ProtocolResponse { +export interface ExitResponse extends ProtocolResponse { // 대화방SEQ(s) roomSeq: string; } -export const encodeRoomExit: ProtocolEncoder = ( - req: RoomExitRequest -) => { +export const encodeExit: ProtocolEncoder = (req: ExitRequest) => { const bodyList: PacketBody[] = []; bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq }); return bodyList; }; -export const decodeRoomExit: ProtocolDecoder = ( +export const decodeExit: ProtocolDecoder = ( message: ProtocolMessage ) => { return { roomSeq: message.bodyList[0] - } as RoomExitResponse; + } as ExitResponse; }; -export const decodeRoomExitNotification: ProtocolDecoder = ( +export const decodeExitNotification: ProtocolDecoder = ( message: ProtocolMessage ) => { return { roomSeq: message.bodyList[0] - } as RoomExitResponse; + } as ExitResponse; }; -export interface RoomExitAllRequest extends ProtocolRequest { +export interface ExitAllRequest extends ProtocolRequest { // 대화방SEQ(s) roomSeq: string[]; } -export const encodeRoomAllExit: ProtocolEncoder = ( - req: RoomExitAllRequest +export const encodeAllExit: ProtocolEncoder = ( + req: ExitAllRequest ) => { const bodyList: PacketBody[] = []; @@ -57,7 +55,7 @@ export const encodeRoomAllExit: ProtocolEncoder = ( return bodyList; }; -export interface RoomExitForcingRequest extends ProtocolRequest { +export interface ExitForcingRequest extends ProtocolRequest { // 대화방SEQ(s) roomSeq: string; // 강퇴요청타입(s) @@ -68,7 +66,7 @@ export interface RoomExitForcingRequest extends ProtocolRequest { userSeqs: number[]; } -export interface RoomExitForcingResponse extends ProtocolRequest { +export interface ExitForcingResponse extends ProtocolRequest { // 대화방SEQ(s) roomSeq: string; // 강퇴요청타입(s) @@ -79,8 +77,8 @@ export interface RoomExitForcingResponse extends ProtocolRequest { userSeqs: number[]; } -export const encodeRoomExitForcing: ProtocolEncoder = ( - req: RoomExitForcingRequest +export const encodeExitForcing: ProtocolEncoder = ( + req: ExitForcingRequest ) => { const bodyList: PacketBody[] = []; @@ -93,7 +91,7 @@ export const encodeRoomExitForcing: ProtocolEncoder = ( return bodyList; }; -export const decodeRoomExitForcing: ProtocolDecoder = ( +export const decodeExitForcing: ProtocolDecoder = ( message: ProtocolMessage ) => { let userSeqs: number[] = []; @@ -105,10 +103,10 @@ export const decodeRoomExitForcing: ProtocolDecoder = ( type: message.bodyList[1] as RoomExitType, senderSeq: message.bodyList[2], userSeqs - } as RoomExitForcingResponse; + } as ExitForcingResponse; }; -export const decodeRoomExitForcingNotification: ProtocolDecoder< - RoomExitForcingResponse +export const decodeExitForcingNotification: ProtocolDecoder< + ExitForcingResponse > = (message: ProtocolMessage) => { let userSeqs: number[] = []; if (message.bodyList.length > 3) { @@ -119,5 +117,5 @@ export const decodeRoomExitForcingNotification: ProtocolDecoder< type: message.bodyList[1] as RoomExitType, senderSeq: message.bodyList[2], userSeqs - } as RoomExitForcingResponse; + } as ExitForcingResponse; }; diff --git a/projects/ucap-webmessenger-protocol-room/src/lib/models/info.ts b/projects/ucap-webmessenger-protocol-room/src/lib/models/info.ts index 8afcf2f3..87fbab49 100644 --- a/projects/ucap-webmessenger-protocol-room/src/lib/models/info.ts +++ b/projects/ucap-webmessenger-protocol-room/src/lib/models/info.ts @@ -6,7 +6,8 @@ import { PacketBodyValue, ProtocolDecoder, ProtocolMessage, - BodyStringDivider + BodyStringDivider, + ProtocolStream } from '@ucap-webmessenger/protocol'; import { LocaleCode } from '@ucap-webmessenger/core'; import { RoomType } from '../types/room.type'; @@ -137,7 +138,7 @@ export interface UserInfo { id: string; } -export interface RoomInfoRequest extends ProtocolRequest { +export interface InfoRequest extends ProtocolRequest { // 0. 대화방SEQ(s) roomSeq: string; // 1. 상세정보여부(y) @@ -146,34 +147,32 @@ export interface RoomInfoRequest extends ProtocolRequest { localeCode: LocaleCode; } -export interface RoomInfoResponse extends ProtocolResponse { +export interface InfoResponse extends ProtocolResponse { // 0. 대화방SEQ(s) roomSeq: string; } -export interface RoomInfoDataResponse extends ProtocolResponse { +export interface InfoData extends ProtocolStream { // 0. 대화방SEQ(s) roomSeq: string; // 1. {대화방정보} roomInfo: RoomInfo; } -export interface RoomUserShortDataResponse extends ProtocolResponse { +export interface UserShortData extends ProtocolStream { // 0. 대화방SEQ(s) roomSeq: string; // 1n. {참여자정보} userInfos: UserInfoShort[]; } -export interface RoomUserDataResponse extends ProtocolResponse { +export interface UserData extends ProtocolStream { // 0. 대화방SEQ(s) roomSeq: string; // 1n. {참여자정보-D} userInfos: UserInfo[]; } -export const encodeRoomInfo: ProtocolEncoder = ( - req: RoomInfoRequest -) => { +export const encodeInfo: ProtocolEncoder = (req: InfoRequest) => { const bodyList: PacketBody[] = []; bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq }); @@ -186,15 +185,15 @@ export const encodeRoomInfo: ProtocolEncoder = ( return bodyList; }; -export const decodeRoomInfo: ProtocolDecoder = ( +export const decodeInfo: ProtocolDecoder = ( message: ProtocolMessage ) => { return { roomSeq: message.bodyList[0] - } as RoomInfoResponse; + } as InfoResponse; }; -export const decodeRoomInfoData: ProtocolDecoder = ( +export const decodeInfoData: ProtocolDecoder = ( message: ProtocolMessage ) => { let roomInfo: RoomInfo = null; @@ -222,12 +221,12 @@ export const decodeRoomInfoData: ProtocolDecoder = ( return { roomSeq: message.bodyList[0], roomInfo - } as RoomInfoDataResponse; + } as InfoData; }; -export const decodeRoomUserShortData: ProtocolDecoder< - RoomUserShortDataResponse -> = (message: ProtocolMessage) => { +export const decodeUserShortData: ProtocolDecoder = ( + message: ProtocolMessage +) => { const userInfos: UserInfoShort[] = []; message.bodyList.slice(1).forEach(userInfo => { const info = userInfo.split(BodyStringDivider); @@ -252,10 +251,10 @@ export const decodeRoomUserShortData: ProtocolDecoder< return { roomSeq: message.bodyList[0], userInfos - } as RoomUserShortDataResponse; + } as UserShortData; }; -export const decodeRoomUserData: ProtocolDecoder = ( +export const decodeUserData: ProtocolDecoder = ( message: ProtocolMessage ) => { const userInfos: UserInfo[] = []; @@ -298,30 +297,30 @@ export const decodeRoomUserData: ProtocolDecoder = ( return { roomSeq: message.bodyList[0], userInfos - } as RoomUserDataResponse; + } as UserData; }; -export interface RoomUserStatusOfflineRequest extends ProtocolRequest { +export interface UserStatusOfflineRequest extends ProtocolRequest { // 대화방SEQ(s) roomSeq: string; } -export interface RoomUserStatusOfflineResponse extends ProtocolResponse { +export interface UserStatusOfflineResponse extends ProtocolResponse { // 대화방SEQ(s) roomSeq: string; // 사용자SEQ(n)... userSeqs: number[]; } -export const encodeRoomUserStatusOffline: ProtocolEncoder< - RoomUserStatusOfflineRequest -> = (req: RoomUserStatusOfflineRequest) => { +export const encodeUserStatusOffline: ProtocolEncoder< + UserStatusOfflineRequest +> = (req: UserStatusOfflineRequest) => { const bodyList: PacketBody[] = []; bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq }); return bodyList; }; -export const decodeRoomUserStatusOffline: ProtocolDecoder< - RoomUserStatusOfflineResponse +export const decodeUserStatusOffline: ProtocolDecoder< + UserStatusOfflineResponse > = (message: ProtocolMessage) => { let userSeqs: number[] = []; if (message.bodyList.length > 1) { @@ -330,5 +329,5 @@ export const decodeRoomUserStatusOffline: ProtocolDecoder< return { roomSeq: message.bodyList[0], userSeqs - } as RoomUserStatusOfflineResponse; + } as UserStatusOfflineResponse; }; diff --git a/projects/ucap-webmessenger-protocol-room/src/lib/models/invite.ts b/projects/ucap-webmessenger-protocol-room/src/lib/models/invite.ts index 8be64b05..36b5cc63 100644 --- a/projects/ucap-webmessenger-protocol-room/src/lib/models/invite.ts +++ b/projects/ucap-webmessenger-protocol-room/src/lib/models/invite.ts @@ -8,20 +8,20 @@ import { ProtocolMessage } from '@ucap-webmessenger/protocol'; -export interface RoomInviteRequest extends ProtocolRequest { +export interface InviteRequest extends ProtocolRequest { // 0. 대화방SEQ(s) roomSeq: string; // 1n. 초대자 userSeq(n)... inviteUserSeqs: number[]; } -export interface RoomInviteResponse extends ProtocolResponse { +export interface InviteResponse extends ProtocolResponse { // 0. 대화방SEQ(s) roomSeq: string; } -export const encodeRoomInvite: ProtocolEncoder = ( - req: RoomInviteRequest +export const encodeInvite: ProtocolEncoder = ( + req: InviteRequest ) => { const bodyList: PacketBody[] = []; @@ -33,18 +33,18 @@ export const encodeRoomInvite: ProtocolEncoder = ( return bodyList; }; -export const decodeRoomInvite: ProtocolDecoder = ( +export const decodeInvite: ProtocolDecoder = ( message: ProtocolMessage ) => { return { roomSeq: message.bodyList[0] - } as RoomInviteResponse; + } as InviteResponse; }; -export const decodeRoomInviteNotification: ProtocolDecoder< - RoomInviteResponse -> = (message: ProtocolMessage) => { +export const decodeInviteNotification: ProtocolDecoder = ( + message: ProtocolMessage +) => { return { roomSeq: message.bodyList[0] - } as RoomInviteResponse; + } as InviteResponse; }; diff --git a/projects/ucap-webmessenger-protocol-room/src/lib/models/open.ts b/projects/ucap-webmessenger-protocol-room/src/lib/models/open.ts index bc000b6d..abc8d9e8 100644 --- a/projects/ucap-webmessenger-protocol-room/src/lib/models/open.ts +++ b/projects/ucap-webmessenger-protocol-room/src/lib/models/open.ts @@ -8,14 +8,14 @@ import { ProtocolMessage } from '@ucap-webmessenger/protocol'; -export interface RoomOpenRequest extends ProtocolRequest { +export interface OpenRequest extends ProtocolRequest { // 0. 구분자 divCd: string; // 1n. 초대자 userSeq(n)... userSeqs: number[]; } -export interface RoomOpenResponse extends ProtocolResponse { +export interface OpenResponse extends ProtocolResponse { // 0. 구분자 divCd: string; // 1. 대화방SEQ(s) @@ -24,9 +24,7 @@ export interface RoomOpenResponse extends ProtocolResponse { newRoom: boolean; } -export const encodeRoomOpen: ProtocolEncoder = ( - req: RoomOpenRequest -) => { +export const encodeOpen: ProtocolEncoder = (req: OpenRequest) => { const bodyList: PacketBody[] = []; bodyList.push({ type: PacketBodyValue.String, value: req.divCd }); @@ -37,17 +35,17 @@ export const encodeRoomOpen: ProtocolEncoder = ( return bodyList; }; -export const decodeRoomOpen: ProtocolDecoder = ( +export const decodeOpen: ProtocolDecoder = ( message: ProtocolMessage ) => { return { divCd: message.bodyList[0], roomSeq: message.bodyList[1], newRoom: message.bodyList[2] === 'Y' ? true : false - } as RoomOpenResponse; + } as OpenResponse; }; -export interface RoomOpen2Request extends ProtocolRequest { +export interface Open2Request extends ProtocolRequest { // 0. 구분자 divCd: string; // 1. 대화방제목(s) @@ -56,7 +54,7 @@ export interface RoomOpen2Request extends ProtocolRequest { userSeqs: number[]; } -export interface RoomOpen2Response extends ProtocolResponse { +export interface Open2Response extends ProtocolResponse { // 0. 구분자 divCd: string; // 1. 대화방제목(s) @@ -67,8 +65,8 @@ export interface RoomOpen2Response extends ProtocolResponse { newRoom: boolean; } -export const encodeRoomOpen2: ProtocolEncoder = ( - req: RoomOpen2Request +export const encodeOpen2: ProtocolEncoder = ( + req: Open2Request ) => { const bodyList: PacketBody[] = []; @@ -81,7 +79,7 @@ export const encodeRoomOpen2: ProtocolEncoder = ( return bodyList; }; -export const decodeRoomOpen2: ProtocolDecoder = ( +export const decodeOpen2: ProtocolDecoder = ( message: ProtocolMessage ) => { return { @@ -89,10 +87,10 @@ export const decodeRoomOpen2: ProtocolDecoder = ( roomName: message.bodyList[1], roomSeq: message.bodyList[2], newRoom: message.bodyList[3] === 'Y' ? true : false - } as RoomOpen2Response; + } as Open2Response; }; -export interface RoomOpen3Request extends ProtocolRequest { +export interface Open3Request extends ProtocolRequest { // 0. 구분자 divCd: string; // 1. 대화방제목(s) @@ -105,7 +103,7 @@ export interface RoomOpen3Request extends ProtocolRequest { userSeqs: number[]; } -export interface RoomOpen3Response extends ProtocolResponse { +export interface Open3Response extends ProtocolResponse { // 0. 구분자 divCd: string; // 1. 대화방제목(s) @@ -120,8 +118,8 @@ export interface RoomOpen3Response extends ProtocolResponse { timerRoomInterval: number; } -export const encodeRoomOpen3: ProtocolEncoder = ( - req: RoomOpen3Request +export const encodeOpen3: ProtocolEncoder = ( + req: Open3Request ) => { const bodyList: PacketBody[] = []; @@ -142,7 +140,7 @@ export const encodeRoomOpen3: ProtocolEncoder = ( return bodyList; }; -export const decodeRoomOpen3: ProtocolDecoder = ( +export const decodeOpen3: ProtocolDecoder = ( message: ProtocolMessage ) => { return { @@ -152,10 +150,10 @@ export const decodeRoomOpen3: ProtocolDecoder = ( newRoom: message.bodyList[3] === 'Y' ? true : false, isTimerRoom: message.bodyList[4] === 'Y' ? true : false, timerRoomInterval: message.bodyList[5] || 0 - } as RoomOpen3Response; + } as Open3Response; }; -export interface RoomOpen4Request extends ProtocolRequest { +export interface Open4Request extends ProtocolRequest { // 0. 구분자 divCd: string; // 1. 대화방제목(s) @@ -168,7 +166,7 @@ export interface RoomOpen4Request extends ProtocolRequest { userSeqs: number[]; } -export interface RoomOpen4Response extends ProtocolResponse { +export interface Open4Response extends ProtocolResponse { // 0. 구분자 divCd: string; // 1. 대화방제목(s) @@ -183,8 +181,8 @@ export interface RoomOpen4Response extends ProtocolResponse { timerRoomInterval: number; } -export const encodeRoomOpen4: ProtocolEncoder = ( - req: RoomOpen4Request +export const encodeOpen4: ProtocolEncoder = ( + req: Open4Request ) => { const bodyList: PacketBody[] = []; @@ -205,7 +203,7 @@ export const encodeRoomOpen4: ProtocolEncoder = ( return bodyList; }; -export const decodeRoomOpen4: ProtocolDecoder = ( +export const decodeOpen4: ProtocolDecoder = ( message: ProtocolMessage ) => { return { @@ -216,5 +214,5 @@ export const decodeRoomOpen4: ProtocolDecoder = ( isTimerRoom: message.bodyList[4] === 'Y' ? true : false, timerRoomInterval: message.bodyList[4] !== 'Y' ? 0 : message.bodyList[5] || 0 - } as RoomOpen4Response; + } as Open4Response; }; diff --git a/projects/ucap-webmessenger-protocol-room/src/lib/models/update.ts b/projects/ucap-webmessenger-protocol-room/src/lib/models/update.ts index 33f70daf..280cf68a 100644 --- a/projects/ucap-webmessenger-protocol-room/src/lib/models/update.ts +++ b/projects/ucap-webmessenger-protocol-room/src/lib/models/update.ts @@ -8,7 +8,7 @@ import { ProtocolMessage } from '@ucap-webmessenger/protocol'; -export interface RoomUpdateRequest extends ProtocolRequest { +export interface UpdateRequest extends ProtocolRequest { // 대화방SEQ(s) roomSeq: string; // 대화방제목(s) @@ -19,7 +19,7 @@ export interface RoomUpdateRequest extends ProtocolRequest { isSyncAll: boolean; } -export interface RoomUpdateResponse extends ProtocolResponse { +export interface UpdateResponse extends ProtocolResponse { // 대화방SEQ(s) roomSeq: string; // 대화방제목(s) @@ -30,8 +30,8 @@ export interface RoomUpdateResponse extends ProtocolResponse { isSyncAll: boolean; } -export const encodeRoomUpdate: ProtocolEncoder = ( - req: RoomUpdateRequest +export const encodeUpdate: ProtocolEncoder = ( + req: UpdateRequest ) => { const bodyList: PacketBody[] = []; @@ -48,7 +48,7 @@ export const encodeRoomUpdate: ProtocolEncoder = ( return bodyList; }; -export const decodeRoomUpdate: ProtocolDecoder = ( +export const decodeUpdate: ProtocolDecoder = ( message: ProtocolMessage ) => { return { @@ -56,26 +56,26 @@ export const decodeRoomUpdate: ProtocolDecoder = ( roomName: message.bodyList[1], isAlarm: message.bodyList[2] === 'Y' ? true : false, isSyncAll: message.bodyList[3] === 'Y' ? true : false - } as RoomUpdateResponse; + } as UpdateResponse; }; -export interface RoomUpdateTimerSetRequest extends ProtocolRequest { +export interface UpdateTimerSetRequest extends ProtocolRequest { // 대화방SEQ(s) roomSeq: string; // 타이머시간(n) timerInterval: number; } -export interface RoomUpdateTimerSetResponse extends ProtocolResponse { +export interface UpdateTimerSetResponse extends ProtocolResponse { // 대화방SEQ(s) roomSeq: string; // 타이머시간(n) timerInterval: number; } -export const encodeRoomUpdateTimerSet: ProtocolEncoder< - RoomUpdateTimerSetRequest -> = (req: RoomUpdateTimerSetRequest) => { +export const encodeUpdateTimerSet: ProtocolEncoder = ( + req: UpdateTimerSetRequest +) => { const bodyList: PacketBody[] = []; bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq }); @@ -83,16 +83,16 @@ export const encodeRoomUpdateTimerSet: ProtocolEncoder< return bodyList; }; -export const decodeRoomUpdateTimerSet: ProtocolDecoder< - RoomUpdateTimerSetResponse -> = (message: ProtocolMessage) => { +export const decodeUpdateTimerSet: ProtocolDecoder = ( + message: ProtocolMessage +) => { return { roomSeq: message.bodyList[0], timerInterval: message.bodyList[1] || 0 - } as RoomUpdateTimerSetResponse; + } as UpdateTimerSetResponse; }; -export interface RoomUpdateFontRequest extends ProtocolRequest { +export interface UpdateFontRequest extends ProtocolRequest { // 대화방SEQ(s) roomSeq: string; // 폰트색(s) cf)0x000000 형태의 스트링 @@ -101,7 +101,7 @@ export interface RoomUpdateFontRequest extends ProtocolRequest { senderSeq: number; } -export interface RoomUpdateFontResponse extends ProtocolResponse { +export interface UpdateFontResponse extends ProtocolResponse { // 대화방SEQ(s) roomSeq: string; // 폰트색(s) cf)0x000000 형태의 스트링 @@ -110,8 +110,8 @@ export interface RoomUpdateFontResponse extends ProtocolResponse { senderSeq: number; } -export const encodeRoomUpdateFont: ProtocolEncoder = ( - req: RoomUpdateFontRequest +export const encodeUpdateFont: ProtocolEncoder = ( + req: UpdateFontRequest ) => { const bodyList: PacketBody[] = []; @@ -121,22 +121,22 @@ export const encodeRoomUpdateFont: ProtocolEncoder = ( return bodyList; }; -export const decodeRoomUpdateFont: ProtocolDecoder = ( +export const decodeUpdateFont: ProtocolDecoder = ( message: ProtocolMessage ) => { return { roomSeq: message.bodyList[0], fontColor: message.bodyList[1], senderSeq: message.bodyList[2] - } as RoomUpdateFontResponse; + } as UpdateFontResponse; }; -export const decodeRoomUpdateFontNotification: ProtocolDecoder< - RoomUpdateFontResponse +export const decodeUpdateFontNotification: ProtocolDecoder< + UpdateFontResponse > = (message: ProtocolMessage) => { return { roomSeq: message.bodyList[0], fontColor: message.bodyList[1], senderSeq: message.bodyList[2] - } as RoomUpdateFontResponse; + } as UpdateFontResponse; }; diff --git a/projects/ucap-webmessenger-protocol-room/src/lib/services/room-protocol.service.ts b/projects/ucap-webmessenger-protocol-room/src/lib/services/room-protocol.service.ts index 0e94ab93..96d3971c 100644 --- a/projects/ucap-webmessenger-protocol-room/src/lib/services/room-protocol.service.ts +++ b/projects/ucap-webmessenger-protocol-room/src/lib/services/room-protocol.service.ts @@ -25,70 +25,70 @@ import { SSVC_TYPE_ROOM_FONT_UPD_REQ } from '../types/service'; import { - RoomOpenRequest, - encodeRoomOpen, - decodeRoomOpen, - RoomOpenResponse, - RoomOpen2Request, - RoomOpen2Response, - decodeRoomOpen2, - encodeRoomOpen2, - RoomOpen3Request, - RoomOpen3Response, - encodeRoomOpen3, - decodeRoomOpen3, - RoomOpen4Request, - RoomOpen4Response, - encodeRoomOpen4, - decodeRoomOpen4 + OpenRequest, + encodeOpen, + decodeOpen, + OpenResponse, + Open2Request, + Open2Response, + decodeOpen2, + encodeOpen2, + Open3Request, + Open3Response, + encodeOpen3, + decodeOpen3, + Open4Request, + Open4Response, + encodeOpen4, + decodeOpen4 } from '../models/open'; import { - RoomInviteRequest, - RoomInviteResponse, - encodeRoomInvite, - decodeRoomInvite + InviteRequest, + InviteResponse, + encodeInvite, + decodeInvite } from '../models/invite'; import { - RoomInfoRequest, - RoomInfoResponse, - RoomInfoDataResponse, - RoomUserShortDataResponse, - RoomUserDataResponse, - encodeRoomInfo, - decodeRoomInfoData, - decodeRoomInfo, - decodeRoomUserShortData, - decodeRoomUserData, - RoomUserStatusOfflineRequest, - RoomUserStatusOfflineResponse, - encodeRoomUserStatusOffline, - decodeRoomUserStatusOffline + InfoRequest, + InfoResponse, + InfoData, + UserShortData, + UserData, + encodeInfo, + decodeInfoData, + decodeInfo, + decodeUserShortData, + decodeUserData, + UserStatusOfflineRequest, + UserStatusOfflineResponse, + encodeUserStatusOffline, + decodeUserStatusOffline } from '../models/info'; import { - RoomExitRequest, - RoomExitResponse, - encodeRoomExit, - decodeRoomExit, - RoomExitAllRequest, - encodeRoomAllExit, - RoomExitForcingRequest, - RoomExitForcingResponse, - encodeRoomExitForcing, - decodeRoomExitForcing + ExitRequest, + ExitResponse, + encodeExit, + decodeExit, + ExitAllRequest, + encodeAllExit, + ExitForcingRequest, + ExitForcingResponse, + encodeExitForcing, + decodeExitForcing } from '../models/exit'; import { - RoomUpdateRequest, - RoomUpdateResponse, - encodeRoomUpdate, - decodeRoomUpdate, - RoomUpdateTimerSetRequest, - RoomUpdateTimerSetResponse, - encodeRoomUpdateTimerSet, - decodeRoomUpdateTimerSet, - RoomUpdateFontRequest, - RoomUpdateFontResponse, - encodeRoomUpdateFont, - decodeRoomUpdateFont + UpdateRequest, + UpdateResponse, + encodeUpdate, + decodeUpdate, + UpdateTimerSetRequest, + UpdateTimerSetResponse, + encodeUpdateTimerSet, + decodeUpdateTimerSet, + UpdateFontRequest, + UpdateFontResponse, + encodeUpdateFont, + decodeUpdateFont } from '../models/update'; @Injectable({ @@ -97,169 +97,159 @@ import { export class RoomProtocolService { constructor(private protocolService: ProtocolService) {} - public roomOpen(req: RoomOpenRequest): Observable { + public open(req: OpenRequest): Observable { return this.protocolService - .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_OPEN_REQ, ...encodeRoomOpen(req)) + .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_OPEN_REQ, ...encodeOpen(req)) .pipe( take(1), - map(res => decodeRoomOpen(res)) + map(res => decodeOpen(res)) ); } - public roomOpen2(req: RoomOpen2Request): Observable { + public open2(req: Open2Request): Observable { return this.protocolService - .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_OPEN2_REQ, ...encodeRoomOpen2(req)) + .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_OPEN2_REQ, ...encodeOpen2(req)) .pipe( take(1), - map(res => decodeRoomOpen2(res)) + map(res => decodeOpen2(res)) ); } - public roomOpen3(req: RoomOpen3Request): Observable { + public open3(req: Open3Request): Observable { return this.protocolService - .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_OPEN3_REQ, ...encodeRoomOpen3(req)) + .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_OPEN3_REQ, ...encodeOpen3(req)) .pipe( take(1), - map(res => decodeRoomOpen3(res)) + map(res => decodeOpen3(res)) ); } - public roomOpen4(req: RoomOpen4Request): Observable { + public open4(req: Open4Request): Observable { return this.protocolService - .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_OPEN4_REQ, ...encodeRoomOpen4(req)) + .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_OPEN4_REQ, ...encodeOpen4(req)) .pipe( take(1), - map(res => decodeRoomOpen4(res)) + map(res => decodeOpen4(res)) ); } - public roomInvite(req: RoomInviteRequest): Observable { + public invite(req: InviteRequest): Observable { return this.protocolService - .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_INVITE_REQ, ...encodeRoomInvite(req)) + .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_INVITE_REQ, ...encodeInvite(req)) .pipe( take(1), - map(res => decodeRoomInvite(res)) + map(res => decodeInvite(res)) ); } - public roomInfo( - req: RoomInfoRequest - ): Observable< - | RoomInfoResponse - | RoomInfoDataResponse - | RoomUserShortDataResponse - | RoomUserDataResponse - > { + public info( + req: InfoRequest + ): Observable { return this.protocolService - .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_INFO_REQ, ...encodeRoomInfo(req)) + .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_INFO_REQ, ...encodeInfo(req)) .pipe( takeWhile(res => SSVC_TYPE_ROOM_INFO_RES !== res.subServiceType, true), map(res => { if (SSVC_TYPE_ROOM_INFO_ROOM === res.subServiceType) { - return decodeRoomInfoData(res); + return { ...decodeInfoData(res), Type: SSVC_TYPE_ROOM_INFO_ROOM }; } else if (SSVC_TYPE_ROOM_INFO_USER === res.subServiceType) { - return decodeRoomUserShortData(res); + return { + ...decodeUserShortData(res), + Type: SSVC_TYPE_ROOM_INFO_USER + }; } else if (SSVC_TYPE_ROOM_INFO_USER2 === res.subServiceType) { - return decodeRoomUserData(res); + return { ...decodeUserData(res), Type: SSVC_TYPE_ROOM_INFO_USER2 }; } - return decodeRoomInfo(res); + return { ...decodeInfo(res), Type: SSVC_TYPE_ROOM_INFO_RES }; }) ); } - public roomUserStatusOffline( - req: RoomUserStatusOfflineRequest - ): Observable { + public userStatusOffline( + req: UserStatusOfflineRequest + ): Observable { return this.protocolService .call( SVC_TYPE_ROOM, SSVC_TYPE_ROOM_USER_STATUS_REQ, - ...encodeRoomUserStatusOffline(req) + ...encodeUserStatusOffline(req) ) .pipe( map(res => { take(1); - return decodeRoomUserStatusOffline(res); + return decodeUserStatusOffline(res); }) ); } - public roomExit(req: RoomExitRequest): Observable { + public exit(req: ExitRequest): Observable { return this.protocolService - .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_EXIT_REQ, ...encodeRoomExit(req)) + .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_EXIT_REQ, ...encodeExit(req)) .pipe( map(res => { take(1); - return decodeRoomExit(res); + return decodeExit(res); }) ); } - public roomExitAll(req: RoomExitAllRequest): Observable { + public exitAll(req: ExitAllRequest): Observable { return this.protocolService - .call( - SVC_TYPE_ROOM, - SSVC_TYPE_ROOM_EXIT_ALL_REQ, - ...encodeRoomAllExit(req) - ) + .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_EXIT_ALL_REQ, ...encodeAllExit(req)) .pipe( map(res => { take(1); }) ); } - public roomExitForcing( - req: RoomExitForcingRequest - ): Observable { + public exitForcing(req: ExitForcingRequest): Observable { return this.protocolService .call( SVC_TYPE_ROOM, SSVC_TYPE_ROOM_EXIT_FORCING_REQ, - ...encodeRoomExitForcing(req) + ...encodeExitForcing(req) ) .pipe( map(res => { take(1); - return decodeRoomExitForcing(res); + return decodeExitForcing(res); }) ); } - public roomUpdate(req: RoomUpdateRequest): Observable { + public update(req: UpdateRequest): Observable { return this.protocolService - .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_UPD_REQ, ...encodeRoomUpdate(req)) + .call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_UPD_REQ, ...encodeUpdate(req)) .pipe( map(res => { take(1); - return decodeRoomUpdate(res); + return decodeUpdate(res); }) ); } - public roomUpdateTimerSet( - req: RoomUpdateTimerSetRequest - ): Observable { + public updateTimerSet( + req: UpdateTimerSetRequest + ): Observable { return this.protocolService .call( SVC_TYPE_ROOM, SSVC_TYPE_ROOM_INFO_UPD_REQ, - ...encodeRoomUpdateTimerSet(req) + ...encodeUpdateTimerSet(req) ) .pipe( map(res => { take(1); - return decodeRoomUpdateTimerSet(res); + return decodeUpdateTimerSet(res); }) ); } - public roomUpdateFont( - req: RoomUpdateFontRequest - ): Observable { + public updateFont(req: UpdateFontRequest): Observable { return this.protocolService .call( SVC_TYPE_ROOM, SSVC_TYPE_ROOM_FONT_UPD_REQ, - ...encodeRoomUpdateFont(req) + ...encodeUpdateFont(req) ) .pipe( map(res => { take(1); - return decodeRoomUpdateFont(res); + return decodeUpdateFont(res); }) ); } diff --git a/projects/ucap-webmessenger-protocol-service/src/lib/services/service-protocol.service.ts b/projects/ucap-webmessenger-protocol-service/src/lib/services/service-protocol.service.ts index f87b9bfa..08c646a2 100644 --- a/projects/ucap-webmessenger-protocol-service/src/lib/services/service-protocol.service.ts +++ b/projects/ucap-webmessenger-protocol-service/src/lib/services/service-protocol.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; -import { map, take, takeWhile } from 'rxjs/operators'; +import { map, take } from 'rxjs/operators'; import { UserPasswordSetRequest, UserPasswordSetResponse,