mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-11-01 00:46:54 +08:00 
			
		
		
		
	🆕【企业微信】添加对新的模板卡片更新消息“更新点击用户的按钮点击文案消息”的支持
This commit is contained in:
		| @@ -78,6 +78,14 @@ public abstract class WxCpXmlOutMessage implements Serializable { | ||||
|   public static TaskCardBuilder TASK_CARD() { | ||||
|     return new TaskCardBuilder(); | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * 获得任务卡片消息builder. | ||||
|    */ | ||||
|   public static UpdateButtonBuilder UPDATE_BUTTON() { | ||||
|     return new UpdateButtonBuilder(); | ||||
|   } | ||||
|  | ||||
|   protected String toXml() { | ||||
|     return XStreamTransformer.toXml((Class) this.getClass(), this); | ||||
|   } | ||||
|   | ||||
| @@ -0,0 +1,33 @@ | ||||
| package me.chanjar.weixin.cp.bean.message; | ||||
|  | ||||
| import com.thoughtworks.xstream.annotations.XStreamAlias; | ||||
| import com.thoughtworks.xstream.annotations.XStreamConverter; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import me.chanjar.weixin.common.api.WxConsts; | ||||
| import me.chanjar.weixin.common.util.xml.XStreamCDataConverter; | ||||
| import me.chanjar.weixin.common.util.xml.XStreamMediaIdConverter; | ||||
| import me.chanjar.weixin.common.util.xml.XStreamReplaceNameConverter; | ||||
|  | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author nickname263 | ||||
|  * @date 2021-09-23 | ||||
|  */ | ||||
| @XStreamAlias("xml") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = false) | ||||
| public class WxCpXmlOutUpdateBtnMessage  extends WxCpXmlOutMessage { | ||||
|   private static final long serialVersionUID = 976182367423048138L; | ||||
|   @XStreamAlias("Button") | ||||
|   @XStreamConverter(value = XStreamReplaceNameConverter.class) | ||||
|   private String replaceName; | ||||
|  | ||||
|   public WxCpXmlOutUpdateBtnMessage() { | ||||
|     this.msgType = WxConsts.XmlMsgType.UPDATE_BUTTON; | ||||
|   } | ||||
|  | ||||
|  | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,29 @@ | ||||
| package me.chanjar.weixin.cp.bean.outxmlbuilder; | ||||
|  | ||||
| import me.chanjar.weixin.cp.bean.message.WxCpXmlOutTaskCardMessage; | ||||
| import me.chanjar.weixin.cp.bean.message.WxCpXmlOutUpdateBtnMessage; | ||||
|  | ||||
| /** | ||||
|  * 模板卡片更新点击用户的按钮点击文案消息builder | ||||
|  * | ||||
|  * @author nickname263 | ||||
|  */ | ||||
| public class UpdateButtonBuilder extends BaseBuilder<UpdateButtonBuilder, WxCpXmlOutUpdateBtnMessage> { | ||||
|  | ||||
|  | ||||
|   private String replaceName; | ||||
|  | ||||
|   public UpdateButtonBuilder replaceName(String replaceName) { | ||||
|     this.replaceName = replaceName; | ||||
|     return this; | ||||
|   } | ||||
|  | ||||
|   @Override | ||||
|   public WxCpXmlOutUpdateBtnMessage build() { | ||||
|     WxCpXmlOutUpdateBtnMessage m = new WxCpXmlOutUpdateBtnMessage(); | ||||
|     setCommon(m); | ||||
|     m.setReplaceName(this.replaceName); | ||||
|     return m; | ||||
|   } | ||||
|  | ||||
| } | ||||
| @@ -54,6 +54,7 @@ public class XStreamTransformer { | ||||
|     map.put(WxCpXmlOutVideoMessage.class, configWxCpXmlOutVideoMessage()); | ||||
|     map.put(WxCpXmlOutVoiceMessage.class, configWxCpXmlOutVoiceMessage()); | ||||
|     map.put(WxCpXmlOutTaskCardMessage.class, configWxCpXmlOutTaskCardMessage()); | ||||
|     map.put(WxCpXmlOutUpdateBtnMessage.class, configWxCpXmlOutUpdateBtnMessage()); | ||||
|     map.put(WxCpTpXmlPackage.class, configWxCpTpXmlPackage()); | ||||
|     map.put(WxCpTpXmlMessage.class, configWxCpTpXmlMessage()); | ||||
|     return map; | ||||
| @@ -119,6 +120,12 @@ public class XStreamTransformer { | ||||
|     xstream.processAnnotations(WxCpXmlOutTaskCardMessage.class); | ||||
|     return xstream; | ||||
|   } | ||||
|   private static XStream configWxCpXmlOutUpdateBtnMessage() { | ||||
|     XStream xstream = XStreamInitializer.getInstance(); | ||||
|     xstream.processAnnotations(WxCpXmlOutMessage.class); | ||||
|     xstream.processAnnotations(WxCpXmlOutUpdateBtnMessage.class); | ||||
|     return xstream; | ||||
|   } | ||||
|  | ||||
|   private static XStream configWxCpTpXmlPackage() { | ||||
|     XStream xstream = XStreamInitializer.getInstance(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 nickname263
					nickname263