package com.tzy.dto;

import lombok.Builder;
import lombok.Data;


/**
 *  Message message = Message.builder().code("1").code("chat")
 *                 .messageType("chat_to_room")
 *                 .messageParam(
 *                         MessageParam.builder()
 *                                 .receiver("TC-8050597605559")
 *                                 .payload(
 *                                         MessageParam.Payload.builder()
 *                                                 .contentType("CHANGES_NUM_PEOPLE")
 *                                                 .sender("2477")
 *                                                 .content("你好!")
 *                                                 .extra("{}")
 *                                                 .build()
 *                                 ).build()).build();
 */
@Data
@Builder
public class Message {
    //推送code
    private String code;
    //推送消息类型
    private String messageType;
    //推送消息参数
    private MessageParam messageParam;

    @Data
    @Builder
    public static class MessageParam {
        //接受者(直播间code等)
        private String receiver;
        //消息体
        private Payload payload;

        @Data
        @Builder
        public static class Payload {
            //类型
            private String contentType;
            //发送人,无随意
            private String sender;
            //标题
            private String content;
            //json参数
            private String extra;
        }
    }
}
