forked from binarywang/WxJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 binarywang#2155 【企业微信】发送新客户欢迎语接口增加对视频类型的支持,同时修复结构不正确的问题
- Loading branch information
1 parent
d1e8fe3
commit d6d3625
Showing
5 changed files
with
135 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/msg/Attachment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package me.chanjar.weixin.cp.bean.external.msg; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import me.chanjar.weixin.cp.constant.WxCpConsts; | ||
|
||
import java.io.Serializable; | ||
|
||
public class Attachment implements Serializable { | ||
private static final long serialVersionUID = -8078748379570640198L; | ||
|
||
@SerializedName("msgtype") | ||
private String msgType; | ||
|
||
private Image image; | ||
|
||
private Link link; | ||
|
||
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; | ||
} | ||
|
||
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; | ||
this.msgType = WxCpConsts.WelcomeMsgType.MINIPROGRAM; | ||
} | ||
|
||
public Video getVideo() { | ||
return video; | ||
} | ||
|
||
public void setVideo(Video video) { | ||
this.video = video; | ||
this.msgType = WxCpConsts.WelcomeMsgType.VIDEO; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/msg/Video.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package me.chanjar.weixin.cp.bean.external.msg; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* 视频消息 | ||
* | ||
* @author pg | ||
* @date 2021-6-21 | ||
*/ | ||
@Data | ||
public class Video implements Serializable { | ||
private static final long serialVersionUID = -6048642921382867138L; | ||
@SerializedName("media_id") | ||
private String mediaId; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters