mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-11-01 00:46:54 +08:00 
			
		
		
		
	🎨 #2272 【企业微信】发送新客户欢迎语接口增加对file文件消息的支持
This commit is contained in:
		| @@ -1,10 +1,15 @@ | ||||
| package me.chanjar.weixin.cp.bean.external.msg; | ||||
|  | ||||
| import com.google.gson.annotations.SerializedName; | ||||
| import lombok.Data; | ||||
| import me.chanjar.weixin.cp.constant.WxCpConsts; | ||||
|  | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author chutian0124 | ||||
|  */ | ||||
| @Data | ||||
| public class Attachment implements Serializable { | ||||
|   private static final long serialVersionUID = -8078748379570640198L; | ||||
|  | ||||
| @@ -15,62 +20,35 @@ public class Attachment implements Serializable { | ||||
|  | ||||
|   private Link link; | ||||
|  | ||||
|   private MiniProgram miniprogram; | ||||
|   @SerializedName("miniprogram") | ||||
|   private MiniProgram miniProgram; | ||||
|  | ||||
|   private Video video; | ||||
|  | ||||
|   @Override | ||||
|   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; | ||||
|   } | ||||
|   private File file; | ||||
|  | ||||
|   public void setImage(Image image) { | ||||
|     this.image = image; | ||||
|     this.msgType = WxCpConsts.WelcomeMsgType.IMAGE; | ||||
|   } | ||||
|  | ||||
|   public Link getLink() { | ||||
|     return link; | ||||
|   } | ||||
|  | ||||
|   public void setLink(Link link) { | ||||
|     this.link = link; | ||||
|     this.msgType = WxCpConsts.WelcomeMsgType.LINK; | ||||
|   } | ||||
|  | ||||
|   public MiniProgram getMiniprogram() { | ||||
|     return miniprogram; | ||||
|   } | ||||
|  | ||||
|   public void setMiniprogram(MiniProgram miniprogram) { | ||||
|     this.miniprogram = miniprogram; | ||||
|   public void setMiniProgram(MiniProgram miniProgram) { | ||||
|     this.miniProgram = miniProgram; | ||||
|     this.msgType = WxCpConsts.WelcomeMsgType.MINIPROGRAM; | ||||
|   } | ||||
|  | ||||
|   public Video getVideo() { | ||||
|     return video; | ||||
|   } | ||||
|  | ||||
|   public void setVideo(Video video) { | ||||
|     this.video = 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 FILE = "file"; | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Binary Wang
					Binary Wang