package com.ematou.wxservice.entity.vo;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;

/**
 * 需要发送的模板消息
 * @author lhm
 * @version 1.0
 * 2021-05-13 09:45
 */
public class TemplateMessage {

    @JSONField(alternateNames = "openid")
    private String openId;

    /**
     * 预留，可选择的发送消息
     */
    @JSONField(alternateNames = "template_id")
    private String templateMsgId;

    private List<TemplateData> data;

    /**
     * 模板跳转链接（海外帐号没有跳转能力）
     */
    private String url;

    /**
     * 跳小程序所需数据，不需跳小程序可不用传该数据，非必填
     */
    private MiniProgramInfo miniProgram;


    public static class TemplateData {

        /**
         * 模板数据内容
         */
        private String value;

        /**
         * 模板内容字体颜色（16进制值），不填默认为黑色
         */
        private String color;

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getColor() {
            return color;
        }

        public void setColor(String color) {
            this.color = color;
        }

        @Override
        public String toString() {
            return "TemplateData{" +
                    "value='" + value + '\'' +
                    ", color='" + color + '\'' +
                    '}';
        }
    }

    public static class MiniProgramInfo {

        private String appId;

        private String pagePath;

        public String getAppId() {
            return appId;
        }

        public void setAppId(String appId) {
            this.appId = appId;
        }

        public String getPagePath() {
            return pagePath;
        }

        public void setPagePath(String pagePath) {
            this.pagePath = pagePath;
        }

        @Override
        public String toString() {
            return "MiniProgramInfo{" +
                    "appId='" + appId + '\'' +
                    ", pagePath='" + pagePath + '\'' +
                    '}';
        }
    }


    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getTemplateMsgId() {
        return templateMsgId;
    }

    public void setTemplateMsgId(String templateMsgId) {
        this.templateMsgId = templateMsgId;
    }

    public List<TemplateData> getData() {
        return data;
    }

    public void setData(List<TemplateData> data) {
        this.data = data;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public MiniProgramInfo getMiniProgram() {
        return miniProgram;
    }

    public void setMiniProgram(MiniProgramInfo miniProgram) {
        this.miniProgram = miniProgram;
    }

    @Override
    public String toString() {
        return "TemplateMessage{" +
                "openId='" + openId + '\'' +
                ", templateMsgId='" + templateMsgId + '\'' +
                ", data=" + data +
                ", url='" + url + '\'' +
                ", miniProgram=" + miniProgram +
                '}';
    }
}
