This commit is contained in:
병준 박 2019-10-02 10:35:46 +09:00
commit 7eb878cf68
12 changed files with 224 additions and 238 deletions

View File

@ -69,12 +69,12 @@ export const decodeInfoData: ProtocolDecoder<InfoData> = (
const infoList: Info[] = [];
for (let i = 1; i < message.bodyList.length; ) {
infoList.push({
seq: message.bodyList[i++],
type: message.bodyList[i++],
senderSeq: message.bodyList[i++],
sendDate: message.bodyList[i++],
sentMessage: message.bodyList[i++],
receiverCount: message.bodyList[i++]
seq: message.bodyList[0],
type: message.bodyList[1],
senderSeq: message.bodyList[2],
sendDate: message.bodyList[3],
sentMessage: message.bodyList[4],
receiverCount: message.bodyList[5]
});
}

View File

@ -91,19 +91,18 @@ export const decodeInfoData: ProtocolDecoder<InfoData> = (
const fileInfos: FileInfo[] = [];
message.bodyList.forEach(fileInfo => {
const info = fileInfo.split(BodyStringDivider);
let i = 0;
fileInfos.push({
roomSeq: info[i],
eventSeq: Number(info[i++]),
seq: Number(info[i++]),
senderSeq: Number(info[i++]),
type: info[i++] as FileType,
name: info[i++],
url: info[i++],
size: info[i++],
sendDate: info[i++],
receivedUserCount: Number(info[i++]),
receiverCount: Number(info[i++])
roomSeq: info[0],
eventSeq: Number(info[1]),
seq: Number(info[2]),
senderSeq: Number(info[3]),
type: info[4] as FileType,
name: info[5],
url: info[6],
size: info[7],
sendDate: info[8],
receivedUserCount: Number(info[9]),
receiverCount: Number(info[10])
});
});
@ -118,14 +117,13 @@ export const decodeInfoCheckData: ProtocolDecoder<InfoCheckData> = (
const fileDownloadInfos: FileDownloadInfo[] = [];
message.bodyList.forEach(fileInfo => {
const info = fileInfo.split(BodyStringDivider);
let i = 0;
fileDownloadInfos.push({
roomSeq: info[i],
seq: Number(info[i++]),
userSeq: Number(info[i++]),
userName: info[i++],
downloadDate: info[i++],
isDownload: info[i++] === 'Y' ? true : false
roomSeq: info[0],
seq: Number(info[1]),
userSeq: Number(info[2]),
userName: info[3],
downloadDate: info[4],
isDownload: info[5] === 'Y' ? true : false
});
});

View File

@ -40,16 +40,15 @@ export const decodeStatus: ProtocolDecoder<StatusResponse> = (
const statusInfos: StatusInfo[] = [];
message.bodyList.forEach(statusInfo => {
const info = statusInfo.split(BodyStringDivider);
let idx = 0;
statusInfos.push({
userSeq: Number(info[idx]),
pcStatus: info[idx++] as StatusCode,
phoneStatus: info[idx++] as StatusCode,
mobileStatus: info[idx++] as StatusCode,
conferenceStatus: info[idx++] as StatusCode,
statusMessage: info[idx++],
mobileConferenceStatus: info[idx++] as StatusCode,
imessengerStatus: info[idx++] as StatusCode
userSeq: Number(info[0]),
pcStatus: info[1] as StatusCode,
phoneStatus: info[2] as StatusCode,
mobileStatus: info[3] as StatusCode,
conferenceStatus: info[4] as StatusCode,
statusMessage: info[5],
mobileConferenceStatus: info[6] as StatusCode,
imessengerStatus: info[7] as StatusCode
});
});
return {

View File

@ -50,37 +50,36 @@ export const decodeDataUser: ProtocolDecoder<DataUserResponse> = (
let userInfo: UserInfoSS;
if (message.bodyList.length > 1) {
const info = message.bodyList[1].split(BodyStringDivider);
let i = 0;
userInfo = {
seq: Number(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
seq: Number(info[0]),
name: info[1],
profileImageFile: info[2],
grade: info[3],
intro: info[4],
companyCode: info[5],
hpNumber: info[6],
lineNumber: info[7],
email: info[8],
isMobile: info[9] === 'Y' ? true : false,
deptName: info[10],
order: info[11],
isActive: info[12] === 'Y' ? true : false,
roleCd: info[13] as RoleCode,
employeeNum: info[14],
madn: info[15],
hardSadn: info[16],
fmcSadn: info[17],
callMode: info[18],
nameEn: info[19],
nameCn: info[20],
gradeEn: info[21],
gradeCn: info[22],
deptNameEn: info[23],
deptNameCn: info[24],
deptSeq: info[25],
isPrivacyAgree: info[26] === 'Y' ? true : false,
isValidLogin: info[27] === 'Y' ? true : false,
employeeType: info[28] as EmployeeType
};
}
return {

View File

@ -142,37 +142,36 @@ export const decodeDeptUserData: ProtocolDecoder<DeptUserData> = (
const userInfos: UserInfoSS[] = [];
message.bodyList.slice(1).forEach(userInfo => {
const info = userInfo.split(BodyStringDivider);
let i = 0;
userInfos.push({
seq: Number(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++] as CallMode,
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
seq: Number(info[0]),
name: info[1],
profileImageFile: info[2],
grade: info[3],
intro: info[4],
companyCode: info[5],
hpNumber: info[6],
lineNumber: info[7],
email: info[8],
isMobile: info[9] === 'Y' ? true : false,
deptName: info[10],
order: info[11],
isActive: info[12] === 'Y' ? true : false,
roleCd: info[13] as RoleCode,
employeeNum: info[14],
madn: info[15],
hardSadn: info[16],
fmcSadn: info[17],
callMode: info[18] as CallMode,
nameEn: info[19],
nameCn: info[20],
gradeEn: info[21],
gradeCn: info[22],
deptNameEn: info[23],
deptNameCn: info[24],
deptSeq: info[25],
isPrivacyAgree: info[26] === 'Y' ? true : false,
isValidLogin: info[27] === 'Y' ? true : false,
employeeType: info[28] as EmployeeType
});
});
return {

View File

@ -67,19 +67,18 @@ export const decodeDeptData: ProtocolDecoder<DeptData> = (
const departmentInfos: DeptInfo[] = [];
message.bodyList.slice(1).forEach(deptInfo => {
const info = deptInfo.split(BodyStringDivider);
let i = 0;
departmentInfos.push({
seq: Number(info[i]),
name: info[i++],
companyCode: info[i++],
type: info[i++] as DeptType,
rootSeq: Number(info[i++]),
parentSeq: Number(info[i++]),
order: info[i++],
depth: Number(info[i++]),
isActive: info[i++] === 'Y' ? true : false,
nameEn: info[i++],
nameCn: info[i++]
seq: Number(info[0]),
name: info[1],
companyCode: info[2],
type: info[3] as DeptType,
rootSeq: Number(info[4]),
parentSeq: Number(info[5]),
order: info[6],
depth: Number(info[7]),
isActive: info[8] === 'Y' ? true : false,
nameEn: info[9],
nameCn: info[10]
});
});
return {

View File

@ -133,32 +133,31 @@ export const decodeUserDnData: ProtocolDecoder<UserDnData> = (
const userDnInfos: UserInfoDN[] = [];
message.bodyList.slice(1).forEach(userDnInfo => {
const info = userDnInfo.split(BodyStringDivider);
let i = 0;
userDnInfos.push({
seq: Number(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,
order: info[i++],
isActive: info[i++] === 'Y' ? true : false,
roleCd: info[i++] as RoleCode,
employeeNum: info[i++],
deptName: info[i++],
madn: info[i++],
hardSadn: info[i++],
fmcSadn: info[i++],
nameEn: info[i++],
nameCn: info[i++],
gradeEn: info[i++],
gradeCn: info[i++],
deptNameEn: info[i++],
deptNameCn: info[i++]
seq: Number(info[0]),
name: info[1],
profileImageFile: info[2],
grade: info[3],
intro: info[4],
companyCode: info[5],
hpNumber: info[6],
lineNumber: info[7],
email: info[8],
isMobile: info[9] === 'Y' ? true : false,
order: info[10],
isActive: info[11] === 'Y' ? true : false,
roleCd: info[12] as RoleCode,
employeeNum: info[13],
deptName: info[14],
madn: info[15],
hardSadn: info[16],
fmcSadn: info[17],
nameEn: info[18],
nameCn: info[19],
gradeEn: info[20],
gradeCn: info[21],
deptNameEn: info[22],
deptNameCn: info[23]
});
});
return {

View File

@ -122,37 +122,36 @@ export const decodeUserSeqData: ProtocolDecoder<UserSeqData> = (
const userInfos: UserInfoF[] = [];
message.bodyList.slice(1).forEach(userInfo => {
const info = userInfo.split(BodyStringDivider);
let i = 0;
userInfos.push({
seq: Number(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++],
isFavorit: info[i++] === 'Y' ? true : false,
isBuddy: info[i++] === 'Y' ? true : false,
isActive: info[i++] === 'Y' ? true : false,
roleCd: info[i++] as RoleCode,
employeeNum: info[i++],
madn: info[i++],
hardSadn: info[i++],
fmcSadn: info[i++],
nameEn: info[i++],
nameCn: info[i++],
gradeEn: info[i++],
gradeCn: info[i++],
deptNameEn: info[i++],
deptNameCn: info[i++],
isPrivacyAgree: info[i++] === 'Y' ? true : false,
isValidLogin: info[i++] === 'Y' ? true : false,
employeeType: info[i++] as EmployeeType,
nickName: info[i++]
seq: Number(info[0]),
name: info[1],
profileImageFile: info[2],
grade: info[3],
intro: info[4],
companyCode: info[5],
hpNumber: info[6],
lineNumber: info[7],
email: info[8],
isMobile: info[9] === 'Y' ? true : false,
deptName: info[10],
isFavorit: info[11] === 'Y' ? true : false,
isBuddy: info[12] === 'Y' ? true : false,
isActive: info[13] === 'Y' ? true : false,
roleCd: info[14] as RoleCode,
employeeNum: info[15],
madn: info[16],
hardSadn: info[17],
fmcSadn: info[18],
nameEn: info[19],
nameCn: info[20],
gradeEn: info[21],
gradeCn: info[22],
deptNameEn: info[23],
deptNameCn: info[24],
isPrivacyAgree: info[25] === 'Y' ? true : false,
isValidLogin: info[26] === 'Y' ? true : false,
employeeType: info[27] as EmployeeType,
nickName: info[28]
} as UserInfoF);
});
return {
@ -167,37 +166,36 @@ export const decodeUserSeqData2: ProtocolDecoder<UserSeqData2> = (
const userInfos: UserInfoSS[] = [];
message.bodyList.slice(1).forEach(userInfo => {
const info = userInfo.split(BodyStringDivider);
let i = 0;
userInfos.push({
seq: Number(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
seq: Number(info[0]),
name: info[1],
profileImageFile: info[2],
grade: info[3],
intro: info[4],
companyCode: info[5],
hpNumber: info[6],
lineNumber: info[7],
email: info[8],
isMobile: info[9] === 'Y' ? true : false,
deptName: info[10],
order: info[11],
isActive: info[12] === 'Y' ? true : false,
roleCd: info[13] as RoleCode,
employeeNum: info[14],
madn: info[15],
hardSadn: info[16],
fmcSadn: info[17],
callMode: info[18],
nameEn: info[19],
nameCn: info[20],
gradeEn: info[21],
gradeCn: info[22],
deptNameEn: info[23],
deptNameCn: info[24],
deptSeq: info[25],
isPrivacyAgree: info[26] === 'Y' ? true : false,
isValidLogin: info[27] === 'Y' ? true : false,
employeeType: info[28] as EmployeeType
});
});
return {

View File

@ -18,16 +18,15 @@ export const decodeBuddy: ProtocolDecoder<BuddyResponse> = (
const statusInfos: StatusInfo[] = [];
message.bodyList.forEach(statusInfo => {
const info = statusInfo.split(BodyStringDivider);
let idx = 0;
statusInfos.push({
userSeq: Number(info[idx]),
pcStatus: info[idx++] as StatusCode,
phoneStatus: info[idx++] as StatusCode,
mobileStatus: info[idx++] as StatusCode,
conferenceStatus: info[idx++] as StatusCode,
statusMessage: info[idx++],
mobileConferenceStatus: info[idx++] as StatusCode,
imessengerStatus: info[idx++] as StatusCode
userSeq: Number(info[0]),
pcStatus: info[1] as StatusCode,
phoneStatus: info[2] as StatusCode,
mobileStatus: info[3] as StatusCode,
conferenceStatus: info[4] as StatusCode,
statusMessage: info[5],
mobileConferenceStatus: info[6] as StatusCode,
imessengerStatus: info[7] as StatusCode
});
});
return {

View File

@ -74,18 +74,17 @@ export const decodeBulkInfoData: ProtocolDecoder<BulkInfoData> = (
const statusBulkInfos: StatusBulkInfo[] = [];
message.bodyList.slice(1).forEach(statusBulkInfo => {
const info = statusBulkInfo.split(BodyStringDivider);
let idx = 0;
statusBulkInfos.push({
userSeq: Number(info[idx]),
pcStatus: info[idx++] as StatusCode,
phoneStatus: info[idx++] as StatusCode,
mobileStatus: info[idx++] as StatusCode,
conferenceStatus: info[idx++] as StatusCode,
statusMessage: info[idx++],
mobileConferenceStatus: info[idx++] as StatusCode,
imessengerStatus: info[idx++] as StatusCode,
terminalStatus: info[idx++] as TerminalStatusInfo,
terminalStatusNumber: Number(info[idx++]) as TerminalStatusNumber
userSeq: Number(info[0]),
pcStatus: info[1] as StatusCode,
phoneStatus: info[2] as StatusCode,
mobileStatus: info[3] as StatusCode,
conferenceStatus: info[4] as StatusCode,
statusMessage: info[5],
mobileConferenceStatus: info[6] as StatusCode,
imessengerStatus: info[7] as StatusCode,
terminalStatus: info[8] as TerminalStatusInfo,
terminalStatusNumber: Number(info[9]) as TerminalStatusNumber
});
});
return {

View File

@ -82,15 +82,14 @@ export const decodeStatusNotification: ProtocolDecoder<StatusNotification> = (
message: ProtocolMessage
) => {
const info = message.bodyList[0].split(BodyStringDivider);
let idx = 0;
return {
userSeq: Number(info[idx]),
pcStatus: info[idx++] as StatusCode,
phoneStatus: info[idx++] as StatusCode,
mobileStatus: info[idx++] as StatusCode,
conferenceStatus: info[idx++] as StatusCode,
statusMessage: info[idx++],
mobileConferenceStatus: info[idx++] as StatusCode,
imessengerStatus: info[idx++] as StatusCode
userSeq: Number(info[0]),
pcStatus: info[1] as StatusCode,
phoneStatus: info[2] as StatusCode,
mobileStatus: info[3] as StatusCode,
conferenceStatus: info[4] as StatusCode,
statusMessage: info[5],
mobileConferenceStatus: info[6] as StatusCode,
imessengerStatus: info[7] as StatusCode
} as StatusNotification;
};

View File

@ -47,16 +47,15 @@ export const decodeSubscribe: ProtocolDecoder<SubscribeResponse> = (
const statusInfos: StatusInfo[] = [];
message.bodyList.forEach(statusInfo => {
const info = statusInfo.split(BodyStringDivider);
let idx = 0;
statusInfos.push({
userSeq: Number(info[idx]),
pcStatus: info[idx++] as StatusCode,
phoneStatus: info[idx++] as StatusCode,
mobileStatus: info[idx++] as StatusCode,
conferenceStatus: info[idx++] as StatusCode,
statusMessage: info[idx++],
mobileConferenceStatus: info[idx++] as StatusCode,
imessengerStatus: info[idx++] as StatusCode
userSeq: Number(info[0]),
pcStatus: info[1] as StatusCode,
phoneStatus: info[2] as StatusCode,
mobileStatus: info[3] as StatusCode,
conferenceStatus: info[4] as StatusCode,
statusMessage: info[5],
mobileConferenceStatus: info[6] as StatusCode,
imessengerStatus: info[7] as StatusCode
});
});
return {
@ -74,16 +73,15 @@ export const decodeSubscribeData: ProtocolDecoder<SubscribeData> = (
const statusInfos: StatusInfo[] = [];
message.bodyList.forEach(statusInfo => {
const info = statusInfo.split(BodyStringDivider);
let idx = 0;
statusInfos.push({
userSeq: Number(info[idx]),
pcStatus: info[idx++] as StatusCode,
phoneStatus: info[idx++] as StatusCode,
mobileStatus: info[idx++] as StatusCode,
conferenceStatus: info[idx++] as StatusCode,
statusMessage: info[idx++],
mobileConferenceStatus: info[idx++] as StatusCode,
imessengerStatus: info[idx++] as StatusCode
userSeq: Number(info[0]),
pcStatus: info[1] as StatusCode,
phoneStatus: info[2] as StatusCode,
mobileStatus: info[3] as StatusCode,
conferenceStatus: info[4] as StatusCode,
statusMessage: info[5],
mobileConferenceStatus: info[6] as StatusCode,
imessengerStatus: info[7] as StatusCode
});
});
return {