Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message能否添加新的MpnewsMessage子类 #193

Closed
yaosing opened this issue Feb 21, 2019 · 2 comments
Closed

Message能否添加新的MpnewsMessage子类 #193

yaosing opened this issue Feb 21, 2019 · 2 comments

Comments

@yaosing
Copy link

yaosing commented Feb 21, 2019

使用MessageAPI 发送永久图文素材 需要实现一个新的MpnewsMessage 子类, 项目中是否可以添加mpnews类型的消息的实现类

客服接口-发消息

接口调用请求说明

http请求方式: POST
https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN

发送图文消息(点击跳转到图文消息页面) 图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008。

{
    "touser":"OPENID",
    "msgtype":"mpnews",
    "mpnews":
    {
         "media_id":"MEDIA_ID"
    }
}

Code like this:

package weixin.popular.bean.message.message;

import weixin.popular.bean.message.message.Message;

/**
 * 
 * 永久图文素材消息 
 * 图文消息条数限制在1条以内,注意,如果图文数超过1,则将会返回错误码45008。
 * 
 * @author tyao
 */
public class MpnewsMessage extends Message {
    public MpnewsMessage() {
    }

    public MpnewsMessage(String toUser, String mediaId) {
        super(toUser, "mpnews");
    }

    private Mpnews mpnews;

    public Mpnews getMpnews() {
        return mpnews;
    }

    public void setMpnews(Mpnews mpnews) {
        this.mpnews = mpnews;
    }

    public static class Mpnews {
        private String media_id;

        public String getMedia_id() {
            return media_id;
        }

        public void setMedia_id(String mediaId) {
            media_id = mediaId;
        }
    }
}
@yaosing yaosing changed the title Message能否添加新的MPNewsMessage子类 Message能否添加新的MpnewsMessage子类 Feb 21, 2019
liyiorg pushed a commit that referenced this issue Feb 22, 2019
添加客服输入状态接口 MessageAPI.messageCustomTyping
@liyiorg
Copy link
Owner

liyiorg commented Feb 22, 2019

2.8.26 版本已支持

@yaosing
Copy link
Author

yaosing commented Feb 25, 2019

谢啦!!

@yaosing yaosing closed this as completed Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants