This commit is contained in:
병준 박 2019-09-25 11:48:00 +09:00
commit 06f0219660
5 changed files with 14 additions and 14 deletions

View File

@ -11,14 +11,14 @@ import {
export interface BuddyUpdateRequest extends ProtocolRequest {
// 0. 사용자SEQ(n)
userSeq: number;
seq: number;
// 1. 즐겨찾기여부(y)
isFavorit: boolean;
}
export interface BuddyUpdateResponse extends ProtocolResponse {
// 0. 사용자SEQ(n)
userSeq: number;
seq: number;
// 1. 즐겨찾기여부(y)
isFavorit: boolean;
}
@ -28,7 +28,7 @@ export const encodeBuddyUpdate: ProtocolEncoder<BuddyUpdateRequest> = (
) => {
const bodyList: PacketBody[] = [];
bodyList.push({ type: PacketBodyValue.Integer, value: req.userSeq });
bodyList.push({ type: PacketBodyValue.Integer, value: req.seq });
bodyList.push({
type: PacketBodyValue.String,
value: req.isFavorit ? 'Y' : 'N'
@ -41,7 +41,7 @@ export const decodeBuddyUpdate: ProtocolDecoder<BuddyUpdateResponse> = (
message: ProtocolMessage
) => {
return {
userSeq: message.bodyList[0],
seq: message.bodyList[0],
isFavorit: message.bodyList[1] === 'Y' ? true : false
} as BuddyUpdateResponse;
};

View File

@ -45,7 +45,7 @@ export interface RoomInfo {
export interface UserInfoShort {
// 0. 사용자SEQ
userSeq: number;
seq: number;
// 1. 사용자명
name: string;
// 2. 사진파일
@ -76,7 +76,7 @@ export interface UserInfoShort {
export interface UserInfo {
// 0. 사용자SEQ
userSeq: number;
seq: number;
// 1. 사용자명
name: string;
// 2. 사진파일
@ -232,7 +232,7 @@ export const decodeRoomUserShortData: ProtocolDecoder<
message.bodyList.slice(1).forEach(userInfo => {
const info = userInfo.split(BodyStringDivider);
userInfos.push({
userSeq: info[0],
seq: info[0],
name: info[1],
profileImageFile: info[2],
isJoinRoom: info[3],
@ -262,7 +262,7 @@ export const decodeRoomUserData: ProtocolDecoder<RoomUserDataResponse> = (
message.bodyList.slice(1).forEach(userInfo => {
const info = userInfo.split(BodyStringDivider);
userInfos.push({
userSeq: info[0],
seq: info[0],
name: info[1],
profileImageFile: info[2],
grade: info[3],

View File

@ -12,7 +12,7 @@ import { UserInfo } from '../types/userInfo';
export interface BuddyInfo {
// 사용자SEQ
userSeq: number;
seq: number;
// 즐.찾 여부
isFavorit: boolean;
// 친구여부
@ -63,7 +63,7 @@ export const decodeSyncBuddyData: ProtocolDecoder<SyncBuddyDataResponse> = (
message.bodyList.forEach(buddyinfo => {
const info = buddyinfo.split(BodyStringDivider);
buddyInfos.push({
userSeq: info[0],
seq: info[0],
isFavorit: info[1] === 'Y' ? true : false,
isBuddy: info[2] === 'Y' ? true : false
});
@ -81,7 +81,7 @@ export const decodeSyncBuddyDataDetail: ProtocolDecoder<
const info = buddyinfo.split(BodyStringDivider);
let i = 0;
buddyInfos.push({
userSeq: info[i],
seq: info[i],
name: info[i++],
profileImageFile: info[i++],
grade: info[i++],

View File

@ -105,7 +105,7 @@ export const decodeSyncRoomUserData: ProtocolDecoder<
message.bodyList.slice(1).forEach(userInfo => {
const info = userInfo.split(BodyStringDivider);
userInfos.push({
userSeq: info[0],
seq: info[0],
name: info[1],
profileImageFile: info[2],
isJoinRoom: info[3],
@ -135,7 +135,7 @@ export const decodeSyncRoomUserDataDetail: ProtocolDecoder<
message.bodyList.slice(1).forEach(userInfo => {
const info = userInfo.split(BodyStringDivider);
userInfos.push({
userSeq: info[0],
seq: info[0],
name: info[1],
profileImageFile: info[2],
grade: info[3],

View File

@ -3,7 +3,7 @@ import { EmployeeType } from '@ucap-webmessenger/protocol-room';
export interface UserInfo {
// 사용자SEQ
userSeq: number;
seq: number;
// 사용자명
name: string;
// 사진파일