변수명 재정의

This commit is contained in:
leejh 2019-09-25 09:32:56 +09:00
parent 6e7b38bbbb
commit ac1e3f8def
5 changed files with 14 additions and 14 deletions

View File

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

View File

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

View File

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

View File

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

View File

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