🎨 #2272 【企业微信】发送新客户欢迎语接口增加对file文件消息的支持
This commit is contained in:
@@ -1,10 +1,15 @@
|
|||||||
package me.chanjar.weixin.cp.bean.external.msg;
|
package me.chanjar.weixin.cp.bean.external.msg;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.cp.constant.WxCpConsts;
|
import me.chanjar.weixin.cp.constant.WxCpConsts;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author chutian0124
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
public class Attachment implements Serializable {
|
public class Attachment implements Serializable {
|
||||||
private static final long serialVersionUID = -8078748379570640198L;
|
private static final long serialVersionUID = -8078748379570640198L;
|
||||||
|
|
||||||
@@ -15,62 +20,35 @@ public class Attachment implements Serializable {
|
|||||||
|
|
||||||
private Link link;
|
private Link link;
|
||||||
|
|
||||||
private MiniProgram miniprogram;
|
@SerializedName("miniprogram")
|
||||||
|
private MiniProgram miniProgram;
|
||||||
|
|
||||||
private Video video;
|
private Video video;
|
||||||
|
|
||||||
@Override
|
private File file;
|
||||||
public String toString() {
|
|
||||||
return "Attachment{" +
|
|
||||||
"msgType='" + msgType + '\'' +
|
|
||||||
", image=" + image +
|
|
||||||
", link=" + link +
|
|
||||||
", miniprogram=" + miniprogram +
|
|
||||||
", video=" + video +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getMsgType() {
|
|
||||||
return msgType;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setMsgType(String msgType) {
|
|
||||||
this.msgType = msgType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Image getImage() {
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImage(Image image) {
|
public void setImage(Image image) {
|
||||||
this.image = image;
|
this.image = image;
|
||||||
this.msgType = WxCpConsts.WelcomeMsgType.IMAGE;
|
this.msgType = WxCpConsts.WelcomeMsgType.IMAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Link getLink() {
|
|
||||||
return link;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLink(Link link) {
|
public void setLink(Link link) {
|
||||||
this.link = link;
|
this.link = link;
|
||||||
this.msgType = WxCpConsts.WelcomeMsgType.LINK;
|
this.msgType = WxCpConsts.WelcomeMsgType.LINK;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MiniProgram getMiniprogram() {
|
public void setMiniProgram(MiniProgram miniProgram) {
|
||||||
return miniprogram;
|
this.miniProgram = miniProgram;
|
||||||
}
|
|
||||||
|
|
||||||
public void setMiniprogram(MiniProgram miniprogram) {
|
|
||||||
this.miniprogram = miniprogram;
|
|
||||||
this.msgType = WxCpConsts.WelcomeMsgType.MINIPROGRAM;
|
this.msgType = WxCpConsts.WelcomeMsgType.MINIPROGRAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Video getVideo() {
|
|
||||||
return video;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVideo(Video video) {
|
public void setVideo(Video video) {
|
||||||
this.video = video;
|
this.video = video;
|
||||||
this.msgType = WxCpConsts.WelcomeMsgType.VIDEO;
|
this.msgType = WxCpConsts.WelcomeMsgType.VIDEO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setFile(File file ) {
|
||||||
|
this.file = file;
|
||||||
|
this.msgType = WxCpConsts.WelcomeMsgType.FILE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
18
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/msg/File.java
vendored
Normal file
18
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/msg/File.java
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package me.chanjar.weixin.cp.bean.external.msg;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
|
* @date 2021-08-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class File implements Serializable {
|
||||||
|
private static final long serialVersionUID = 2794189478198329090L;
|
||||||
|
|
||||||
|
@SerializedName("media_id")
|
||||||
|
private String mediaId;
|
||||||
|
}
|
||||||
@@ -353,5 +353,10 @@ public class WxCpConsts {
|
|||||||
* 小程序消息.
|
* 小程序消息.
|
||||||
*/
|
*/
|
||||||
public static final String MINIPROGRAM = "miniprogram";
|
public static final String MINIPROGRAM = "miniprogram";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件消息.
|
||||||
|
*/
|
||||||
|
public static final String FILE = "file";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user