package com.xunwang.education.util;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.xunwang.education.entity.socket.Message;

public class MessageUtil {

    public static String getMessage(String toUid, String fromUid, String context) throws JsonProcessingException {
        Message message1 = new Message();
        message1.setToUid(toUid).setFromUid(fromUid).setContext(context);
        ObjectMapper mapper = new ObjectMapper();

        return mapper.writeValueAsString(message1);
    }
}
