package ink.wgink.module.wechat.officialaccount.pojo.vos;

import ink.wgink.annotation.CheckBeanAnnotation;
import ink.wgink.annotation.CheckEmptyAnnotation;

import java.util.Map;

/**
 * @ClassName: TemplateMessageSendVO
 * @Description: 模板消息发送
 * @Author: wanggeng
 * @Date: 2021/9/30 9:51 上午
 * @Version: 1.0
 */
public class OfficialAccountTemplateMessageSendVO {

    @CheckEmptyAnnotation(name = "touser", value = "接收者openid")
    private String touser;
    @CheckEmptyAnnotation(name = "template_id", value = "模板ID")
    private String template_id;
    private String url;
    @CheckBeanAnnotation
    private Miniapp miniprogram;
    private Map<String, Data> data;

    public String getTouser() {
        return touser == null ? "" : touser.trim();
    }

    public void setTouser(String touser) {
        this.touser = touser;
    }

    public String getTemplate_id() {
        return template_id == null ? "" : template_id.trim();
    }

    public void setTemplate_id(String template_id) {
        this.template_id = template_id;
    }

    public String getUrl() {
        return url == null ? "" : url.trim();
    }

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

    public Miniapp getMiniprogram() {
        return miniprogram;
    }

    public void setMiniprogram(Miniapp miniprogram) {
        this.miniprogram = miniprogram;
    }

    public Map<String, Data> getData() {
        return data;
    }

    public void setData(Map<String, Data> data) {
        this.data = data;
    }

    public static class Miniapp {
        @CheckEmptyAnnotation(name = "appid", value = "所需跳转到的小程序appid")
        private String appid;
        @CheckEmptyAnnotation(name = "pagepath", value = "所需跳转到小程序的具体页面路径")
        private String pagepath;

        public String getAppid() {
            return appid == null ? "" : appid.trim();
        }

        public void setAppid(String appid) {
            this.appid = appid;
        }

        public String getPagepath() {
            return pagepath == null ? "" : pagepath.trim();
        }

        public void setPagepath(String pagepath) {
            this.pagepath = pagepath;
        }
    }

    public static class Data {
        private String value;
        private String color;

        public String getValue() {
            return value == null ? "" : value.trim();
        }

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

        public String getColor() {
            return color == null ? "#000000" : color.trim();
        }

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

}
