Merge branch 'master' of http://10.81.13.221:6990/Web/next-ucap-messenger
This commit is contained in:
commit
6de48f83b4
|
@ -9,19 +9,17 @@ import {
|
||||||
ProtocolMessage
|
ProtocolMessage
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
|
||||||
export interface BuddyAddRequest extends ProtocolRequest {
|
export interface AddRequest extends ProtocolRequest {
|
||||||
// 0n. 사용자SEQ(n)...
|
// 0n. 사용자SEQ(n)...
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BuddyAddResponse extends ProtocolResponse {
|
export interface AddResponse extends ProtocolResponse {
|
||||||
// 0n. 사용자SEQ(n)...
|
// 0n. 사용자SEQ(n)...
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeBuddyAdd: ProtocolEncoder<BuddyAddRequest> = (
|
export const encodeAdd: ProtocolEncoder<AddRequest> = (req: AddRequest) => {
|
||||||
req: BuddyAddRequest
|
|
||||||
) => {
|
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
for (const userSeq of req.userSeqs) {
|
for (const userSeq of req.userSeqs) {
|
||||||
|
@ -31,11 +29,11 @@ export const encodeBuddyAdd: ProtocolEncoder<BuddyAddRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeBuddyAdd: ProtocolDecoder<BuddyAddResponse> = (
|
export const decodeAdd: ProtocolDecoder<AddResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
const userSeqArray: number[] = [...message.bodyList];
|
const userSeqArray: number[] = [...message.bodyList];
|
||||||
return {
|
return {
|
||||||
userSeqs: userSeqArray
|
userSeqs: userSeqArray
|
||||||
} as BuddyAddResponse;
|
} as AddResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,19 +9,17 @@ import {
|
||||||
ProtocolMessage
|
ProtocolMessage
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
|
||||||
export interface BuddyDelRequest extends ProtocolRequest {
|
export interface DelRequest extends ProtocolRequest {
|
||||||
// 0n. 사용자SEQ(n)...
|
// 0n. 사용자SEQ(n)...
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BuddyDelResponse extends ProtocolResponse {
|
export interface DelResponse extends ProtocolResponse {
|
||||||
// 0n. 사용자SEQ(n)...
|
// 0n. 사용자SEQ(n)...
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeBuddyDel: ProtocolEncoder<BuddyDelRequest> = (
|
export const encodeDel: ProtocolEncoder<DelRequest> = (req: DelRequest) => {
|
||||||
req: BuddyDelRequest
|
|
||||||
) => {
|
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
for (const userSeq of req.userSeqs) {
|
for (const userSeq of req.userSeqs) {
|
||||||
|
@ -31,11 +29,11 @@ export const encodeBuddyDel: ProtocolEncoder<BuddyDelRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeBuddyDel: ProtocolDecoder<BuddyDelResponse> = (
|
export const decodeDel: ProtocolDecoder<DelResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
const userSeqArray: number[] = [...message.bodyList];
|
const userSeqArray: number[] = [...message.bodyList];
|
||||||
return {
|
return {
|
||||||
userSeqs: userSeqArray
|
userSeqs: userSeqArray
|
||||||
} as BuddyDelResponse;
|
} as DelResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,22 +9,22 @@ import {
|
||||||
ProtocolMessage
|
ProtocolMessage
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
|
||||||
export interface BuddyUpdateRequest extends ProtocolRequest {
|
export interface UpdateRequest extends ProtocolRequest {
|
||||||
// 0. 사용자SEQ(n)
|
// 0. 사용자SEQ(n)
|
||||||
seq: number;
|
seq: number;
|
||||||
// 1. 즐겨찾기여부(y)
|
// 1. 즐겨찾기여부(y)
|
||||||
isFavorit: boolean;
|
isFavorit: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BuddyUpdateResponse extends ProtocolResponse {
|
export interface UpdateResponse extends ProtocolResponse {
|
||||||
// 0. 사용자SEQ(n)
|
// 0. 사용자SEQ(n)
|
||||||
seq: number;
|
seq: number;
|
||||||
// 1. 즐겨찾기여부(y)
|
// 1. 즐겨찾기여부(y)
|
||||||
isFavorit: boolean;
|
isFavorit: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeBuddyUpdate: ProtocolEncoder<BuddyUpdateRequest> = (
|
export const encodeUpdate: ProtocolEncoder<UpdateRequest> = (
|
||||||
req: BuddyUpdateRequest
|
req: UpdateRequest
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -37,11 +37,11 @@ export const encodeBuddyUpdate: ProtocolEncoder<BuddyUpdateRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeBuddyUpdate: ProtocolDecoder<BuddyUpdateResponse> = (
|
export const decodeUpdate: ProtocolDecoder<UpdateResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
seq: message.bodyList[0],
|
seq: message.bodyList[0],
|
||||||
isFavorit: message.bodyList[1] === 'Y' ? true : false
|
isFavorit: message.bodyList[1] === 'Y' ? true : false
|
||||||
} as BuddyUpdateResponse;
|
} as UpdateResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,23 +12,13 @@ import {
|
||||||
SSVC_TYPE_BUDDY_UPD_REQ
|
SSVC_TYPE_BUDDY_UPD_REQ
|
||||||
} from '../types/service';
|
} from '../types/service';
|
||||||
|
|
||||||
|
import { AddRequest, encodeAdd, decodeAdd, AddResponse } from '../models/add';
|
||||||
|
import { DelRequest, encodeDel, decodeDel, DelResponse } from '../models/del';
|
||||||
import {
|
import {
|
||||||
BuddyAddRequest,
|
UpdateRequest,
|
||||||
encodeBuddyAdd,
|
decodeUpdate,
|
||||||
decodeBuddyAdd,
|
encodeUpdate,
|
||||||
BuddyAddResponse
|
UpdateResponse
|
||||||
} from '../models/add';
|
|
||||||
import {
|
|
||||||
BuddyDelRequest,
|
|
||||||
encodeBuddyDel,
|
|
||||||
decodeBuddyDel,
|
|
||||||
BuddyDelResponse
|
|
||||||
} from '../models/del';
|
|
||||||
import {
|
|
||||||
BuddyUpdateRequest,
|
|
||||||
decodeBuddyUpdate,
|
|
||||||
encodeBuddyUpdate,
|
|
||||||
BuddyUpdateResponse
|
|
||||||
} from '../models/update';
|
} from '../models/update';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
@ -37,30 +27,30 @@ import {
|
||||||
export class BuddyProtocolService {
|
export class BuddyProtocolService {
|
||||||
constructor(private protocolService: ProtocolService) {}
|
constructor(private protocolService: ProtocolService) {}
|
||||||
|
|
||||||
public buddyAdd(req: BuddyAddRequest): Observable<BuddyAddResponse> {
|
public add(req: AddRequest): Observable<AddResponse> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeBuddyAdd(res))
|
map(res => decodeAdd(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public buddyDel(req: BuddyDelRequest): Observable<BuddyDelResponse> {
|
public del(req: DelRequest): Observable<DelResponse> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeBuddyDel(res))
|
map(res => decodeDel(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public buddyUpdate(req: BuddyUpdateRequest): Observable<BuddyUpdateResponse> {
|
public update(req: UpdateRequest): Observable<UpdateResponse> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeBuddyUpdate(res))
|
map(res => decodeUpdate(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
import { EventType } from '../types/event.type';
|
import { EventType } from '../types/event.type';
|
||||||
import { PushStatus } from '../types/pushStatus.type';
|
import { PushStatus } from '../types/pushStatus.type';
|
||||||
|
|
||||||
export interface EventSendRequest extends ProtocolRequest {
|
export interface SendRequest extends ProtocolRequest {
|
||||||
// 0. 대화방SEQ(s)
|
// 0. 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 1. 이벤트타입(s)
|
// 1. 이벤트타입(s)
|
||||||
|
@ -20,7 +20,7 @@ export interface EventSendRequest extends ProtocolRequest {
|
||||||
sentMessage: string;
|
sentMessage: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EventSendResponse extends ProtocolResponse {
|
export interface SendResponse extends ProtocolResponse {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 이벤트SEQ(n)
|
// 이벤트SEQ(n)
|
||||||
|
@ -41,7 +41,7 @@ export interface EventSendResponse extends ProtocolResponse {
|
||||||
senderName: string;
|
senderName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EventSendNotification extends EventSendResponse {
|
export interface SendNotification extends SendResponse {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
// 이벤트SEQ(n)
|
// 이벤트SEQ(n)
|
||||||
// 이벤트타입(s)
|
// 이벤트타입(s)
|
||||||
|
@ -58,9 +58,7 @@ export interface EventSendNotification extends EventSendResponse {
|
||||||
companyCode?: string;
|
companyCode?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeEventSend: ProtocolEncoder<EventSendRequest> = (
|
export const encodeSend: ProtocolEncoder<SendRequest> = (req: SendRequest) => {
|
||||||
req: EventSendRequest
|
|
||||||
) => {
|
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
bodyList.push(
|
bodyList.push(
|
||||||
|
@ -72,7 +70,7 @@ export const encodeEventSend: ProtocolEncoder<EventSendRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeEventSend: ProtocolDecoder<EventSendResponse> = (
|
export const decodeSend: ProtocolDecoder<SendResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
|
@ -85,12 +83,12 @@ export const decodeEventSend: ProtocolDecoder<EventSendResponse> = (
|
||||||
pushStatus: message.bodyList[6] as PushStatus,
|
pushStatus: message.bodyList[6] as PushStatus,
|
||||||
ForcedExitType: message.bodyList[7],
|
ForcedExitType: message.bodyList[7],
|
||||||
senderName: message.bodyList[8]
|
senderName: message.bodyList[8]
|
||||||
} as EventSendResponse;
|
} as SendResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeEventSendNotification: ProtocolDecoder<
|
export const decodeSendNotification: ProtocolDecoder<SendNotification> = (
|
||||||
EventSendNotification
|
message: ProtocolMessage
|
||||||
> = (message: ProtocolMessage) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0],
|
roomSeq: message.bodyList[0],
|
||||||
seq: message.bodyList[1],
|
seq: message.bodyList[1],
|
||||||
|
@ -103,5 +101,5 @@ export const decodeEventSendNotification: ProtocolDecoder<
|
||||||
senderName: message.bodyList[8],
|
senderName: message.bodyList[8],
|
||||||
id: message.bodyList[9],
|
id: message.bodyList[9],
|
||||||
companyCode: message.bodyList[10]
|
companyCode: message.bodyList[10]
|
||||||
} as EventSendNotification;
|
} as SendNotification;
|
||||||
};
|
};
|
|
@ -21,11 +21,11 @@ import {
|
||||||
SSVC_TYPE_EVENT_SEND_REQ
|
SSVC_TYPE_EVENT_SEND_REQ
|
||||||
} from '../types/service';
|
} from '../types/service';
|
||||||
import {
|
import {
|
||||||
EventSendRequest,
|
SendRequest,
|
||||||
EventSendResponse,
|
SendResponse,
|
||||||
decodeEventSend,
|
decodeSend,
|
||||||
encodeEventSend
|
encodeSend
|
||||||
} from '../models/event-send';
|
} from '../models/send';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
@ -53,13 +53,13 @@ export class EventProtocolService {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public eventSend(req: EventSendRequest): Observable<EventSendResponse> {
|
public send(req: SendRequest): Observable<SendResponse> {
|
||||||
return this.protocolService
|
return this.protocolService
|
||||||
.call(SVC_TYPE_EVENT, SSVC_TYPE_EVENT_SEND_REQ, ...encodeEventSend(req))
|
.call(SVC_TYPE_EVENT, SSVC_TYPE_EVENT_SEND_REQ, ...encodeSend(req))
|
||||||
.pipe(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => {
|
map(res => {
|
||||||
return decodeEventSend(res);
|
return decodeSend(res);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,21 +9,19 @@ import {
|
||||||
ProtocolMessage
|
ProtocolMessage
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
|
||||||
export interface GroupAddRequest extends ProtocolRequest {
|
export interface AddRequest extends ProtocolRequest {
|
||||||
// 0. 동료그룹이름
|
// 0. 동료그룹이름
|
||||||
groupName: string;
|
groupName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GroupAddResponse extends ProtocolResponse {
|
export interface AddResponse extends ProtocolResponse {
|
||||||
// 0: 동료그룹SEQ(n)
|
// 0: 동료그룹SEQ(n)
|
||||||
groupSeq: number;
|
groupSeq: number;
|
||||||
// 1: 동료그룹이름(s)
|
// 1: 동료그룹이름(s)
|
||||||
groupName: string;
|
groupName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeGroupAdd: ProtocolEncoder<GroupAddRequest> = (
|
export const encodeAdd: ProtocolEncoder<AddRequest> = (req: AddRequest) => {
|
||||||
req: GroupAddRequest
|
|
||||||
) => {
|
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
bodyList.push({ type: PacketBodyValue.String, value: req.groupName });
|
bodyList.push({ type: PacketBodyValue.String, value: req.groupName });
|
||||||
|
@ -31,11 +29,11 @@ export const encodeGroupAdd: ProtocolEncoder<GroupAddRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeGroupAdd: ProtocolDecoder<GroupAddResponse> = (
|
export const decodeAdd: ProtocolDecoder<AddResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
groupSeq: message.bodyList[0],
|
groupSeq: message.bodyList[0],
|
||||||
groupName: message.bodyList[1]
|
groupName: message.bodyList[1]
|
||||||
} as GroupAddResponse;
|
} as AddResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,19 +9,17 @@ import {
|
||||||
ProtocolMessage
|
ProtocolMessage
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
|
||||||
export interface GroupDelRequest extends ProtocolRequest {
|
export interface DelRequest extends ProtocolRequest {
|
||||||
// 0: 동료그룹SEQ(n)
|
// 0: 동료그룹SEQ(n)
|
||||||
groupSeq: number;
|
groupSeq: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GroupDelResponse extends ProtocolResponse {
|
export interface DelResponse extends ProtocolResponse {
|
||||||
// 0: 동료그룹SEQ(n)
|
// 0: 동료그룹SEQ(n)
|
||||||
groupSeq: number;
|
groupSeq: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeGroupDel: ProtocolEncoder<GroupDelRequest> = (
|
export const encodeDel: ProtocolEncoder<DelRequest> = (req: DelRequest) => {
|
||||||
req: GroupDelRequest
|
|
||||||
) => {
|
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
bodyList.push({ type: PacketBodyValue.Integer, value: req.groupSeq });
|
bodyList.push({ type: PacketBodyValue.Integer, value: req.groupSeq });
|
||||||
|
@ -29,10 +27,10 @@ export const encodeGroupDel: ProtocolEncoder<GroupDelRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeGroupDel: ProtocolDecoder<GroupDelResponse> = (
|
export const decodeDel: ProtocolDecoder<DelResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
groupSeq: message.bodyList[0]
|
groupSeq: message.bodyList[0]
|
||||||
} as GroupDelResponse;
|
} as DelResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
ProtocolMessage
|
ProtocolMessage
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
|
||||||
export interface GroupUpdateRequest extends ProtocolRequest {
|
export interface UpdateRequest extends ProtocolRequest {
|
||||||
// 0: 동료그룹SEQ(n)
|
// 0: 동료그룹SEQ(n)
|
||||||
groupSeq: number;
|
groupSeq: number;
|
||||||
// 1: 동료그룹이름(s)
|
// 1: 동료그룹이름(s)
|
||||||
|
@ -18,7 +18,7 @@ export interface GroupUpdateRequest extends ProtocolRequest {
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GroupUpdateResponse extends ProtocolResponse {
|
export interface UpdateResponse extends ProtocolResponse {
|
||||||
// 0: 동료그룹SEQ(n)
|
// 0: 동료그룹SEQ(n)
|
||||||
groupSeq: number;
|
groupSeq: number;
|
||||||
// 1: 동료그룹이름(s)
|
// 1: 동료그룹이름(s)
|
||||||
|
@ -27,8 +27,8 @@ export interface GroupUpdateResponse extends ProtocolResponse {
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeGroupUpdate: ProtocolEncoder<GroupUpdateRequest> = (
|
export const encodeUpdate: ProtocolEncoder<UpdateRequest> = (
|
||||||
req: GroupUpdateRequest
|
req: UpdateRequest
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ export const encodeGroupUpdate: ProtocolEncoder<GroupUpdateRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeGroupUpdate: ProtocolDecoder<GroupUpdateResponse> = (
|
export const decodeUpdate: ProtocolDecoder<UpdateResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
let userSeqArray: number[] = [];
|
let userSeqArray: number[] = [];
|
||||||
|
@ -53,11 +53,11 @@ export const decodeGroupUpdate: ProtocolDecoder<GroupUpdateResponse> = (
|
||||||
groupSeq: message.bodyList[0],
|
groupSeq: message.bodyList[0],
|
||||||
groupName: message.bodyList[1],
|
groupName: message.bodyList[1],
|
||||||
userSeqs: userSeqArray
|
userSeqs: userSeqArray
|
||||||
} as GroupUpdateResponse;
|
} as UpdateResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const encodeGroupUpdate2: ProtocolEncoder<GroupUpdateRequest> = (
|
export const encodeUpdate2: ProtocolEncoder<UpdateRequest> = (
|
||||||
req: GroupUpdateRequest
|
req: UpdateRequest
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ export const encodeGroupUpdate2: ProtocolEncoder<GroupUpdateRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeGroupUpdate2: ProtocolDecoder<GroupUpdateResponse> = (
|
export const decodeUpdate2: ProtocolDecoder<UpdateResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
let userSeqArray: number[] = [];
|
let userSeqArray: number[] = [];
|
||||||
|
@ -87,5 +87,5 @@ export const decodeGroupUpdate2: ProtocolDecoder<GroupUpdateResponse> = (
|
||||||
groupSeq: message.bodyList[0],
|
groupSeq: message.bodyList[0],
|
||||||
groupName: message.bodyList[1],
|
groupName: message.bodyList[1],
|
||||||
userSeqs: userSeqArray
|
userSeqs: userSeqArray
|
||||||
} as GroupUpdateResponse;
|
} as UpdateResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,12 +4,6 @@ import { Observable } from 'rxjs';
|
||||||
import { map, take } from 'rxjs/operators';
|
import { map, take } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ProtocolService } from '@ucap-webmessenger/protocol';
|
import { ProtocolService } from '@ucap-webmessenger/protocol';
|
||||||
import {
|
|
||||||
GroupAddRequest,
|
|
||||||
encodeGroupAdd,
|
|
||||||
decodeGroupAdd,
|
|
||||||
GroupAddResponse
|
|
||||||
} from '../models/add';
|
|
||||||
import {
|
import {
|
||||||
SVC_TYPE_GROUP,
|
SVC_TYPE_GROUP,
|
||||||
SSVC_TYPE_GROUP_ADD_REQ,
|
SSVC_TYPE_GROUP_ADD_REQ,
|
||||||
|
@ -17,19 +11,15 @@ import {
|
||||||
SSVC_TYPE_GROUP_UPD_REQ,
|
SSVC_TYPE_GROUP_UPD_REQ,
|
||||||
SSVC_TYPE_GROUP_UPD_REQ2
|
SSVC_TYPE_GROUP_UPD_REQ2
|
||||||
} from '../types/service';
|
} from '../types/service';
|
||||||
|
import { AddRequest, encodeAdd, decodeAdd, AddResponse } from '../models/add';
|
||||||
|
import { DelRequest, encodeDel, decodeDel, DelResponse } from '../models/del';
|
||||||
import {
|
import {
|
||||||
GroupDelRequest,
|
UpdateRequest,
|
||||||
encodeGroupDel,
|
encodeUpdate,
|
||||||
decodeGroupDel,
|
decodeUpdate,
|
||||||
GroupDelResponse
|
encodeUpdate2,
|
||||||
} from '../models/del';
|
decodeUpdate2,
|
||||||
import {
|
UpdateResponse
|
||||||
GroupUpdateRequest,
|
|
||||||
encodeGroupUpdate,
|
|
||||||
decodeGroupUpdate,
|
|
||||||
encodeGroupUpdate2,
|
|
||||||
decodeGroupUpdate2,
|
|
||||||
GroupUpdateResponse
|
|
||||||
} from '../models/update';
|
} from '../models/update';
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
@ -37,45 +27,39 @@ import {
|
||||||
export class GroupProtocolService {
|
export class GroupProtocolService {
|
||||||
constructor(private protocolService: ProtocolService) {}
|
constructor(private protocolService: ProtocolService) {}
|
||||||
|
|
||||||
public groupAdd(req: GroupAddRequest): Observable<GroupAddResponse> {
|
public add(req: AddRequest): Observable<AddResponse> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeGroupAdd(res))
|
map(res => decodeAdd(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public groupDel(req: GroupDelRequest): Observable<GroupDelResponse> {
|
public del(req: DelRequest): Observable<DelResponse> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeGroupDel(res))
|
map(res => decodeDel(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public groupUpdate(req: GroupUpdateRequest): Observable<GroupUpdateResponse> {
|
public update(req: UpdateRequest): Observable<UpdateResponse> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeGroupUpdate(res))
|
map(res => decodeUpdate(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public groupUpdate2(
|
public update2(req: UpdateRequest): Observable<UpdateResponse> {
|
||||||
req: GroupUpdateRequest
|
|
||||||
): Observable<GroupUpdateResponse> {
|
|
||||||
return this.protocolService
|
return this.protocolService
|
||||||
.call(
|
.call(SVC_TYPE_GROUP, SSVC_TYPE_GROUP_UPD_REQ2, ...encodeUpdate2(req))
|
||||||
SVC_TYPE_GROUP,
|
|
||||||
SSVC_TYPE_GROUP_UPD_REQ2,
|
|
||||||
...encodeGroupUpdate2(req)
|
|
||||||
)
|
|
||||||
.pipe(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeGroupUpdate2(res))
|
map(res => decodeUpdate2(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,199 @@
|
||||||
|
import {
|
||||||
|
ProtocolRequest,
|
||||||
|
ProtocolResponse,
|
||||||
|
ProtocolEncoder,
|
||||||
|
PacketBody,
|
||||||
|
ProtocolDecoder,
|
||||||
|
ProtocolMessage,
|
||||||
|
PacketBodyValue,
|
||||||
|
BodyStringDivider,
|
||||||
|
ProtocolStream
|
||||||
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
import {
|
||||||
|
DeviceType,
|
||||||
|
FileTransferPermissions,
|
||||||
|
OrganizationChartPermissions,
|
||||||
|
DefaultScreen,
|
||||||
|
VideoConferenceType
|
||||||
|
} from '@ucap-webmessenger/core';
|
||||||
|
import { DeptType, DeptSearchType } from '../types/dept.type';
|
||||||
|
import { EmployeeType } from '@ucap-webmessenger/protocol-room';
|
||||||
|
import { RoleCode } from '@ucap-webmessenger/protocol-authentication';
|
||||||
|
|
||||||
|
export interface DeptUserRequest extends ProtocolRequest {
|
||||||
|
// DivCD(s)
|
||||||
|
divCd: string;
|
||||||
|
// 기관코드(s)
|
||||||
|
companyCode: string;
|
||||||
|
// 부서SEQ(n)
|
||||||
|
seq?: number;
|
||||||
|
// 검색string(s)
|
||||||
|
search?: string;
|
||||||
|
// 검색범위(s)
|
||||||
|
searchRange: DeptSearchType;
|
||||||
|
// 요청리스트(n) 사용안하면 0 최대 200
|
||||||
|
pageListCount?: number;
|
||||||
|
// 요청페이지(n) 사용안하면 0 처음은 1
|
||||||
|
pageCurrent?: number;
|
||||||
|
// 발신자회사코드(s)
|
||||||
|
senderCompanyCode: string;
|
||||||
|
// 발신자임직원유형(s)
|
||||||
|
senderEmployeeType: EmployeeType;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserInfoSS {
|
||||||
|
// 사용자SEQ
|
||||||
|
seq: number;
|
||||||
|
// 사용자명
|
||||||
|
name: string;
|
||||||
|
// 사진파일
|
||||||
|
profileImageFile: string;
|
||||||
|
// 직급
|
||||||
|
grade: string;
|
||||||
|
// 업무소개
|
||||||
|
intro: string;
|
||||||
|
// 기관코드
|
||||||
|
companyCode: string;
|
||||||
|
// 핸드폰번호
|
||||||
|
hpNumber: string;
|
||||||
|
// 내선번호
|
||||||
|
lineNumber: string;
|
||||||
|
// 이메일
|
||||||
|
email: string;
|
||||||
|
// 모바일YN
|
||||||
|
isMobile: boolean;
|
||||||
|
// 부서명
|
||||||
|
deptName: string;
|
||||||
|
// 조회순서
|
||||||
|
order: string;
|
||||||
|
// ActiveYN
|
||||||
|
isActive: boolean;
|
||||||
|
// 역할코드
|
||||||
|
roleCd: RoleCode;
|
||||||
|
// 사번
|
||||||
|
employeeNum: string;
|
||||||
|
// MADN
|
||||||
|
madn: string;
|
||||||
|
// HARDPHONE_SADN
|
||||||
|
hardSadn: string;
|
||||||
|
// FMC_SADN
|
||||||
|
fmcSadn: string;
|
||||||
|
// CALL_MODE
|
||||||
|
callMode: string;
|
||||||
|
// 사용자명(영어)
|
||||||
|
nameEn: string;
|
||||||
|
// 사용자명(중국어)
|
||||||
|
nameCn: string;
|
||||||
|
// 직급(영어)
|
||||||
|
gradeEn: string;
|
||||||
|
// 직급(중국어)
|
||||||
|
gradeCn: string;
|
||||||
|
// 부서명(영어)
|
||||||
|
deptNameEn: string;
|
||||||
|
// 부서명(중국어)
|
||||||
|
deptNameCn: string;
|
||||||
|
// 부서SEQ
|
||||||
|
deptSeq: number;
|
||||||
|
// 이용약관동의여부YN
|
||||||
|
isPrivacyAgree: boolean;
|
||||||
|
// 유효접속여부YN
|
||||||
|
isValidLogin: boolean;
|
||||||
|
// 임직원유형(s)
|
||||||
|
employeeType: EmployeeType;
|
||||||
|
}
|
||||||
|
export interface DeptUserData extends ProtocolStream {
|
||||||
|
// DivCD(s)
|
||||||
|
divCd: string;
|
||||||
|
// {부서정보-S}...
|
||||||
|
userInfos: UserInfoSS[];
|
||||||
|
}
|
||||||
|
export interface DeptUserResponse extends ProtocolResponse {
|
||||||
|
// DivCD(s)
|
||||||
|
divCd: string;
|
||||||
|
// 전체갯수(n)
|
||||||
|
pageTotalCount: number;
|
||||||
|
// 요청리스트(n)
|
||||||
|
pageListCount?: number;
|
||||||
|
// 페이지(n)
|
||||||
|
pageCurrent?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const encodeDeptUser: ProtocolEncoder<DeptUserRequest> = (
|
||||||
|
req: DeptUserRequest
|
||||||
|
) => {
|
||||||
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
bodyList.push({ type: PacketBodyValue.String, value: req.divCd });
|
||||||
|
bodyList.push({ type: PacketBodyValue.String, value: req.companyCode });
|
||||||
|
bodyList.push({ type: PacketBodyValue.Integer, value: req.seq || 0 });
|
||||||
|
bodyList.push({ type: PacketBodyValue.String, value: req.search || '' });
|
||||||
|
bodyList.push({ type: PacketBodyValue.String, value: req.searchRange });
|
||||||
|
bodyList.push({
|
||||||
|
type: PacketBodyValue.Integer,
|
||||||
|
value: req.pageListCount || 0
|
||||||
|
});
|
||||||
|
bodyList.push({ type: PacketBodyValue.Integer, value: req.pageCurrent || 0 });
|
||||||
|
bodyList.push({ type: PacketBodyValue.String, value: req.senderCompanyCode });
|
||||||
|
bodyList.push({
|
||||||
|
type: PacketBodyValue.String,
|
||||||
|
value: req.senderEmployeeType
|
||||||
|
});
|
||||||
|
|
||||||
|
return bodyList;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const decodeDeptUserData: ProtocolDecoder<DeptUserData> = (
|
||||||
|
message: ProtocolMessage
|
||||||
|
) => {
|
||||||
|
const userInfos: UserInfoSS[] = [];
|
||||||
|
message.bodyList.slice(1).forEach(userInfo => {
|
||||||
|
const info = userInfo.split(BodyStringDivider);
|
||||||
|
let i = 0;
|
||||||
|
userInfos.push({
|
||||||
|
seq: info[i],
|
||||||
|
name: info[i++],
|
||||||
|
profileImageFile: info[i++],
|
||||||
|
grade: info[i++],
|
||||||
|
intro: info[i++],
|
||||||
|
companyCode: info[i++],
|
||||||
|
hpNumber: info[i++],
|
||||||
|
lineNumber: info[i++],
|
||||||
|
email: info[i++],
|
||||||
|
isMobile: info[i++] === 'Y' ? true : false,
|
||||||
|
deptName: info[i++],
|
||||||
|
order: info[i++],
|
||||||
|
isActive: info[i++] === 'Y' ? true : false,
|
||||||
|
roleCd: info[i++] as RoleCode,
|
||||||
|
employeeNum: info[i++],
|
||||||
|
madn: info[i++],
|
||||||
|
hardSadn: info[i++],
|
||||||
|
fmcSadn: info[i++],
|
||||||
|
callMode: info[i++],
|
||||||
|
nameEn: info[i++],
|
||||||
|
nameCn: info[i++],
|
||||||
|
gradeEn: info[i++],
|
||||||
|
gradeCn: info[i++],
|
||||||
|
deptNameEn: info[i++],
|
||||||
|
deptNameCn: info[i++],
|
||||||
|
deptSeq: info[i++],
|
||||||
|
isPrivacyAgree: info[i++] === 'Y' ? true : false,
|
||||||
|
isValidLogin: info[i++] === 'Y' ? true : false,
|
||||||
|
employeeType: info[i++] as EmployeeType
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
divCd: message.bodyList[0],
|
||||||
|
userInfos
|
||||||
|
} as DeptUserData;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const decodeDeptUser: ProtocolDecoder<DeptUserResponse> = (
|
||||||
|
message: ProtocolMessage
|
||||||
|
) => {
|
||||||
|
return {
|
||||||
|
divCd: message.bodyList[0],
|
||||||
|
pageTotalCount: message.bodyList[1],
|
||||||
|
pageListCount: message.bodyList[2],
|
||||||
|
pageCurrent: message.bodyList[3]
|
||||||
|
} as DeptUserResponse;
|
||||||
|
};
|
|
@ -0,0 +1,95 @@
|
||||||
|
import {
|
||||||
|
ProtocolRequest,
|
||||||
|
ProtocolResponse,
|
||||||
|
ProtocolEncoder,
|
||||||
|
PacketBody,
|
||||||
|
ProtocolDecoder,
|
||||||
|
ProtocolMessage,
|
||||||
|
PacketBodyValue,
|
||||||
|
BodyStringDivider,
|
||||||
|
ProtocolStream
|
||||||
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
import { DeptType } from '../types/dept.type';
|
||||||
|
|
||||||
|
export interface DeptRequest extends ProtocolRequest {
|
||||||
|
// DivCD(s)
|
||||||
|
divCd: string;
|
||||||
|
// 기관코드(s)
|
||||||
|
companyCode: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeptInfo {
|
||||||
|
// 부서SEQ
|
||||||
|
seq: number;
|
||||||
|
// 부서명
|
||||||
|
name: string;
|
||||||
|
// 기관코드
|
||||||
|
companyCode: string;
|
||||||
|
// 부서타입
|
||||||
|
type: DeptType;
|
||||||
|
// 본부SEQ
|
||||||
|
rootSeq: number;
|
||||||
|
// 상위부서SEQ
|
||||||
|
parentSeq: number;
|
||||||
|
// 조회순서
|
||||||
|
order: string;
|
||||||
|
// 조회레벨
|
||||||
|
depth: number;
|
||||||
|
// ActiveYN
|
||||||
|
isActive: boolean;
|
||||||
|
// 부서명(영어)
|
||||||
|
nameEn: string;
|
||||||
|
// 부서명(중국어)
|
||||||
|
nameCn: string;
|
||||||
|
}
|
||||||
|
export interface DeptData extends ProtocolStream {
|
||||||
|
// DivCD(s)
|
||||||
|
divCd: string;
|
||||||
|
// {부서정보-S}...
|
||||||
|
departmentInfos: DeptInfo[];
|
||||||
|
}
|
||||||
|
export interface DeptResponse extends ProtocolResponse {
|
||||||
|
// DivCD(s)
|
||||||
|
divCd: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const encodeDept: ProtocolEncoder<DeptRequest> = (req: DeptRequest) => {
|
||||||
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
bodyList.push({ type: PacketBodyValue.String, value: req.divCd });
|
||||||
|
bodyList.push({ type: PacketBodyValue.String, value: req.companyCode });
|
||||||
|
return bodyList;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const decodeDeptData: ProtocolDecoder<DeptData> = (
|
||||||
|
message: ProtocolMessage
|
||||||
|
) => {
|
||||||
|
const departmentInfos: DeptInfo[] = [];
|
||||||
|
message.bodyList.slice(1).forEach(deptInfo => {
|
||||||
|
const info = deptInfo.split(BodyStringDivider);
|
||||||
|
let i = 0;
|
||||||
|
departmentInfos.push({
|
||||||
|
seq: info[i],
|
||||||
|
name: info[i++],
|
||||||
|
companyCode: info[i++],
|
||||||
|
type: info[i++] as DeptType,
|
||||||
|
rootSeq: info[i++],
|
||||||
|
parentSeq: info[i++],
|
||||||
|
order: info[i++],
|
||||||
|
depth: info[i++],
|
||||||
|
isActive: info[i++] === 'Y' ? true : false,
|
||||||
|
nameEn: info[i++],
|
||||||
|
nameCn: info[i++]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
divCd: message.bodyList[0],
|
||||||
|
departmentInfos
|
||||||
|
} as DeptData;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const decodeDept: ProtocolDecoder<DeptResponse> = (
|
||||||
|
message: ProtocolMessage
|
||||||
|
) => {
|
||||||
|
return { divCd: message.bodyList[0] } as DeptResponse;
|
||||||
|
};
|
|
@ -1,7 +1,7 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ProtocolService } from '@ucap-webmessenger/protocol';
|
import { ProtocolService } from '@ucap-webmessenger/protocol';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { take, map } from 'rxjs/operators';
|
import { take, map, takeWhile } from 'rxjs/operators';
|
||||||
import {
|
import {
|
||||||
AuthRequest,
|
AuthRequest,
|
||||||
AuthResponse,
|
AuthResponse,
|
||||||
|
@ -10,8 +10,30 @@ import {
|
||||||
} from '../models/auth';
|
} from '../models/auth';
|
||||||
import {
|
import {
|
||||||
SVC_TYPE_QUERY_DATA,
|
SVC_TYPE_QUERY_DATA,
|
||||||
SSVC_TYPE_QUERY_AUTH_REQ
|
SSVC_TYPE_QUERY_AUTH_REQ,
|
||||||
|
SSVC_TYPE_QUERY_DEPT_REQ,
|
||||||
|
SSVC_TYPE_QUERY_DEPT_RES,
|
||||||
|
SSVC_TYPE_QUERY_DEPT_DATA,
|
||||||
|
SSVC_TYPE_QUERY_DEPT_USER_RES,
|
||||||
|
SSVC_TYPE_QUERY_DEPT_USER_DATA,
|
||||||
|
SSVC_TYPE_QUERY_DEPT_USER_REQ
|
||||||
} from '../types/service';
|
} from '../types/service';
|
||||||
|
import {
|
||||||
|
DeptRequest,
|
||||||
|
DeptResponse,
|
||||||
|
encodeDept,
|
||||||
|
decodeDept,
|
||||||
|
decodeDeptData,
|
||||||
|
DeptData
|
||||||
|
} from '../models/dept';
|
||||||
|
import {
|
||||||
|
encodeDeptUser,
|
||||||
|
decodeDeptUser,
|
||||||
|
decodeDeptUserData,
|
||||||
|
DeptUserRequest,
|
||||||
|
DeptUserData,
|
||||||
|
DeptUserResponse
|
||||||
|
} from '../models/dept-user';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
@ -27,4 +49,48 @@ export class QueryProtocolService {
|
||||||
map(res => decodeAuth(res))
|
map(res => decodeAuth(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public dept(req: DeptRequest): Observable<DeptResponse | DeptData> {
|
||||||
|
return this.protocolService
|
||||||
|
.call(SVC_TYPE_QUERY_DATA, SSVC_TYPE_QUERY_DEPT_REQ, ...encodeDept(req))
|
||||||
|
.pipe(
|
||||||
|
takeWhile(res => SSVC_TYPE_QUERY_DEPT_RES !== res.subServiceType, true),
|
||||||
|
map(res => {
|
||||||
|
if (SSVC_TYPE_QUERY_DEPT_DATA === res.subServiceType) {
|
||||||
|
return { ...decodeDeptData(res), Type: SSVC_TYPE_QUERY_DEPT_DATA };
|
||||||
|
}
|
||||||
|
|
||||||
|
return { ...decodeDept(res), Type: SSVC_TYPE_QUERY_DEPT_RES };
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
public deptUser(
|
||||||
|
req: DeptUserRequest
|
||||||
|
): Observable<DeptUserResponse | DeptUserData> {
|
||||||
|
return this.protocolService
|
||||||
|
.call(
|
||||||
|
SVC_TYPE_QUERY_DATA,
|
||||||
|
SSVC_TYPE_QUERY_DEPT_USER_REQ,
|
||||||
|
...encodeDeptUser(req)
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
takeWhile(
|
||||||
|
res => SSVC_TYPE_QUERY_DEPT_USER_RES !== res.subServiceType,
|
||||||
|
true
|
||||||
|
),
|
||||||
|
map(res => {
|
||||||
|
if (SSVC_TYPE_QUERY_DEPT_USER_DATA === res.subServiceType) {
|
||||||
|
return {
|
||||||
|
...decodeDeptUserData(res),
|
||||||
|
Type: SSVC_TYPE_QUERY_DEPT_USER_DATA
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...decodeDeptUser(res),
|
||||||
|
Type: SSVC_TYPE_QUERY_DEPT_USER_RES
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
export enum DeptType {
|
||||||
|
// R: 기관Root
|
||||||
|
Root = 'R',
|
||||||
|
// D: 본부
|
||||||
|
Department = 'D',
|
||||||
|
// T: 부서
|
||||||
|
Team = 'T'
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum DeptSearchType {
|
||||||
|
// A: 부서, 인원
|
||||||
|
All = 'A',
|
||||||
|
// U: 인원
|
||||||
|
User = 'U',
|
||||||
|
// D: 부서
|
||||||
|
Department = 'D',
|
||||||
|
// M: 다중부서 cf) 여러 부서(하위전체)를 쿼리할 때 1, 2, 3, 4..이렇게 부서SEQ들을, 로 연결해서 보냄 (검색string 필드를 사용함)
|
||||||
|
MultiDepartment = 'M'
|
||||||
|
}
|
|
@ -3,9 +3,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './lib/models/auth';
|
export * from './lib/models/auth';
|
||||||
|
export * from './lib/models/dept';
|
||||||
|
export * from './lib/models/dept-user';
|
||||||
|
|
||||||
export * from './lib/services/query-protocol.service';
|
export * from './lib/services/query-protocol.service';
|
||||||
|
|
||||||
|
export * from './lib/types/dept.type';
|
||||||
export * from './lib/types/service';
|
export * from './lib/types/service';
|
||||||
|
|
||||||
export * from './lib/ucap-query-protocol.module';
|
export * from './lib/ucap-query-protocol.module';
|
||||||
|
|
|
@ -9,47 +9,45 @@ import {
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
import { RoomExitType } from '../types/room.type';
|
import { RoomExitType } from '../types/room.type';
|
||||||
|
|
||||||
export interface RoomExitRequest extends ProtocolRequest {
|
export interface ExitRequest extends ProtocolRequest {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomExitResponse extends ProtocolResponse {
|
export interface ExitResponse extends ProtocolResponse {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomExit: ProtocolEncoder<RoomExitRequest> = (
|
export const encodeExit: ProtocolEncoder<ExitRequest> = (req: ExitRequest) => {
|
||||||
req: RoomExitRequest
|
|
||||||
) => {
|
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq });
|
bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq });
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomExit: ProtocolDecoder<RoomExitResponse> = (
|
export const decodeExit: ProtocolDecoder<ExitResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0]
|
roomSeq: message.bodyList[0]
|
||||||
} as RoomExitResponse;
|
} as ExitResponse;
|
||||||
};
|
};
|
||||||
export const decodeRoomExitNotification: ProtocolDecoder<RoomExitResponse> = (
|
export const decodeExitNotification: ProtocolDecoder<ExitResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0]
|
roomSeq: message.bodyList[0]
|
||||||
} as RoomExitResponse;
|
} as ExitResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface RoomExitAllRequest extends ProtocolRequest {
|
export interface ExitAllRequest extends ProtocolRequest {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string[];
|
roomSeq: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomAllExit: ProtocolEncoder<RoomExitAllRequest> = (
|
export const encodeAllExit: ProtocolEncoder<ExitAllRequest> = (
|
||||||
req: RoomExitAllRequest
|
req: ExitAllRequest
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -57,7 +55,7 @@ export const encodeRoomAllExit: ProtocolEncoder<RoomExitAllRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface RoomExitForcingRequest extends ProtocolRequest {
|
export interface ExitForcingRequest extends ProtocolRequest {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 강퇴요청타입(s)
|
// 강퇴요청타입(s)
|
||||||
|
@ -68,7 +66,7 @@ export interface RoomExitForcingRequest extends ProtocolRequest {
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomExitForcingResponse extends ProtocolRequest {
|
export interface ExitForcingResponse extends ProtocolRequest {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 강퇴요청타입(s)
|
// 강퇴요청타입(s)
|
||||||
|
@ -79,8 +77,8 @@ export interface RoomExitForcingResponse extends ProtocolRequest {
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomExitForcing: ProtocolEncoder<RoomExitForcingRequest> = (
|
export const encodeExitForcing: ProtocolEncoder<ExitForcingRequest> = (
|
||||||
req: RoomExitForcingRequest
|
req: ExitForcingRequest
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -93,7 +91,7 @@ export const encodeRoomExitForcing: ProtocolEncoder<RoomExitForcingRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomExitForcing: ProtocolDecoder<RoomExitForcingResponse> = (
|
export const decodeExitForcing: ProtocolDecoder<ExitForcingResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
let userSeqs: number[] = [];
|
let userSeqs: number[] = [];
|
||||||
|
@ -105,10 +103,10 @@ export const decodeRoomExitForcing: ProtocolDecoder<RoomExitForcingResponse> = (
|
||||||
type: message.bodyList[1] as RoomExitType,
|
type: message.bodyList[1] as RoomExitType,
|
||||||
senderSeq: message.bodyList[2],
|
senderSeq: message.bodyList[2],
|
||||||
userSeqs
|
userSeqs
|
||||||
} as RoomExitForcingResponse;
|
} as ExitForcingResponse;
|
||||||
};
|
};
|
||||||
export const decodeRoomExitForcingNotification: ProtocolDecoder<
|
export const decodeExitForcingNotification: ProtocolDecoder<
|
||||||
RoomExitForcingResponse
|
ExitForcingResponse
|
||||||
> = (message: ProtocolMessage) => {
|
> = (message: ProtocolMessage) => {
|
||||||
let userSeqs: number[] = [];
|
let userSeqs: number[] = [];
|
||||||
if (message.bodyList.length > 3) {
|
if (message.bodyList.length > 3) {
|
||||||
|
@ -119,5 +117,5 @@ export const decodeRoomExitForcingNotification: ProtocolDecoder<
|
||||||
type: message.bodyList[1] as RoomExitType,
|
type: message.bodyList[1] as RoomExitType,
|
||||||
senderSeq: message.bodyList[2],
|
senderSeq: message.bodyList[2],
|
||||||
userSeqs
|
userSeqs
|
||||||
} as RoomExitForcingResponse;
|
} as ExitForcingResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,8 @@ import {
|
||||||
PacketBodyValue,
|
PacketBodyValue,
|
||||||
ProtocolDecoder,
|
ProtocolDecoder,
|
||||||
ProtocolMessage,
|
ProtocolMessage,
|
||||||
BodyStringDivider
|
BodyStringDivider,
|
||||||
|
ProtocolStream
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
import { LocaleCode } from '@ucap-webmessenger/core';
|
import { LocaleCode } from '@ucap-webmessenger/core';
|
||||||
import { RoomType } from '../types/room.type';
|
import { RoomType } from '../types/room.type';
|
||||||
|
@ -137,7 +138,7 @@ export interface UserInfo {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomInfoRequest extends ProtocolRequest {
|
export interface InfoRequest extends ProtocolRequest {
|
||||||
// 0. 대화방SEQ(s)
|
// 0. 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 1. 상세정보여부(y)
|
// 1. 상세정보여부(y)
|
||||||
|
@ -146,34 +147,32 @@ export interface RoomInfoRequest extends ProtocolRequest {
|
||||||
localeCode: LocaleCode;
|
localeCode: LocaleCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomInfoResponse extends ProtocolResponse {
|
export interface InfoResponse extends ProtocolResponse {
|
||||||
// 0. 대화방SEQ(s)
|
// 0. 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomInfoDataResponse extends ProtocolResponse {
|
export interface InfoData extends ProtocolStream {
|
||||||
// 0. 대화방SEQ(s)
|
// 0. 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 1. {대화방정보}
|
// 1. {대화방정보}
|
||||||
roomInfo: RoomInfo;
|
roomInfo: RoomInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomUserShortDataResponse extends ProtocolResponse {
|
export interface UserShortData extends ProtocolStream {
|
||||||
// 0. 대화방SEQ(s)
|
// 0. 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 1n. {참여자정보}
|
// 1n. {참여자정보}
|
||||||
userInfos: UserInfoShort[];
|
userInfos: UserInfoShort[];
|
||||||
}
|
}
|
||||||
export interface RoomUserDataResponse extends ProtocolResponse {
|
export interface UserData extends ProtocolStream {
|
||||||
// 0. 대화방SEQ(s)
|
// 0. 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 1n. {참여자정보-D}
|
// 1n. {참여자정보-D}
|
||||||
userInfos: UserInfo[];
|
userInfos: UserInfo[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomInfo: ProtocolEncoder<RoomInfoRequest> = (
|
export const encodeInfo: ProtocolEncoder<InfoRequest> = (req: InfoRequest) => {
|
||||||
req: RoomInfoRequest
|
|
||||||
) => {
|
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq });
|
bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq });
|
||||||
|
@ -186,15 +185,15 @@ export const encodeRoomInfo: ProtocolEncoder<RoomInfoRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomInfo: ProtocolDecoder<RoomInfoResponse> = (
|
export const decodeInfo: ProtocolDecoder<InfoResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0]
|
roomSeq: message.bodyList[0]
|
||||||
} as RoomInfoResponse;
|
} as InfoResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomInfoData: ProtocolDecoder<RoomInfoDataResponse> = (
|
export const decodeInfoData: ProtocolDecoder<InfoData> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
let roomInfo: RoomInfo = null;
|
let roomInfo: RoomInfo = null;
|
||||||
|
@ -222,12 +221,12 @@ export const decodeRoomInfoData: ProtocolDecoder<RoomInfoDataResponse> = (
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0],
|
roomSeq: message.bodyList[0],
|
||||||
roomInfo
|
roomInfo
|
||||||
} as RoomInfoDataResponse;
|
} as InfoData;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomUserShortData: ProtocolDecoder<
|
export const decodeUserShortData: ProtocolDecoder<UserShortData> = (
|
||||||
RoomUserShortDataResponse
|
message: ProtocolMessage
|
||||||
> = (message: ProtocolMessage) => {
|
) => {
|
||||||
const userInfos: UserInfoShort[] = [];
|
const userInfos: UserInfoShort[] = [];
|
||||||
message.bodyList.slice(1).forEach(userInfo => {
|
message.bodyList.slice(1).forEach(userInfo => {
|
||||||
const info = userInfo.split(BodyStringDivider);
|
const info = userInfo.split(BodyStringDivider);
|
||||||
|
@ -252,10 +251,10 @@ export const decodeRoomUserShortData: ProtocolDecoder<
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0],
|
roomSeq: message.bodyList[0],
|
||||||
userInfos
|
userInfos
|
||||||
} as RoomUserShortDataResponse;
|
} as UserShortData;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomUserData: ProtocolDecoder<RoomUserDataResponse> = (
|
export const decodeUserData: ProtocolDecoder<UserData> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
const userInfos: UserInfo[] = [];
|
const userInfos: UserInfo[] = [];
|
||||||
|
@ -298,30 +297,30 @@ export const decodeRoomUserData: ProtocolDecoder<RoomUserDataResponse> = (
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0],
|
roomSeq: message.bodyList[0],
|
||||||
userInfos
|
userInfos
|
||||||
} as RoomUserDataResponse;
|
} as UserData;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface RoomUserStatusOfflineRequest extends ProtocolRequest {
|
export interface UserStatusOfflineRequest extends ProtocolRequest {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomUserStatusOfflineResponse extends ProtocolResponse {
|
export interface UserStatusOfflineResponse extends ProtocolResponse {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 사용자SEQ(n)...
|
// 사용자SEQ(n)...
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
export const encodeRoomUserStatusOffline: ProtocolEncoder<
|
export const encodeUserStatusOffline: ProtocolEncoder<
|
||||||
RoomUserStatusOfflineRequest
|
UserStatusOfflineRequest
|
||||||
> = (req: RoomUserStatusOfflineRequest) => {
|
> = (req: UserStatusOfflineRequest) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq });
|
bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq });
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
export const decodeRoomUserStatusOffline: ProtocolDecoder<
|
export const decodeUserStatusOffline: ProtocolDecoder<
|
||||||
RoomUserStatusOfflineResponse
|
UserStatusOfflineResponse
|
||||||
> = (message: ProtocolMessage) => {
|
> = (message: ProtocolMessage) => {
|
||||||
let userSeqs: number[] = [];
|
let userSeqs: number[] = [];
|
||||||
if (message.bodyList.length > 1) {
|
if (message.bodyList.length > 1) {
|
||||||
|
@ -330,5 +329,5 @@ export const decodeRoomUserStatusOffline: ProtocolDecoder<
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0],
|
roomSeq: message.bodyList[0],
|
||||||
userSeqs
|
userSeqs
|
||||||
} as RoomUserStatusOfflineResponse;
|
} as UserStatusOfflineResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,20 +8,20 @@ import {
|
||||||
ProtocolMessage
|
ProtocolMessage
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
|
||||||
export interface RoomInviteRequest extends ProtocolRequest {
|
export interface InviteRequest extends ProtocolRequest {
|
||||||
// 0. 대화방SEQ(s)
|
// 0. 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 1n. 초대자 userSeq(n)...
|
// 1n. 초대자 userSeq(n)...
|
||||||
inviteUserSeqs: number[];
|
inviteUserSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomInviteResponse extends ProtocolResponse {
|
export interface InviteResponse extends ProtocolResponse {
|
||||||
// 0. 대화방SEQ(s)
|
// 0. 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomInvite: ProtocolEncoder<RoomInviteRequest> = (
|
export const encodeInvite: ProtocolEncoder<InviteRequest> = (
|
||||||
req: RoomInviteRequest
|
req: InviteRequest
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -33,18 +33,18 @@ export const encodeRoomInvite: ProtocolEncoder<RoomInviteRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomInvite: ProtocolDecoder<RoomInviteResponse> = (
|
export const decodeInvite: ProtocolDecoder<InviteResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0]
|
roomSeq: message.bodyList[0]
|
||||||
} as RoomInviteResponse;
|
} as InviteResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomInviteNotification: ProtocolDecoder<
|
export const decodeInviteNotification: ProtocolDecoder<InviteResponse> = (
|
||||||
RoomInviteResponse
|
message: ProtocolMessage
|
||||||
> = (message: ProtocolMessage) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0]
|
roomSeq: message.bodyList[0]
|
||||||
} as RoomInviteResponse;
|
} as InviteResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,14 +8,14 @@ import {
|
||||||
ProtocolMessage
|
ProtocolMessage
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
|
||||||
export interface RoomOpenRequest extends ProtocolRequest {
|
export interface OpenRequest extends ProtocolRequest {
|
||||||
// 0. 구분자
|
// 0. 구분자
|
||||||
divCd: string;
|
divCd: string;
|
||||||
// 1n. 초대자 userSeq(n)...
|
// 1n. 초대자 userSeq(n)...
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomOpenResponse extends ProtocolResponse {
|
export interface OpenResponse extends ProtocolResponse {
|
||||||
// 0. 구분자
|
// 0. 구분자
|
||||||
divCd: string;
|
divCd: string;
|
||||||
// 1. 대화방SEQ(s)
|
// 1. 대화방SEQ(s)
|
||||||
|
@ -24,9 +24,7 @@ export interface RoomOpenResponse extends ProtocolResponse {
|
||||||
newRoom: boolean;
|
newRoom: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomOpen: ProtocolEncoder<RoomOpenRequest> = (
|
export const encodeOpen: ProtocolEncoder<OpenRequest> = (req: OpenRequest) => {
|
||||||
req: RoomOpenRequest
|
|
||||||
) => {
|
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
bodyList.push({ type: PacketBodyValue.String, value: req.divCd });
|
bodyList.push({ type: PacketBodyValue.String, value: req.divCd });
|
||||||
|
@ -37,17 +35,17 @@ export const encodeRoomOpen: ProtocolEncoder<RoomOpenRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomOpen: ProtocolDecoder<RoomOpenResponse> = (
|
export const decodeOpen: ProtocolDecoder<OpenResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
divCd: message.bodyList[0],
|
divCd: message.bodyList[0],
|
||||||
roomSeq: message.bodyList[1],
|
roomSeq: message.bodyList[1],
|
||||||
newRoom: message.bodyList[2] === 'Y' ? true : false
|
newRoom: message.bodyList[2] === 'Y' ? true : false
|
||||||
} as RoomOpenResponse;
|
} as OpenResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface RoomOpen2Request extends ProtocolRequest {
|
export interface Open2Request extends ProtocolRequest {
|
||||||
// 0. 구분자
|
// 0. 구분자
|
||||||
divCd: string;
|
divCd: string;
|
||||||
// 1. 대화방제목(s)
|
// 1. 대화방제목(s)
|
||||||
|
@ -56,7 +54,7 @@ export interface RoomOpen2Request extends ProtocolRequest {
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomOpen2Response extends ProtocolResponse {
|
export interface Open2Response extends ProtocolResponse {
|
||||||
// 0. 구분자
|
// 0. 구분자
|
||||||
divCd: string;
|
divCd: string;
|
||||||
// 1. 대화방제목(s)
|
// 1. 대화방제목(s)
|
||||||
|
@ -67,8 +65,8 @@ export interface RoomOpen2Response extends ProtocolResponse {
|
||||||
newRoom: boolean;
|
newRoom: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomOpen2: ProtocolEncoder<RoomOpen2Request> = (
|
export const encodeOpen2: ProtocolEncoder<Open2Request> = (
|
||||||
req: RoomOpen2Request
|
req: Open2Request
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -81,7 +79,7 @@ export const encodeRoomOpen2: ProtocolEncoder<RoomOpen2Request> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomOpen2: ProtocolDecoder<RoomOpen2Response> = (
|
export const decodeOpen2: ProtocolDecoder<Open2Response> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
|
@ -89,10 +87,10 @@ export const decodeRoomOpen2: ProtocolDecoder<RoomOpen2Response> = (
|
||||||
roomName: message.bodyList[1],
|
roomName: message.bodyList[1],
|
||||||
roomSeq: message.bodyList[2],
|
roomSeq: message.bodyList[2],
|
||||||
newRoom: message.bodyList[3] === 'Y' ? true : false
|
newRoom: message.bodyList[3] === 'Y' ? true : false
|
||||||
} as RoomOpen2Response;
|
} as Open2Response;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface RoomOpen3Request extends ProtocolRequest {
|
export interface Open3Request extends ProtocolRequest {
|
||||||
// 0. 구분자
|
// 0. 구분자
|
||||||
divCd: string;
|
divCd: string;
|
||||||
// 1. 대화방제목(s)
|
// 1. 대화방제목(s)
|
||||||
|
@ -105,7 +103,7 @@ export interface RoomOpen3Request extends ProtocolRequest {
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomOpen3Response extends ProtocolResponse {
|
export interface Open3Response extends ProtocolResponse {
|
||||||
// 0. 구분자
|
// 0. 구분자
|
||||||
divCd: string;
|
divCd: string;
|
||||||
// 1. 대화방제목(s)
|
// 1. 대화방제목(s)
|
||||||
|
@ -120,8 +118,8 @@ export interface RoomOpen3Response extends ProtocolResponse {
|
||||||
timerRoomInterval: number;
|
timerRoomInterval: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomOpen3: ProtocolEncoder<RoomOpen3Request> = (
|
export const encodeOpen3: ProtocolEncoder<Open3Request> = (
|
||||||
req: RoomOpen3Request
|
req: Open3Request
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -142,7 +140,7 @@ export const encodeRoomOpen3: ProtocolEncoder<RoomOpen3Request> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomOpen3: ProtocolDecoder<RoomOpen3Response> = (
|
export const decodeOpen3: ProtocolDecoder<Open3Response> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
|
@ -152,10 +150,10 @@ export const decodeRoomOpen3: ProtocolDecoder<RoomOpen3Response> = (
|
||||||
newRoom: message.bodyList[3] === 'Y' ? true : false,
|
newRoom: message.bodyList[3] === 'Y' ? true : false,
|
||||||
isTimerRoom: message.bodyList[4] === 'Y' ? true : false,
|
isTimerRoom: message.bodyList[4] === 'Y' ? true : false,
|
||||||
timerRoomInterval: message.bodyList[5] || 0
|
timerRoomInterval: message.bodyList[5] || 0
|
||||||
} as RoomOpen3Response;
|
} as Open3Response;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface RoomOpen4Request extends ProtocolRequest {
|
export interface Open4Request extends ProtocolRequest {
|
||||||
// 0. 구분자
|
// 0. 구분자
|
||||||
divCd: string;
|
divCd: string;
|
||||||
// 1. 대화방제목(s)
|
// 1. 대화방제목(s)
|
||||||
|
@ -168,7 +166,7 @@ export interface RoomOpen4Request extends ProtocolRequest {
|
||||||
userSeqs: number[];
|
userSeqs: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomOpen4Response extends ProtocolResponse {
|
export interface Open4Response extends ProtocolResponse {
|
||||||
// 0. 구분자
|
// 0. 구분자
|
||||||
divCd: string;
|
divCd: string;
|
||||||
// 1. 대화방제목(s)
|
// 1. 대화방제목(s)
|
||||||
|
@ -183,8 +181,8 @@ export interface RoomOpen4Response extends ProtocolResponse {
|
||||||
timerRoomInterval: number;
|
timerRoomInterval: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomOpen4: ProtocolEncoder<RoomOpen4Request> = (
|
export const encodeOpen4: ProtocolEncoder<Open4Request> = (
|
||||||
req: RoomOpen4Request
|
req: Open4Request
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -205,7 +203,7 @@ export const encodeRoomOpen4: ProtocolEncoder<RoomOpen4Request> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomOpen4: ProtocolDecoder<RoomOpen4Response> = (
|
export const decodeOpen4: ProtocolDecoder<Open4Response> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
|
@ -216,5 +214,5 @@ export const decodeRoomOpen4: ProtocolDecoder<RoomOpen4Response> = (
|
||||||
isTimerRoom: message.bodyList[4] === 'Y' ? true : false,
|
isTimerRoom: message.bodyList[4] === 'Y' ? true : false,
|
||||||
timerRoomInterval:
|
timerRoomInterval:
|
||||||
message.bodyList[4] !== 'Y' ? 0 : message.bodyList[5] || 0
|
message.bodyList[4] !== 'Y' ? 0 : message.bodyList[5] || 0
|
||||||
} as RoomOpen4Response;
|
} as Open4Response;
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
ProtocolMessage
|
ProtocolMessage
|
||||||
} from '@ucap-webmessenger/protocol';
|
} from '@ucap-webmessenger/protocol';
|
||||||
|
|
||||||
export interface RoomUpdateRequest extends ProtocolRequest {
|
export interface UpdateRequest extends ProtocolRequest {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 대화방제목(s)
|
// 대화방제목(s)
|
||||||
|
@ -19,7 +19,7 @@ export interface RoomUpdateRequest extends ProtocolRequest {
|
||||||
isSyncAll: boolean;
|
isSyncAll: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomUpdateResponse extends ProtocolResponse {
|
export interface UpdateResponse extends ProtocolResponse {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 대화방제목(s)
|
// 대화방제목(s)
|
||||||
|
@ -30,8 +30,8 @@ export interface RoomUpdateResponse extends ProtocolResponse {
|
||||||
isSyncAll: boolean;
|
isSyncAll: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomUpdate: ProtocolEncoder<RoomUpdateRequest> = (
|
export const encodeUpdate: ProtocolEncoder<UpdateRequest> = (
|
||||||
req: RoomUpdateRequest
|
req: UpdateRequest
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ export const encodeRoomUpdate: ProtocolEncoder<RoomUpdateRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomUpdate: ProtocolDecoder<RoomUpdateResponse> = (
|
export const decodeUpdate: ProtocolDecoder<UpdateResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
|
@ -56,26 +56,26 @@ export const decodeRoomUpdate: ProtocolDecoder<RoomUpdateResponse> = (
|
||||||
roomName: message.bodyList[1],
|
roomName: message.bodyList[1],
|
||||||
isAlarm: message.bodyList[2] === 'Y' ? true : false,
|
isAlarm: message.bodyList[2] === 'Y' ? true : false,
|
||||||
isSyncAll: message.bodyList[3] === '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)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 타이머시간(n)
|
// 타이머시간(n)
|
||||||
timerInterval: number;
|
timerInterval: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomUpdateTimerSetResponse extends ProtocolResponse {
|
export interface UpdateTimerSetResponse extends ProtocolResponse {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 타이머시간(n)
|
// 타이머시간(n)
|
||||||
timerInterval: number;
|
timerInterval: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomUpdateTimerSet: ProtocolEncoder<
|
export const encodeUpdateTimerSet: ProtocolEncoder<UpdateTimerSetRequest> = (
|
||||||
RoomUpdateTimerSetRequest
|
req: UpdateTimerSetRequest
|
||||||
> = (req: RoomUpdateTimerSetRequest) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq });
|
bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq });
|
||||||
|
@ -83,16 +83,16 @@ export const encodeRoomUpdateTimerSet: ProtocolEncoder<
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomUpdateTimerSet: ProtocolDecoder<
|
export const decodeUpdateTimerSet: ProtocolDecoder<UpdateTimerSetResponse> = (
|
||||||
RoomUpdateTimerSetResponse
|
message: ProtocolMessage
|
||||||
> = (message: ProtocolMessage) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0],
|
roomSeq: message.bodyList[0],
|
||||||
timerInterval: message.bodyList[1] || 0
|
timerInterval: message.bodyList[1] || 0
|
||||||
} as RoomUpdateTimerSetResponse;
|
} as UpdateTimerSetResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface RoomUpdateFontRequest extends ProtocolRequest {
|
export interface UpdateFontRequest extends ProtocolRequest {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 폰트색(s) cf)0x000000 형태의 스트링
|
// 폰트색(s) cf)0x000000 형태의 스트링
|
||||||
|
@ -101,7 +101,7 @@ export interface RoomUpdateFontRequest extends ProtocolRequest {
|
||||||
senderSeq: number;
|
senderSeq: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomUpdateFontResponse extends ProtocolResponse {
|
export interface UpdateFontResponse extends ProtocolResponse {
|
||||||
// 대화방SEQ(s)
|
// 대화방SEQ(s)
|
||||||
roomSeq: string;
|
roomSeq: string;
|
||||||
// 폰트색(s) cf)0x000000 형태의 스트링
|
// 폰트색(s) cf)0x000000 형태의 스트링
|
||||||
|
@ -110,8 +110,8 @@ export interface RoomUpdateFontResponse extends ProtocolResponse {
|
||||||
senderSeq: number;
|
senderSeq: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const encodeRoomUpdateFont: ProtocolEncoder<RoomUpdateFontRequest> = (
|
export const encodeUpdateFont: ProtocolEncoder<UpdateFontRequest> = (
|
||||||
req: RoomUpdateFontRequest
|
req: UpdateFontRequest
|
||||||
) => {
|
) => {
|
||||||
const bodyList: PacketBody[] = [];
|
const bodyList: PacketBody[] = [];
|
||||||
|
|
||||||
|
@ -121,22 +121,22 @@ export const encodeRoomUpdateFont: ProtocolEncoder<RoomUpdateFontRequest> = (
|
||||||
return bodyList;
|
return bodyList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomUpdateFont: ProtocolDecoder<RoomUpdateFontResponse> = (
|
export const decodeUpdateFont: ProtocolDecoder<UpdateFontResponse> = (
|
||||||
message: ProtocolMessage
|
message: ProtocolMessage
|
||||||
) => {
|
) => {
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0],
|
roomSeq: message.bodyList[0],
|
||||||
fontColor: message.bodyList[1],
|
fontColor: message.bodyList[1],
|
||||||
senderSeq: message.bodyList[2]
|
senderSeq: message.bodyList[2]
|
||||||
} as RoomUpdateFontResponse;
|
} as UpdateFontResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const decodeRoomUpdateFontNotification: ProtocolDecoder<
|
export const decodeUpdateFontNotification: ProtocolDecoder<
|
||||||
RoomUpdateFontResponse
|
UpdateFontResponse
|
||||||
> = (message: ProtocolMessage) => {
|
> = (message: ProtocolMessage) => {
|
||||||
return {
|
return {
|
||||||
roomSeq: message.bodyList[0],
|
roomSeq: message.bodyList[0],
|
||||||
fontColor: message.bodyList[1],
|
fontColor: message.bodyList[1],
|
||||||
senderSeq: message.bodyList[2]
|
senderSeq: message.bodyList[2]
|
||||||
} as RoomUpdateFontResponse;
|
} as UpdateFontResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,70 +25,70 @@ import {
|
||||||
SSVC_TYPE_ROOM_FONT_UPD_REQ
|
SSVC_TYPE_ROOM_FONT_UPD_REQ
|
||||||
} from '../types/service';
|
} from '../types/service';
|
||||||
import {
|
import {
|
||||||
RoomOpenRequest,
|
OpenRequest,
|
||||||
encodeRoomOpen,
|
encodeOpen,
|
||||||
decodeRoomOpen,
|
decodeOpen,
|
||||||
RoomOpenResponse,
|
OpenResponse,
|
||||||
RoomOpen2Request,
|
Open2Request,
|
||||||
RoomOpen2Response,
|
Open2Response,
|
||||||
decodeRoomOpen2,
|
decodeOpen2,
|
||||||
encodeRoomOpen2,
|
encodeOpen2,
|
||||||
RoomOpen3Request,
|
Open3Request,
|
||||||
RoomOpen3Response,
|
Open3Response,
|
||||||
encodeRoomOpen3,
|
encodeOpen3,
|
||||||
decodeRoomOpen3,
|
decodeOpen3,
|
||||||
RoomOpen4Request,
|
Open4Request,
|
||||||
RoomOpen4Response,
|
Open4Response,
|
||||||
encodeRoomOpen4,
|
encodeOpen4,
|
||||||
decodeRoomOpen4
|
decodeOpen4
|
||||||
} from '../models/open';
|
} from '../models/open';
|
||||||
import {
|
import {
|
||||||
RoomInviteRequest,
|
InviteRequest,
|
||||||
RoomInviteResponse,
|
InviteResponse,
|
||||||
encodeRoomInvite,
|
encodeInvite,
|
||||||
decodeRoomInvite
|
decodeInvite
|
||||||
} from '../models/invite';
|
} from '../models/invite';
|
||||||
import {
|
import {
|
||||||
RoomInfoRequest,
|
InfoRequest,
|
||||||
RoomInfoResponse,
|
InfoResponse,
|
||||||
RoomInfoDataResponse,
|
InfoData,
|
||||||
RoomUserShortDataResponse,
|
UserShortData,
|
||||||
RoomUserDataResponse,
|
UserData,
|
||||||
encodeRoomInfo,
|
encodeInfo,
|
||||||
decodeRoomInfoData,
|
decodeInfoData,
|
||||||
decodeRoomInfo,
|
decodeInfo,
|
||||||
decodeRoomUserShortData,
|
decodeUserShortData,
|
||||||
decodeRoomUserData,
|
decodeUserData,
|
||||||
RoomUserStatusOfflineRequest,
|
UserStatusOfflineRequest,
|
||||||
RoomUserStatusOfflineResponse,
|
UserStatusOfflineResponse,
|
||||||
encodeRoomUserStatusOffline,
|
encodeUserStatusOffline,
|
||||||
decodeRoomUserStatusOffline
|
decodeUserStatusOffline
|
||||||
} from '../models/info';
|
} from '../models/info';
|
||||||
import {
|
import {
|
||||||
RoomExitRequest,
|
ExitRequest,
|
||||||
RoomExitResponse,
|
ExitResponse,
|
||||||
encodeRoomExit,
|
encodeExit,
|
||||||
decodeRoomExit,
|
decodeExit,
|
||||||
RoomExitAllRequest,
|
ExitAllRequest,
|
||||||
encodeRoomAllExit,
|
encodeAllExit,
|
||||||
RoomExitForcingRequest,
|
ExitForcingRequest,
|
||||||
RoomExitForcingResponse,
|
ExitForcingResponse,
|
||||||
encodeRoomExitForcing,
|
encodeExitForcing,
|
||||||
decodeRoomExitForcing
|
decodeExitForcing
|
||||||
} from '../models/exit';
|
} from '../models/exit';
|
||||||
import {
|
import {
|
||||||
RoomUpdateRequest,
|
UpdateRequest,
|
||||||
RoomUpdateResponse,
|
UpdateResponse,
|
||||||
encodeRoomUpdate,
|
encodeUpdate,
|
||||||
decodeRoomUpdate,
|
decodeUpdate,
|
||||||
RoomUpdateTimerSetRequest,
|
UpdateTimerSetRequest,
|
||||||
RoomUpdateTimerSetResponse,
|
UpdateTimerSetResponse,
|
||||||
encodeRoomUpdateTimerSet,
|
encodeUpdateTimerSet,
|
||||||
decodeRoomUpdateTimerSet,
|
decodeUpdateTimerSet,
|
||||||
RoomUpdateFontRequest,
|
UpdateFontRequest,
|
||||||
RoomUpdateFontResponse,
|
UpdateFontResponse,
|
||||||
encodeRoomUpdateFont,
|
encodeUpdateFont,
|
||||||
decodeRoomUpdateFont
|
decodeUpdateFont
|
||||||
} from '../models/update';
|
} from '../models/update';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
@ -97,169 +97,159 @@ import {
|
||||||
export class RoomProtocolService {
|
export class RoomProtocolService {
|
||||||
constructor(private protocolService: ProtocolService) {}
|
constructor(private protocolService: ProtocolService) {}
|
||||||
|
|
||||||
public roomOpen(req: RoomOpenRequest): Observable<RoomOpenResponse> {
|
public open(req: OpenRequest): Observable<OpenResponse> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeRoomOpen(res))
|
map(res => decodeOpen(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public roomOpen2(req: RoomOpen2Request): Observable<RoomOpen2Response> {
|
public open2(req: Open2Request): Observable<Open2Response> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeRoomOpen2(res))
|
map(res => decodeOpen2(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public roomOpen3(req: RoomOpen3Request): Observable<RoomOpen3Response> {
|
public open3(req: Open3Request): Observable<Open3Response> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeRoomOpen3(res))
|
map(res => decodeOpen3(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public roomOpen4(req: RoomOpen4Request): Observable<RoomOpen4Response> {
|
public open4(req: Open4Request): Observable<Open4Response> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeRoomOpen4(res))
|
map(res => decodeOpen4(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public roomInvite(req: RoomInviteRequest): Observable<RoomInviteResponse> {
|
public invite(req: InviteRequest): Observable<InviteResponse> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
take(1),
|
take(1),
|
||||||
map(res => decodeRoomInvite(res))
|
map(res => decodeInvite(res))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public roomInfo(
|
public info(
|
||||||
req: RoomInfoRequest
|
req: InfoRequest
|
||||||
): Observable<
|
): Observable<InfoResponse | InfoData | UserShortData | UserData> {
|
||||||
| RoomInfoResponse
|
|
||||||
| RoomInfoDataResponse
|
|
||||||
| RoomUserShortDataResponse
|
|
||||||
| RoomUserDataResponse
|
|
||||||
> {
|
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
takeWhile(res => SSVC_TYPE_ROOM_INFO_RES !== res.subServiceType, true),
|
takeWhile(res => SSVC_TYPE_ROOM_INFO_RES !== res.subServiceType, true),
|
||||||
map(res => {
|
map(res => {
|
||||||
if (SSVC_TYPE_ROOM_INFO_ROOM === res.subServiceType) {
|
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) {
|
} 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) {
|
} 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(
|
public userStatusOffline(
|
||||||
req: RoomUserStatusOfflineRequest
|
req: UserStatusOfflineRequest
|
||||||
): Observable<RoomUserStatusOfflineResponse> {
|
): Observable<UserStatusOfflineResponse> {
|
||||||
return this.protocolService
|
return this.protocolService
|
||||||
.call(
|
.call(
|
||||||
SVC_TYPE_ROOM,
|
SVC_TYPE_ROOM,
|
||||||
SSVC_TYPE_ROOM_USER_STATUS_REQ,
|
SSVC_TYPE_ROOM_USER_STATUS_REQ,
|
||||||
...encodeRoomUserStatusOffline(req)
|
...encodeUserStatusOffline(req)
|
||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
map(res => {
|
map(res => {
|
||||||
take(1);
|
take(1);
|
||||||
return decodeRoomUserStatusOffline(res);
|
return decodeUserStatusOffline(res);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public roomExit(req: RoomExitRequest): Observable<RoomExitResponse> {
|
public exit(req: ExitRequest): Observable<ExitResponse> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
map(res => {
|
map(res => {
|
||||||
take(1);
|
take(1);
|
||||||
return decodeRoomExit(res);
|
return decodeExit(res);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public roomExitAll(req: RoomExitAllRequest): Observable<void> {
|
public exitAll(req: ExitAllRequest): Observable<void> {
|
||||||
return this.protocolService
|
return this.protocolService
|
||||||
.call(
|
.call(SVC_TYPE_ROOM, SSVC_TYPE_ROOM_EXIT_ALL_REQ, ...encodeAllExit(req))
|
||||||
SVC_TYPE_ROOM,
|
|
||||||
SSVC_TYPE_ROOM_EXIT_ALL_REQ,
|
|
||||||
...encodeRoomAllExit(req)
|
|
||||||
)
|
|
||||||
.pipe(
|
.pipe(
|
||||||
map(res => {
|
map(res => {
|
||||||
take(1);
|
take(1);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public roomExitForcing(
|
public exitForcing(req: ExitForcingRequest): Observable<ExitForcingResponse> {
|
||||||
req: RoomExitForcingRequest
|
|
||||||
): Observable<RoomExitForcingResponse> {
|
|
||||||
return this.protocolService
|
return this.protocolService
|
||||||
.call(
|
.call(
|
||||||
SVC_TYPE_ROOM,
|
SVC_TYPE_ROOM,
|
||||||
SSVC_TYPE_ROOM_EXIT_FORCING_REQ,
|
SSVC_TYPE_ROOM_EXIT_FORCING_REQ,
|
||||||
...encodeRoomExitForcing(req)
|
...encodeExitForcing(req)
|
||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
map(res => {
|
map(res => {
|
||||||
take(1);
|
take(1);
|
||||||
return decodeRoomExitForcing(res);
|
return decodeExitForcing(res);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public roomUpdate(req: RoomUpdateRequest): Observable<RoomUpdateResponse> {
|
public update(req: UpdateRequest): Observable<UpdateResponse> {
|
||||||
return this.protocolService
|
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(
|
.pipe(
|
||||||
map(res => {
|
map(res => {
|
||||||
take(1);
|
take(1);
|
||||||
return decodeRoomUpdate(res);
|
return decodeUpdate(res);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public roomUpdateTimerSet(
|
public updateTimerSet(
|
||||||
req: RoomUpdateTimerSetRequest
|
req: UpdateTimerSetRequest
|
||||||
): Observable<RoomUpdateTimerSetResponse> {
|
): Observable<UpdateTimerSetResponse> {
|
||||||
return this.protocolService
|
return this.protocolService
|
||||||
.call(
|
.call(
|
||||||
SVC_TYPE_ROOM,
|
SVC_TYPE_ROOM,
|
||||||
SSVC_TYPE_ROOM_INFO_UPD_REQ,
|
SSVC_TYPE_ROOM_INFO_UPD_REQ,
|
||||||
...encodeRoomUpdateTimerSet(req)
|
...encodeUpdateTimerSet(req)
|
||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
map(res => {
|
map(res => {
|
||||||
take(1);
|
take(1);
|
||||||
return decodeRoomUpdateTimerSet(res);
|
return decodeUpdateTimerSet(res);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public roomUpdateFont(
|
public updateFont(req: UpdateFontRequest): Observable<UpdateFontResponse> {
|
||||||
req: RoomUpdateFontRequest
|
|
||||||
): Observable<RoomUpdateFontResponse> {
|
|
||||||
return this.protocolService
|
return this.protocolService
|
||||||
.call(
|
.call(
|
||||||
SVC_TYPE_ROOM,
|
SVC_TYPE_ROOM,
|
||||||
SSVC_TYPE_ROOM_FONT_UPD_REQ,
|
SSVC_TYPE_ROOM_FONT_UPD_REQ,
|
||||||
...encodeRoomUpdateFont(req)
|
...encodeUpdateFont(req)
|
||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
map(res => {
|
map(res => {
|
||||||
take(1);
|
take(1);
|
||||||
return decodeRoomUpdateFont(res);
|
return decodeUpdateFont(res);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map, take, takeWhile } from 'rxjs/operators';
|
import { map, take } from 'rxjs/operators';
|
||||||
import {
|
import {
|
||||||
UserPasswordSetRequest,
|
UserPasswordSetRequest,
|
||||||
UserPasswordSetResponse,
|
UserPasswordSetResponse,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user