38 lines
880 B
TypeScript
38 lines
880 B
TypeScript
import { DeviceType, LocaleCode } from '@ucap-webmessenger/core';
|
|
import {
|
|
ProtocolRequest,
|
|
ProtocolResponse,
|
|
ProtocolEncoder,
|
|
PacketBody,
|
|
PacketBodyValue,
|
|
ProtocolDecoder,
|
|
ProtocolMessage,
|
|
decodeProtocolMessage
|
|
} from '@ucap-webmessenger/protocol';
|
|
|
|
export interface DelRequest extends ProtocolRequest {
|
|
// 0: 동료그룹SEQ(n)
|
|
groupSeq: number;
|
|
}
|
|
|
|
export interface DelResponse extends ProtocolResponse {
|
|
// 0: 동료그룹SEQ(n)
|
|
groupSeq: number;
|
|
}
|
|
|
|
export const encodeDel: ProtocolEncoder<DelRequest> = (req: DelRequest) => {
|
|
const bodyList: PacketBody[] = [];
|
|
|
|
bodyList.push({ type: PacketBodyValue.Integer, value: req.groupSeq });
|
|
|
|
return bodyList;
|
|
};
|
|
|
|
export const decodeDel: ProtocolDecoder<DelResponse> = (
|
|
message: ProtocolMessage
|
|
) => {
|
|
return decodeProtocolMessage(message, {
|
|
groupSeq: message.bodyList[0]
|
|
} as DelResponse);
|
|
};
|