model 의 export,

buddy-update 의 항목명 수정.
This commit is contained in:
leejh 2019-09-23 14:36:50 +09:00
parent d19602e378
commit 4d8aedd545
2 changed files with 7 additions and 4 deletions

View File

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

View File

@ -1,6 +1,9 @@
/* /*
* Public API Surface of ucap-webmessenger-protocol-buddy * Public API Surface of ucap-webmessenger-protocol-buddy
*/ */
export * from './lib/models/buddy-add';
export * from './lib/models/buddy-del';
export * from './lib/models/buddy-update';
export * from './lib/services/buddy-protocol.service'; export * from './lib/services/buddy-protocol.service';