fixed bug and modify GROUP > group-update

This commit is contained in:
leejh 2019-09-20 17:08:39 +09:00
parent 5c1c0f30fc
commit 88c49bc900

View File

@ -15,7 +15,7 @@ export interface GroupUpdateRequest extends ProtocolRequest {
// 1: 동료그룹이름(s)
groupName: string;
// 2n: 사용자SEQ(n)...
userSeqs: [];
userSeqs: number[];
}
export interface GroupUpdateResponse extends ProtocolResponse {
@ -24,7 +24,7 @@ export interface GroupUpdateResponse extends ProtocolResponse {
// 1: 동료그룹이름(s)
groupName: string;
// 2n: 사용자SEQ(n)...
userSeqs: [];
userSeqs: number[];
}
export const encodeGroupUpdate: ProtocolEncoder<GroupUpdateRequest> = (
@ -35,7 +35,7 @@ export const encodeGroupUpdate: ProtocolEncoder<GroupUpdateRequest> = (
bodyList.push(
{ type: PacketBodyValue.Integer, value: req.groupSeq },
{ type: PacketBodyValue.String, value: req.groupName },
{ type: PacketBodyValue.String, value: req.userSeqs.join() }
{ type: PacketBodyValue.String, value: req.userSeqs.join(',') }
);
return bodyList;
@ -44,9 +44,9 @@ export const encodeGroupUpdate: ProtocolEncoder<GroupUpdateRequest> = (
export const decodeGroupUpdate: ProtocolDecoder<GroupUpdateResponse> = (
message: ProtocolMessage
) => {
let userSeqArray: Array<number> = [];
let userSeqArray: number[] = [];
if (message.bodyList.length > 2 && !message.bodyList[2].empty()) {
userSeqArray = message.bodyList[2].split(',').map(v => Number(v));
userSeqArray = message.bodyList[2].split(',').map((v: any) => Number(v));
}
return {
@ -78,7 +78,7 @@ export const encodeGroupUpdate2: ProtocolEncoder<GroupUpdateRequest> = (
export const decodeGroupUpdate2: ProtocolDecoder<GroupUpdateResponse> = (
message: ProtocolMessage
) => {
let userSeqArray: Array<number> = [];
let userSeqArray: number[] = [];
if (message.bodyList.length > 2) {
userSeqArray = message.bodyList.slice(2);
}