package com.mercury.chat.common.util;

import com.mercury.chat.common.MessageType;
import com.mercury.chat.common.constant.StatusCode;
import com.mercury.chat.common.struct.protocol.Header;
import com.mercury.chat.common.struct.protocol.Message;

public class MessageUtil {
	
	public static Message buildMessage(MessageType messageType, StatusCode statusCode, Object body) {
		return new Message().header(new Header().type(messageType.value())
												.statusCode(statusCode.getKey()))
							.body(body);
	}
	
	
}

@@ -278,16 +278,357 @@
 l %7B%0D%0A%09%0D%0A
+%09public static Message buildMessage(MessageType messageType) %7B%0D%0A%09%09return new Message().header(new Header().type(messageType.value()));%0D%0A%09%7D%0D%0A%09%0D%0A%09public static Message buildMessage(MessageType messageType, StatusCode statusCode) %7B%0D%0A%09%09return new Message().header(new Header().type(messageType.value()).statusCode(statusCode.getKey()));%0D%0A%09%7D%0D%0A%09%0D%0A
 %09public 
@@ -791,22 +791,8 @@
 e())
-%0D%0A%09%09%09%09%09%09%09%09%09%09%09%09
 .sta
@@ -824,17 +824,8 @@
 ()))
-%0D%0A%09%09%09%09%09%09%09
 .bod
@@ -841,14 +841,11 @@
 %0A%09%7D%0D%0A%09%0D%0A
-%09%0D%0A
 %7D%0D%0A

add message util method.