package com.wechat.callback.tencentrequests;

import javax.xml.bind.annotation.*;

@XmlTransient
public abstract class BaseRequest {
    @XmlType
    @XmlEnum(String.class)
    public static enum MsgTypeEnum {
        @XmlEnumValue("text")TEXT,   //文本消息
        @XmlEnumValue("event")EVENT, //事件消息
        @XmlEnumValue("image")IMAGE, //图片消息
        @XmlEnumValue("location")LOCATION, //地理位置消息
        @XmlEnumValue("voice")VOICE, //语音消息
        @XmlEnumValue("video")VIDEO, //视频消息
        @XmlEnumValue("shortvideo")SHORTVIDEO, //小视屏消息
        @XmlEnumValue("link")LINK, //链接消息
    }

    private String ToUserName;  //公众号
    private String FromUserName;//用户OpenID
    private String CreateTime;  //创建时间
    private MsgTypeEnum MsgType;//消息类型

    public String getToUserName() {
        return ToUserName;
    }

    @XmlElement(name = "ToUserName")
    public void setToUserName(String toUserName) {
        ToUserName = toUserName;
    }

    public String getFromUserName() {
        return FromUserName;
    }

    @XmlElement(name = "FromUserName")
    public void setFromUserName(String fromUserName) {
        FromUserName = fromUserName;
    }

    public String getCreateTime() {
        return CreateTime;
    }

    @XmlElement(name = "CreateTime")
    public void setCreateTime(String createTime) {
        CreateTime = createTime;
    }

    public MsgTypeEnum getMsgType() {
        return MsgType;
    }

    @XmlElement(name = "MsgType")
    public void setMsgType(MsgTypeEnum msgType) {
        MsgType = msgType;
    }
}
