Giter Site home page Giter Site logo

Comments (8)

qq330496248 avatar qq330496248 commented on September 28, 2024

接口文档:https://developer.work.weixin.qq.com/document/path/92698

from wxjava.

binarywang avatar binarywang commented on September 28, 2024

欢迎直接提供修复代码

from wxjava.

qq330496248 avatar qq330496248 commented on September 28, 2024

欢迎直接提供修复代码

企微接口文最近有更新,我在WxCpMsgTemplate新增了chat_id_list和allow_select两个参数,源码如下:

package me.chanjar.weixin.cp.bean.external;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.cp.bean.external.msg.Attachment;
import me.chanjar.weixin.cp.bean.external.msg.Text;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

import java.io.Serializable;
import java.util.List;

/**

/**

  • 群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群
    */
    @SerializedName("chat_type")
    private String chatType;

/**

  • 客户的外部联系人id列表,仅在chat_type为single时有效,不可与sender同时为空,最多可传入1万个客户
    */
    @SerializedName("external_userid")
    private List externalUserid;

/**

  • 客户群id列表,仅在chat_type为group时有效,最多可一次指定2000个客户群。指定群id之后,收到任务的群主无须再选择客户群,仅对4.1.10及以上版本的企业微信终端生效
    */
    @SerializedName("chat_id_list")
    private List chatIdList;

/**

  • 发送企业群发消息的成员userid,当类型为发送给客户群时必填
    */
    private String sender;

/**

  • 是否允许成员在待发送客户列表中重新进行选择,默认为false,仅支持客户群发场景
    */
    @SerializedName("allow_select")
    private Boolean allowSelect;

/**

  • 消息文本内容,最多4000个字节
    */
    private Text text;

/**

  • 附件,最多支持添加9个附件
    */
    private List attachments;

/**

  • From json wx cp msg template.
  • @param json the json
  • @return the wx cp msg template
    */
    public static WxCpMsgTemplate fromJson(String json) {
    return WxCpGsonBuilder.create().fromJson(json, WxCpMsgTemplate.class);
    }

/**

  • To json string.
  • @return the string
    */
    public String toJson() {
    return WxCpGsonBuilder.create().toJson(this);
    }

}

from wxjava.

qq330496248 avatar qq330496248 commented on September 28, 2024

欢迎直接提供修复代码

企微最近有更新企业群发的接口文档,我在WxCpMsgTemplate新增了chat_id_list和allow_select两个参数,代码如下:

package me.chanjar.weixin.cp.bean.external;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.cp.bean.external.msg.Attachment;
import me.chanjar.weixin.cp.bean.external.msg.Text;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

import java.io.Serializable;
import java.util.List;

/**

/**

  • 群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群
    */
    @SerializedName("chat_type")
    private String chatType;

/**

  • 客户的外部联系人id列表,仅在chat_type为single时有效,不可与sender同时为空,最多可传入1万个客户
    */
    @SerializedName("external_userid")
    private List externalUserid;

/**

  • 客户群id列表,仅在chat_type为group时有效,最多可一次指定2000个客户群。指定群id之后,收到任务的群主无须再选择客户群,仅对4.1.10及以上版本的企业微信终端生效
    */
    @SerializedName("chat_id_list")
    private List chatIdList;

/**

  • 发送企业群发消息的成员userid,当类型为发送给客户群时必填
    */
    private String sender;

/**

  • 是否允许成员在待发送客户列表中重新进行选择,默认为false,仅支持客户群发场景
    */
    @SerializedName("allow_select")
    private Boolean allowSelect;

/**

  • 消息文本内容,最多4000个字节
    */
    private Text text;

/**

  • 附件,最多支持添加9个附件
    */
    private List attachments;

/**

  • From json wx cp msg template.
  • @param json the json
  • @return the wx cp msg template
    */
    public static WxCpMsgTemplate fromJson(String json) {
    return WxCpGsonBuilder.create().fromJson(json, WxCpMsgTemplate.class);
    }

/**

  • To json string.
  • @return the string
    */
    public String toJson() {
    return WxCpGsonBuilder.create().toJson(this);
    }

}

from wxjava.

qq330496248 avatar qq330496248 commented on September 28, 2024

image
上面的代码复制后格式有变化,具体新增的两个参数请看上图。

from wxjava.

qq330496248 avatar qq330496248 commented on September 28, 2024

另外还有一个需要新增的参数tag_filter.group_list.tag_list,这个就需要新增类去处理了,可能要麻烦大佬有空再帮忙处理一下 [抱拳]

from wxjava.

binarywang avatar binarywang commented on September 28, 2024

你可以直接提交PR的

from wxjava.

qq330496248 avatar qq330496248 commented on September 28, 2024

你可以直接提交PR的

已提交,谢谢大佬

from wxjava.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.