package com.ycwl.basic.integration.message.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ZtMessage {
    private String messageId;   // unique message identifier
    private String channelId;   // required
    private String title;       // required
    private String content;     // required
    private String target;      // required
    private Map<String, Object> extra; // optional
    private String sendReason;  // optional
    private String sendBiz;     // optional

    public static ZtMessage of(String channelId, String title, String content, String target) {
        return ZtMessage.builder()
                .channelId(channelId)
                .title(title)
                .content(content)
                .target(target)
                .extra(new HashMap<>())
                .build();
    }
}